org.xins.common.service
Class CallResult

java.lang.Object
  extended byorg.xins.common.service.CallResult
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HTTPCallResult, XINSCallResult

public abstract class CallResult
extends Object
implements Serializable

Result of a call to a service. The actual result is returned, combined with links to the services that failed and a link to the service to which the call succeeded.

This is an abstract class. Service callers return a specific kind of result, which is derived from this class.

Since:
XINS 1.0.0
Version:
$Revision: 1.19 $ $Date: 2006/10/25 11:20:57 $
Author:
Ernst de Haan
See Also:
Serialized Form

Constructor Summary
protected CallResult(CallRequest request, TargetDescriptor succeededTarget, long duration, CallExceptionList exceptions)
          Constructs a new CallResult object.
 
Method Summary
 long getDuration()
          Returns the call duration, in milliseconds.
 CallExceptionList getExceptions()
          Returns the list of CallExceptions.
 CallRequest getRequest()
          Returns the call request.
 TargetDescriptor getSucceededTarget()
          Returns the target for which the call succeeded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallResult

protected CallResult(CallRequest request,
                     TargetDescriptor succeededTarget,
                     long duration,
                     CallExceptionList exceptions)
              throws IllegalArgumentException
Constructs a new CallResult object.

Parameters:
request - the call request that resulted in this result, cannot be null.
succeededTarget - the target for which the call succeeded, cannot be null.
duration - the call duration in milliseconds, cannot be a negative number.
exceptions - the list of CallExceptions, or null if the first call attempt succeeded.
Throws:
IllegalArgumentException - if request == null || succeededTarget == null || duration < 0L.
Method Detail

getRequest

public final CallRequest getRequest()
Returns the call request.

Returns:
the CallRequest, never null.

getSucceededTarget

public final TargetDescriptor getSucceededTarget()
Returns the target for which the call succeeded.

Returns:
the TargetDescriptor for which the call succeeded, not null.

getDuration

public final long getDuration()
Returns the call duration, in milliseconds.

Returns:
the duration of the succeeded call, in milliseconds, guaranteed to be a non-negative number.

getExceptions

public final CallExceptionList getExceptions()
Returns the list of CallExceptions.

Returns:
the CallExceptions, collected in a CallExceptionList object, or null if the first call attempt succeeded.


See http://www.xins.org/.