com.sshtools.j2ssh.util

Class State

Implemented Interfaces:
Serializable
Known Direct Subclasses:
ChannelState, IOStreamConnectorState, OpenClosedState, ServiceState, StartStopState, TransportProtocolState

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

Version:
$Revision: 1.18 $
Author:
$author$

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

Field Details

state

protected int state

Constructor Details

State

public State(int initialState)
Creates a new State object.
Parameters:
initialState -

Method Details

breakWaiting

public void breakWaiting()

getValue

public int getValue()
Returns:

isValidState

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

setValue

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

waitForState

public boolean waitForState(int state)
            throws InvalidStateException,
                   InterruptedException
Parameters:
state -
Returns:

waitForState

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

waitForStateUpdate

public int waitForStateUpdate()
            throws InterruptedException
Returns:

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