public abstract class CallException extends Exception
ServiceCaller
call failed. This exception is typically only thrown by class
ServiceCaller
and subclasses.
Call exceptions can be linked. The first exception is then actually
thrown to the caller. The caller can get the linked exceptions using
getNext()
.
Modifier | Constructor and Description |
---|---|
protected |
CallException(String shortReason,
CallRequest request,
TargetDescriptor target,
long duration,
String detail,
Throwable cause)
Constructs a new
CallException based on a short reason, the
original request, target called, call duration, detail message and cause
exception. |
Modifier and Type | Method and Description |
---|---|
String |
getDetail()
Returns a detailed description of problem, if any.
|
long |
getDuration()
Returns the call duration.
|
String |
getMessage()
Returns the detail message string of this exception.
|
CallException |
getNext()
Gets the next linked
CallException , if there is any. |
CallRequest |
getRequest()
Returns the original request.
|
TargetDescriptor |
getTarget()
Returns the descriptor for the target that was attempted to be called.
|
boolean |
isFailOverAllowed()
Indicates whether this call exception allow for the ServiceCaller to
fail over another TargetDescriptor if available.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected CallException(String shortReason, CallRequest request, TargetDescriptor target, long duration, String detail, Throwable cause) throws IllegalArgumentException
CallException
based on a short reason, the
original request, target called, call duration, detail message and cause
exception.shortReason
- the short reason, cannot be null
.request
- the original request, cannot be null
.target
- descriptor for the target that was attempted to be called, can be null
.duration
- the call duration in milliseconds, must be >= 0.detail
- a detailed description of the problem, can be null
if
there is no more detail.cause
- the cause exception, can be null
.IllegalArgumentException
- if shortReason == null
|| request == null
|| duration < 0
.public String getMessage()
getMessage
in class Throwable
null
.public final CallRequest getRequest()
null
.public final TargetDescriptor getTarget()
null
.public final long getDuration()
public final CallException getNext()
CallException
, if there is any.CallException
, or null
if
there is none.public String getDetail()
null
.public boolean isFailOverAllowed()
false
should be returned.true
if the service can fail over, false
otherwise.See http://www.xins.org/.