GemFire 6.5.1

com.gemstone.gemfire
Class CancelCriterion

java.lang.Object
  extended by com.gemstone.gemfire.CancelCriterion

public abstract class CancelCriterion
extends Object

Abstract cancellation proxy for cancelling an operation, esp. a thread.

Since:
5.1
See Also:
CancelException

Constructor Summary
CancelCriterion()
           
 
Method Summary
abstract  String cancelInProgress()
          Indicate if the service is in the progress of being cancelled.
 void checkCancelInProgress(Throwable e)
          See if the current operation is being cancelled.
abstract  RuntimeException generateCancelledException(Throwable e)
          Template factory method for generating the exception to be thrown by checkCancelInProgress(Throwable).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CancelCriterion

public CancelCriterion()
Method Detail

cancelInProgress

public abstract String cancelInProgress()
Indicate if the service is in the progress of being cancelled. The typical use of this is to indicate, in the case of an InterruptedException, that the current operation should be cancelled.

Returns:
null if the service is not shutting down

checkCancelInProgress

public final void checkCancelInProgress(Throwable e)
See if the current operation is being cancelled. If so, it either throws a RuntimeException (usually a CancelException).

Parameters:
e - an underlying exception, if any
See Also:
cancelInProgress()

generateCancelledException

public abstract RuntimeException generateCancelledException(Throwable e)
Template factory method for generating the exception to be thrown by checkCancelInProgress(Throwable). Override this to specify different exception for checkCancelInProgress() to throw.

Parameters:
e - an underlying exception, if any
Returns:
RuntimeException to be thrown by checkCancelInProgress(), null if the receiver has not been cancelled.

GemFire 6.5.1

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.