Package com.sshtools.j2ssh.util
Class State
java.lang.Object
com.sshtools.j2ssh.util.State
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ChannelState
,IOStreamConnectorState
,OpenClosedState
,ServiceState
,StartStopState
,TransportProtocolState
- Version:
- $Revision: 1.18 $
- Author:
- $author$
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
getValue()
abstract boolean
isValidState
(int state) void
setValue
(int state) boolean
waitForState
(int state) boolean
waitForState
(int state, long timeout) int
-
Field Details
-
state
protected int state
-
-
Constructor Details
-
State
public State(int initialState) Creates a new State object.- Parameters:
initialState
-
-
-
Method Details
-
isValidState
public abstract boolean isValidState(int state) - Parameters:
state
-- Returns:
-
setValue
- Parameters:
state
-- Throws:
InvalidStateException
-
getValue
public int getValue()- Returns:
-
breakWaiting
public void breakWaiting() -
waitForState
- Parameters:
state
-- Returns:
- Throws:
InvalidStateException
InterruptedException
-
waitForState
public boolean waitForState(int state, long timeout) throws InvalidStateException, InterruptedException - Parameters:
state
-timeout
-- Returns:
- Throws:
InvalidStateException
InterruptedException
-
waitForStateUpdate
- Returns:
- Throws:
InterruptedException
-