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 int
state
-
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 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()
-
-
-
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
-
-