|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sshtools.j2ssh.transport.Service
com.sshtools.j2ssh.transport.AsyncService
public abstract class AsyncService
Extends the simple Service
class to provide an asyncronous
messaging service for the transport protocol.
Field Summary | |
---|---|
protected SshThread |
thread
|
Fields inherited from class com.sshtools.j2ssh.transport.Service |
---|
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport |
Constructor Summary | |
---|---|
AsyncService(java.lang.String serviceName)
Constructs an asyncronous service. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.sshtools.j2ssh.transport.Service |
---|
getServiceName, getState, init, onServiceAccept, onServiceInit, onServiceRequest, sendServiceAccept, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SshThread thread
Constructor Detail |
---|
public AsyncService(java.lang.String serviceName)
Constructs an asyncronous service.
serviceName
- the name of the serviceMethod Detail |
---|
protected void onStart() throws java.io.IOException
Implements the abstract Service
method and starts the
service thread.
onStart
in class Service
java.io.IOException
- if an IO error occurspublic 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 received
java.io.IOException
- if an IO error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |