com.sshtools.j2ssh.transport
Class AsyncService
- Runnable
public abstract class AsyncService
implements Runnable
Extends the simple Service
class to provide an asyncronous
messaging service for the transport protocol.
AsyncService(String serviceName) -
Constructs an asyncronous service.
|
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.
|
AsyncService
public AsyncService(String serviceName)
Constructs an asyncronous service.
serviceName
- the name of the service
getAsyncMessageFilter
protected abstract int[] getAsyncMessageFilter()
Implement this method by returning the message ids of the asyncrounous
messages your implementation wants to receive.
- an int array of message ids
onMessageReceived
protected abstract void onMessageReceived(SshMessage msg)
throws IOException
Called by the service thread when an asyncronous message is received.
msg
- the message received
onStart
protected void onStart()
throws IOException
Implements the abstract Service
method and starts the
service thread.
- onStart in interface Service
onStop
protected abstract void onStop()
The service thread calls this method when the thread is exiting.
run
public final void run()
Implements the asyncronous services message loop.
Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.