GigaSpaces XAP 9.0 API

com.sun.jini.constants
Class ThrowableConstants

java.lang.Object
  extended by com.sun.jini.constants.ThrowableConstants

public class ThrowableConstants
extends Object

Various constants useful in processing exceptions

Author:
Sun Microsystems, Inc.

Field Summary
static int BAD_INVOCATION
          Value returned by retryable to indicate that the passed Throwable implies that retrying the operation that threw the Throwable with the same arguments and the same expected return value would not be fruitful.
static int BAD_OBJECT
          Value returned by retryable to indicate that the passed Throwable implies that any further operations on the object that threw the Throwable would not be fruitful.
static int INDEFINITE
          Value returned by retryable to indicate that the passed Throwable does not provide any new information on the state of the object that threw it.
static int UNCATEGORIZED
          Value returned by retryable to indicate that the passed Throwable was of a type that could not be classified.
 
Constructor Summary
ThrowableConstants()
           
 
Method Summary
static int retryable(Throwable t)
          Attempt to classify the passed Throwable in terms of what it implies about the probability of success of future operations on the object that threw the exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEFINITE

public static final int INDEFINITE
Value returned by retryable to indicate that the passed Throwable does not provide any new information on the state of the object that threw it.

See Also:
retryable(java.lang.Throwable), Constant Field Values

BAD_INVOCATION

public static final int BAD_INVOCATION
Value returned by retryable to indicate that the passed Throwable implies that retrying the operation that threw the Throwable with the same arguments and the same expected return value would not be fruitful.

See Also:
retryable(java.lang.Throwable), Constant Field Values

BAD_OBJECT

public static final int BAD_OBJECT
Value returned by retryable to indicate that the passed Throwable implies that any further operations on the object that threw the Throwable would not be fruitful.

See Also:
retryable(java.lang.Throwable), Constant Field Values

UNCATEGORIZED

public static final int UNCATEGORIZED
Value returned by retryable to indicate that the passed Throwable was of a type that could not be classified.

See Also:
retryable(java.lang.Throwable), Constant Field Values
Constructor Detail

ThrowableConstants

public ThrowableConstants()
Method Detail

retryable

public static int retryable(Throwable t)
Attempt to classify the passed Throwable in terms of what it implies about the probability of success of future operations on the object that threw the exception.

Note, the classification used by this method tends to assume the worst. For exceptions that represent conditions that could get better by themselves but probably will not, it will return BAD_OBJECT or BAD_INVOCATION instead of INDEFINITE. This makes it suitable for situations where it is better to give up, fail early, and notify the next layer up that something is wrong than to continue silently and retry. It is probably not a good choice for situations where the stakes are higher, like deciding when to give up on a prepared transaction.

Returns:
INDEFINITE, BAD_INVOCATION, or BAD_OBJECT if the exception is a RuntimeException, Error, or java.rmi.RemoteException depending on the details of the Throwable. Otherwise return UNCATEGORIZED
Throws:
NullPointerException - if the passed Throwable is null

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.