public abstract class Timeout extends Object
| Constructor and Description |
|---|
Timeout(long defaultWaitTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Method cancels the a started timeout.
|
abstract void |
expired()
This method is called in case a timeout is reached.
|
long |
getTimeToWait()
Returns the currently configured time to wait until the timeout is reached after start.
|
boolean |
isActive()
Return true if the timeout is still running or the expire routine is still executing.
|
boolean |
isExpired()
Return true if the given timeout is expired.
|
void |
restart()
Method restarts the timeout.
|
void |
restart(long waitTime)
Method restarts the timeout.
|
void |
setDefaultWaitTime(long waitTime)
Method setup the default time to wait until the timeout is reached.
|
void |
setWaitTime(long waitTime)
Deprecated.
please use setDefaultWaitTime instead.
|
void |
start()
Method starts the timeout.
|
void |
start(long waitTime)
Start the timeout with the given wait time.
|
String |
toString()
Prints a human readable representation of this timeout.
|
public long getTimeToWait()
public void restart(long waitTime)
throws CouldNotPerformException
waitTime - the new wait time to update.CouldNotPerformException - is thrown in case the timeout could not be restarted.public void restart()
throws CouldNotPerformException
CouldNotPerformException - is thrown in case the timeout could not be restarted.public boolean isExpired()
public boolean isActive()
public void start()
throws CouldNotPerformException
CouldNotPerformException - is thrown in case the timeout could not be started.public void start(long waitTime)
throws CouldNotPerformException
waitTime - The time to wait until the timeout is reached.CouldNotPerformException - is thrown in case the timeout could not be started.public void cancel()
@Deprecated public void setWaitTime(long waitTime)
waitTime - public void setDefaultWaitTime(long waitTime)
waitTime - the time to wait in milliseconds.public abstract void expired()
throws InterruptedException
InterruptedExceptionCopyright © 2015–2017 openbase.org. All rights reserved.