|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.j2ssh.transport.SshMessageStore
The message store allows the transport protocol to provide asynchronous messaging. When an object (such as Service) wishes to receive messages, it creates an instance of the message store and calls the TransportProtocol interface method registerMessage passing the message Id of the desired message and the message store object that will be called.
When a message is received the transport layer looks up the message store object for the incoming message Id and adds the message to it. Any waiting threads are notified so that the message can be handled appropriatley.
Constructor Summary | |
SshMessageStore()
Constructs the message store object. |
Method Summary | |
void |
addMessage(SshMessage msg)
Adds a message to the message store and notify the waiting threads. |
SshMessage |
getMessage()
Get the next message available from the message store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SshMessageStore()
Constructs the message store object.
Method Detail |
public void addMessage(SshMessage msg)
Adds a message to the message store and notify the waiting threads.
msg
- The message to add.public SshMessage getMessage()
Get the next message available from the message store. If there are no messages available, the method will wait untill notified of a new message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |