Package org.zeromq
Class ZAgent.SimpleAgent
- java.lang.Object
-
- org.zeromq.ZAgent.SimpleAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zeromq.ZAgent
ZAgent.Creator, ZAgent.SelectorCreator, ZAgent.SimpleAgent
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]lockprivate booleanlockedprivate ZMQ.Socketpipe
-
Constructor Summary
Constructors Constructor Description SimpleAgent(ZMQ.Socket pipe, java.lang.String lock)Creates a new simple agent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the pipe.ZMQ.Socketpipe()Returns the socket used for communication.ZMsgrecv()Receives a control message sent from the Plateau in the Corbeille.ZMsgrecv(boolean wait)Receives a control message sent from the Plateau in the Corbeille.ZMsgrecv(int timeout)Receives a control message sent from the Plateau in the Corbeille.booleansend(java.lang.String word)Sends a control message from the Corbeille to the Plateau side.booleansend(java.lang.String word, boolean more)Sends a control message from the Corbeille to the Plateau side.booleansend(ZMsg message)Sends a control message from the Corbeille to the Plateau.booleansend(ZMsg msg, boolean destroy)Sends a control message from Corbeille side to the Plateau side.booleansign()Gives a sign if the distant Star is here.
-
-
-
Field Detail
-
pipe
private final ZMQ.Socket pipe
-
lock
private final byte[] lock
-
locked
private boolean locked
-
-
Constructor Detail
-
SimpleAgent
public SimpleAgent(ZMQ.Socket pipe, java.lang.String lock)
Creates a new simple agent.- Parameters:
pipe- the pipe used to send control messages to the distant IStar.lock- the lock to use. If null, the locking mechanism is omitted.
-
-
Method Detail
-
sign
public boolean sign()
Description copied from interface:ZAgentGives a sign if the distant Star is here.
-
close
public void close()
Description copied from interface:ZAgentCloses the pipe.
-
recv
public ZMsg recv()
Description copied from interface:ZAgentReceives a control message sent from the Plateau in the Corbeille. The call is blocking.
-
recv
public ZMsg recv(int timeout)
Description copied from interface:ZAgentReceives a control message sent from the Plateau in the Corbeille. The call times out if there is no message after the elapsed time.
-
recv
public ZMsg recv(boolean wait)
Description copied from interface:ZAgentReceives a control message sent from the Plateau in the Corbeille. The call is blocking depending on the parameter.
-
send
public boolean send(ZMsg message)
Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau.
-
send
public boolean send(java.lang.String word)
Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau side.
-
send
public boolean send(java.lang.String word, boolean more)Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau side.
-
send
public boolean send(ZMsg msg, boolean destroy)
Description copied from interface:ZAgentSends a control message from Corbeille side to the Plateau side.
-
pipe
public ZMQ.Socket pipe()
Description copied from interface:ZAgentReturns the socket used for communication. For advanced usage.
-
-