Package org.oddjob.framework.util
Class StopWait
java.lang.Object
org.oddjob.framework.util.StopWait
A utility class to provide wait until stopped functionality.
The default timeout is 5 seconds before a FailedToStopException
is thrown.
- Author:
- rob
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
StopWait
Constructor with default timeout.- Parameters:
stateful- The thing to wait until stopped.
-
StopWait
Constructor where timeout can be specified.- Parameters:
stateful- The thing to wait until stopped.timeout- The timeout. Note that a timeout of 0 or less is no timeout.
-
-
Method Details
-
run
Run the stop wait. This will block until the job stops or the timeout occurs.- Throws:
FailedToStopException- If timeout occurs.
-