Package com.sun.jini.constants
Class ThrowableConstants
java.lang.Object
com.sun.jini.constants.ThrowableConstants
Various constants useful in processing exceptions
- Author:
- Sun Microsystems, Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intValue returned byretryableto indicate that the passedThrowableimplies that retrying the operation that threw theThrowablewith the same arguments and the same expected return value would not be fruitful.static final intValue returned byretryableto indicate that the passedThrowableimplies that any further operations on the object that threw theThrowablewould not be fruitful.static final intValue returned byretryableto indicate that the passedThrowabledoes not provide any new information on the state of the object that threw it.static final intValue returned byretryableto indicate that the passedThrowablewas of a type that could not be classified. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INDEFINITE
public static final int INDEFINITEValue returned byretryableto indicate that the passedThrowabledoes not provide any new information on the state of the object that threw it. -
BAD_INVOCATION
public static final int BAD_INVOCATIONValue returned byretryableto indicate that the passedThrowableimplies that retrying the operation that threw theThrowablewith the same arguments and the same expected return value would not be fruitful. -
BAD_OBJECT
public static final int BAD_OBJECTValue returned byretryableto indicate that the passedThrowableimplies that any further operations on the object that threw theThrowablewould not be fruitful. -
UNCATEGORIZED
public static final int UNCATEGORIZEDValue returned byretryableto indicate that the passedThrowablewas of a type that could not be classified.
-
-
Constructor Details
-
ThrowableConstants
public ThrowableConstants()
-
-
Method Details
-
retryable
Attempt to classify the passedThrowablein 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_OBJECTorBAD_INVOCATIONinstead ofINDEFINITE. 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, orBAD_OBJECTif the exception is aRuntimeException,Error, orjava.rmi.RemoteExceptiondepending on the details of theThrowable. Otherwise returnUNCATEGORIZED- Throws:
NullPointerException- if the passedThrowableisnull
-