Package org.zeromq
Class ZAgent.SimpleAgent
java.lang.Object
org.zeromq.ZAgent.SimpleAgent
- All Implemented Interfaces:
ZAgent
- Enclosing interface:
ZAgent
Creates a very simple agent with an easy lock mechanism.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.zeromq.ZAgent
ZAgent.Creator, ZAgent.SelectorCreator, ZAgent.SimpleAgent -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the pipe.pipe()Returns the socket used for communication.recv()Receives a control message sent from the Plateau in the Corbeille.recv(boolean wait) Receives a control message sent from the Plateau in the Corbeille.recv(int timeout) Receives a control message sent from the Plateau in the Corbeille.booleanSends a control message from the Corbeille to the Plateau side.booleanSends a control message from the Corbeille to the Plateau side.booleanSends a control message from the Corbeille to the Plateau.booleanSends a control message from Corbeille side to the Plateau side.booleansign()Gives a sign if the distant Star is here.
-
Field Details
-
pipe
-
lock
private final byte[] lock -
locked
private boolean locked
-
-
Constructor Details
-
SimpleAgent
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 Details
-
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
Description copied from interface:ZAgentReceives a control message sent from the Plateau in the Corbeille. The call is blocking. -
recv
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
Description copied from interface:ZAgentReceives a control message sent from the Plateau in the Corbeille. The call is blocking depending on the parameter. -
send
Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau. -
send
Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau side. -
send
Description copied from interface:ZAgentSends a control message from the Corbeille to the Plateau side. -
send
Description copied from interface:ZAgentSends a control message from Corbeille side to the Plateau side. -
pipe
Description copied from interface:ZAgentReturns the socket used for communication. For advanced usage.
-