com.sshtools.j2ssh.transport
Class SshMessageStore

java.lang.Object
  |
  +--com.sshtools.j2ssh.transport.SshMessageStore

public final class SshMessageStore
extends java.lang.Object

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.

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )

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

SshMessageStore

public SshMessageStore()

Constructs the message store object.

Method Detail

addMessage

public void addMessage(SshMessage msg)

Adds a message to the message store and notify the waiting threads.

Parameters:
msg - The message to add.

getMessage

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.

Returns:
The next available message.


Copyright © 2002 Sshtools.com. All Rights Reserved.