public abstract class AsyncService extends Service implements java.lang.Runnable
Extends the simple Service
class to provide an asyncronous
messaging service for the transport protocol.
Modifier and Type | Field and Description |
---|---|
protected SshThread |
thread |
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
Constructor and Description |
---|
AsyncService(java.lang.String serviceName)
Constructs an asyncronous service.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int[] |
getAsyncMessageFilter()
Implement this method by returning the message ids of the asyncrounous
messages your implementation wants to receive.
|
protected abstract void |
onMessageReceived(SshMessage msg)
Called by the service thread when an asyncronous message is received.
|
protected void |
onStart()
Implements the abstract
Service method and starts the
service thread. |
protected abstract void |
onStop()
The service thread calls this method when the thread is exiting.
|
void |
run()
Implements the asyncronous services message loop.
|
getServiceName, getState, init, onServiceAccept, onServiceInit, onServiceRequest, sendServiceAccept, start, stop
protected SshThread thread
public AsyncService(java.lang.String serviceName)
Constructs an asyncronous service.
serviceName
- the name of the serviceprotected void onStart() throws java.io.IOException
Implements the abstract Service
method and starts the
service thread.
public final void run()
Implements the asyncronous services message loop.
run
in interface java.lang.Runnable
protected abstract void onStop()
The service thread calls this method when the thread is exiting.
protected abstract int[] getAsyncMessageFilter()
Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.
protected abstract void onMessageReceived(SshMessage msg) throws java.io.IOException
Called by the service thread when an asyncronous message is received.
msg
- the message receivedjava.io.IOException
- if an IO error occursCopyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.