Save This Page
Home » j2ssh-0.2.9-src » com.sshtools.j2ssh » [javadoc | source]
com.sshtools.j2ssh
public class: SshThread [javadoc | source]
java.lang.Object
   java.lang.Thread
      com.sshtools.j2ssh.SshThread

All Implemented Interfaces:
    Runnable

Enables the J2SSH application framework to execute threads in the context of a given session.

Field Summary
protected  byte[] sessionId    The raw session id generating during the first key exchange. 
protected  String sessionIdString    A string representation of the session id. 
protected  String username    The thread owner 
Fields inherited from java.lang.Thread:
MIN_PRIORITY,  NORM_PRIORITY,  MAX_PRIORITY
Constructor:
 public SshThread(String name,
    boolean daemon) 
 public SshThread(Runnable target,
    String name,
    boolean daemon) 

    Constructs an SshThread.

    Parameters:
    target - The target to execute
    name - The name of the thread
    daemon - run as a daemon thread?
    since: 0.2.0 -
Method from com.sshtools.j2ssh.SshThread Summary:
cloneThread,   containsProperty,   getCurrentSessionId,   getCurrentThread,   getCurrentThreadUser,   getProperty,   getSessionIdString,   getUsername,   hasUserContext,   setProperty,   setSessionId,   setUsername
Methods from java.lang.Thread:
activeCount,   checkAccess,   countStackFrames,   currentThread,   destroy,   dumpStack,   enumerate,   getAllStackTraces,   getContextClassLoader,   getDefaultUncaughtExceptionHandler,   getId,   getName,   getPriority,   getStackTrace,   getState,   getThreadGroup,   getUncaughtExceptionHandler,   holdsLock,   interrupt,   interrupted,   isAlive,   isDaemon,   isInterrupted,   join,   join,   join,   resume,   run,   setContextClassLoader,   setDaemon,   setDefaultUncaughtExceptionHandler,   setName,   setPriority,   setUncaughtExceptionHandler,   sleep,   sleep,   start,   stop,   stop,   suspend,   toString,   yield
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sshtools.j2ssh.SshThread Detail:
 public SshThread cloneThread(Runnable target,
    String name) 

    Create's a cloned copy of this thread with the given target and name.

 public boolean containsProperty(String name) 

    Determine if this thread contains the given property.

 public static String getCurrentSessionId() throws SshRuntimeException 

    Returns the session id of the current thread context.

    This should be called when the caller is certain that the current thread is running in an SshThread context. If not a Runtime exception is thrown.

 public static SshThread getCurrentThread() throws SshRuntimeException 

    Returns the current SshThread.

    This should be called when the caller is certain that the current thread is running in an SshThread context. If not a Runtime exception is thrown.

 public static String getCurrentThreadUser() throws SshRuntimeException 

    Call to determine the username of the current thread context.

    This should be called when the caller is certain that the current thread is running in an SshThread context. If not a runtime exception is thrown.

 public Object getProperty(String name) 

    Gets a property from this thread.

 public String getSessionIdString() 

    Returns the session id string for this thread.

 public String getUsername() 

    Gets the username for this thread.

 public static boolean hasUserContext() 
 public  void setProperty(String name,
    Object value) 

    Sets a property in the thread.

 public  void setSessionId(byte[] sessionId) 

    Sets the session id for this thread.

 public  void setUsername(String username) 

    Set the username for this thread.