com.sshtools.j2ssh.util
Class State

java.lang.Object
  extended by com.sshtools.j2ssh.util.State
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChannelState, IOStreamConnectorState, OpenClosedState, ServiceState, StartStopState, TransportProtocolState

public abstract class State
extends java.lang.Object
implements java.io.Serializable

Version:
$Revision: 1.18 $
Author:
$author$
See Also:
Serialized Form

Field Summary
protected  int state
           
 
Constructor Summary
State(int initialState)
          Creates a new State object.
 
Method Summary
 void breakWaiting()
           
 int getValue()
           
abstract  boolean isValidState(int state)
           
 void setValue(int state)
           
 boolean waitForState(int state)
           
 boolean waitForState(int state, long timeout)
           
 int waitForStateUpdate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected int state
Constructor Detail

State

public State(int initialState)
Creates a new State object.

Parameters:
initialState -
Method Detail

isValidState

public abstract boolean isValidState(int state)
Parameters:
state -
Returns:

setValue

public void setValue(int state)
              throws InvalidStateException
Parameters:
state -
Throws:
InvalidStateException

getValue

public int getValue()
Returns:

breakWaiting

public void breakWaiting()

waitForState

public boolean waitForState(int state)
                     throws InvalidStateException,
                            java.lang.InterruptedException
Parameters:
state -
Returns:
Throws:
InvalidStateException
java.lang.InterruptedException

waitForState

public boolean waitForState(int state,
                            long timeout)
                     throws InvalidStateException,
                            java.lang.InterruptedException
Parameters:
state -
timeout -
Returns:
Throws:
InvalidStateException
java.lang.InterruptedException

waitForStateUpdate

public int waitForStateUpdate()
                       throws java.lang.InterruptedException
Returns:
Throws:
java.lang.InterruptedException


Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.