org.fuin.utils4j
Class CancelableVolatile
java.lang.Object
org.fuin.utils4j.CancelableVolatile
- All Implemented Interfaces:
- Cancelable
public class CancelableVolatile
- extends Object
- implements Cancelable
A simple Cancelable implementation that can be used to
synchronize a cancel request between threads without locking.
|
Method Summary |
void |
cancel()
Try to cancel the unit of work. |
boolean |
isCanceled()
Returns if the unit of work was canceled. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CancelableVolatile
public CancelableVolatile()
cancel
public final void cancel()
- Try to cancel the unit of work.
- Specified by:
cancel in interface Cancelable
isCanceled
public final boolean isCanceled()
- Returns if the unit of work was canceled.
- Specified by:
isCanceled in interface Cancelable
- Returns:
- If it was canceled
true else false.
Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.