Package com.sshtools.j2ssh.util
Class State
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected intstate
-
Constructor Summary
Constructors Constructor Description State(int initialState)Creates a new State object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbreakWaiting()intgetValue()abstract booleanisValidState(int state)voidsetValue(int state)booleanwaitForState(int state)booleanwaitForState(int state, long timeout)intwaitForStateUpdate()
-
-
-
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:
InvalidStateExceptionjava.lang.InterruptedException
-
waitForState
public boolean waitForState(int state, long timeout) throws InvalidStateException, java.lang.InterruptedException- Parameters:
state-timeout-- Returns:
- Throws:
InvalidStateExceptionjava.lang.InterruptedException
-
waitForStateUpdate
public int waitForStateUpdate() throws java.lang.InterruptedException- Returns:
- Throws:
java.lang.InterruptedException
-
-