Save This Page
Home » j2ssh-0.2.9-src » com.sshtools.j2ssh.transport » [javadoc | source]
com.sshtools.j2ssh.transport
abstract public class: AsyncService [javadoc | source]
java.lang.Object
   com.sshtools.j2ssh.transport.Service
      com.sshtools.j2ssh.transport.AsyncService

All Implemented Interfaces:
    Runnable

Direct Known Subclasses:
    ConnectionProtocol, AuthenticationProtocolServer

Extends the simple Service class to provide an asyncronous messaging service for the transport protocol.

Field Summary
protected  SshThread thread     
Fields inherited from com.sshtools.j2ssh.transport.Service:
REQUESTING_SERVICE,  ACCEPTING_SERVICE,  messageStore,  transport,  startMode,  state
Constructor:
 public AsyncService(String serviceName) 

    Constructs an asyncronous service.

    Parameters:
    serviceName - the name of the service
    since: 0.2.0 -
Method from com.sshtools.j2ssh.transport.AsyncService Summary:
getAsyncMessageFilter,   onMessageReceived,   onStart,   onStop,   run
Methods from com.sshtools.j2ssh.transport.Service:
getServiceName,   getState,   init,   onServiceAccept,   onServiceInit,   onServiceRequest,   onStart,   sendServiceAccept,   start,   stop
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sshtools.j2ssh.transport.AsyncService Detail:
 abstract protected int[] getAsyncMessageFilter()

    Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.

 abstract protected  void onMessageReceived(SshMessage msg) throws IOException

    Called by the service thread when an asyncronous message is received.

 protected  void onStart() throws IOException 

    Implements the abstract Service method and starts the service thread.

 abstract protected  void onStop()

    The service thread calls this method when the thread is exiting.

 public final  void run() 

    Implements the asyncronous services message loop.