com.sshtools.j2ssh.subsystem
Class SubsystemClient

java.lang.Object
  extended by com.sshtools.j2ssh.subsystem.SubsystemClient
All Implemented Interfaces:
java.lang.Runnable

public abstract class SubsystemClient
extends java.lang.Object
implements java.lang.Runnable

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
private  java.io.InputStream in
           
private static org.apache.commons.logging.Log log
           
protected  SubsystemMessageStore messageStore
           
private  java.lang.String name
           
private  java.io.OutputStream out
           
protected  SessionChannelClient session
           
private  StartStopState state
           
private  java.lang.Thread thread
           
 
Constructor Summary
SubsystemClient(java.lang.String name)
          Creates a new SubsystemClient object.
SubsystemClient(java.lang.String name, SubsystemMessageStore messageStore)
          Creates a new SubsystemClient object.
 
Method Summary
 java.lang.String getName()
           
 SessionChannelClient getSessionChannel()
           
 boolean isClosed()
           
protected abstract  boolean onStart()
           
 void run()
           
protected  void sendMessage(SubsystemMessage msg)
           
 void setSessionChannel(SessionChannelClient session)
           
 boolean start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

in

private java.io.InputStream in

out

private java.io.OutputStream out

thread

private java.lang.Thread thread

name

private java.lang.String name

state

private StartStopState state

messageStore

protected SubsystemMessageStore messageStore

session

protected SessionChannelClient session
Constructor Detail

SubsystemClient

public SubsystemClient(java.lang.String name)
Creates a new SubsystemClient object.

Parameters:
name -

SubsystemClient

public SubsystemClient(java.lang.String name,
                       SubsystemMessageStore messageStore)
Creates a new SubsystemClient object.

Parameters:
name -
messageStore -
Method Detail

isClosed

public boolean isClosed()
Returns:

setSessionChannel

public void setSessionChannel(SessionChannelClient session)
Parameters:
session -

getSessionChannel

public SessionChannelClient getSessionChannel()
Returns:

start

public boolean start()
              throws java.io.IOException
Returns:
Throws:
java.io.IOException

onStart

protected abstract boolean onStart()
                            throws java.io.IOException
Returns:
Throws:
java.io.IOException

getName

public java.lang.String getName()
Returns:

sendMessage

protected void sendMessage(SubsystemMessage msg)
                    throws InvalidMessageException,
                           java.io.IOException
Parameters:
msg -
Throws:
InvalidMessageException
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

public void stop()
          throws java.io.IOException
Throws:
java.io.IOException