org.fuin.utils4j
Class CancelableVolatile

java.lang.Object
  extended by org.fuin.utils4j.CancelableVolatile
All Implemented Interfaces:
Cancelable

public class CancelableVolatile
extends java.lang.Object
implements Cancelable

A simple Cancelable implementation that can be used to synchronize a cancel request between threads without locking.


Constructor Summary
CancelableVolatile()
           
 
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
 

Constructor Detail

CancelableVolatile

public CancelableVolatile()
Method Detail

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 © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.