public class ReconnectingStateListener
extends java.lang.Object
implements org.opendof.core.oal.DOFConnection.StateListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAXIMUM_DELAY |
static int |
DEFAULT_MINIMUM_DELAY |
static int |
MINIMUM_DELAY |
| Constructor and Description |
|---|
ReconnectingStateListener()
Default constructor starts the listener thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Shut down the listener.
|
int |
getMaximumDelay() |
int |
getMinimumDelay() |
void |
removed(org.opendof.core.oal.DOFConnection connection,
org.opendof.core.oal.DOFException exception) |
void |
setMaximumDelay(int maximumDelay)
Sets the maximum delay time between attempts to reconnect a disconnected connection.
|
void |
setMinimumDelay(int minimumDelay)
Sets the minimum delay to wait before attempting to reconnect a disconnected connection.
|
void |
stateChanged(org.opendof.core.oal.DOFConnection connection,
org.opendof.core.oal.DOFConnection.State state) |
public static final int DEFAULT_MINIMUM_DELAY
public static final int DEFAULT_MAXIMUM_DELAY
public static final int MINIMUM_DELAY
public ReconnectingStateListener()
public void setMinimumDelay(int minimumDelay)
minimumDelay - The minimum amount of time to wait between attempts to reconnect. Must not be negative.public int getMinimumDelay()
public void setMaximumDelay(int maximumDelay)
maximumDelay - The maximum amount of time to wait between attempts to reconnect. Must not be negative.setMinimumDelay(int)public int getMaximumDelay()
public void stateChanged(org.opendof.core.oal.DOFConnection connection,
org.opendof.core.oal.DOFConnection.State state)
stateChanged in interface org.opendof.core.oal.DOFConnection.StateListenerpublic void removed(org.opendof.core.oal.DOFConnection connection,
org.opendof.core.oal.DOFException exception)
removed in interface org.opendof.core.oal.DOFConnection.StateListenerpublic void cancel()