Class TimeoutCancelCheck
- java.lang.Object
-
- com.complexible.common.cancellation.TimeoutCancelCheck
-
- All Implemented Interfaces:
CancelCheck
public class TimeoutCancelCheck extends java.lang.Object implements CancelCheck
A cancellation check that cancels automatically if a timeout has been reached or delegates to another check timeout has not occurred.
-
-
Field Summary
-
Fields inherited from interface com.complexible.common.cancellation.CancelCheck
DO_NOT_CLOSE, DUMMY
-
-
Constructor Summary
Constructors Constructor Description TimeoutCancelCheck(CancelCheck theDelegate, Timer theTimer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check()
Check if cancellation point is valid; It throws an exception in case if the cancellation point has been canceled.java.lang.String
getCancellationMessage()
Returns null if the process has not been cancelled, otherwise the cancellation cause (if set).boolean
isCancelled()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.complexible.common.cancellation.CancelCheck
check, throwIfCancelled
-
-
-
-
Constructor Detail
-
TimeoutCancelCheck
public TimeoutCancelCheck(CancelCheck theDelegate, Timer theTimer)
-
-
Method Detail
-
check
public void check()
Description copied from interface:CancelCheck
Check if cancellation point is valid; It throws an exception in case if the cancellation point has been canceled.- Specified by:
check
in interfaceCancelCheck
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceCancelCheck
- Returns:
- true if point has been cancelled, false otherwise;
-
getCancellationMessage
public java.lang.String getCancellationMessage()
Description copied from interface:CancelCheck
Returns null if the process has not been cancelled, otherwise the cancellation cause (if set).- Specified by:
getCancellationMessage
in interfaceCancelCheck
-
-