fulmine.rpc
Interface IRpcResult

All Known Implementing Classes:
RpcResult

public interface IRpcResult

Represents the result from invoking a specific RPC in a remote context. The result encapsulates either the RPC return value or any exception string raised when the RPC was handled in the remote context.

The isSuccessful() method should be examined before calling either getResult() or getExceptionMessage(). Both getResult() and getExceptionMessage() are mutually exclusive and when not applicable, these methods may return null . This is why is it important to call isSuccessful() to determine which of these methods to interrogate for the result status.

Results are transmitted back to the remote callers in result records. A result record is an IContainer. These are subsequently converted into IRpcResult objects.

Author:
Ramon Servadei
See Also:
RpcManager

Field Summary
static String EXCEPTION
          The name of the field in the result record for the getExceptionMessage() attribute
static String IS_SUCCESSFUL
          The name of the field in the result record for the isSuccessful() attribute
static String MARKER
          The name of the field in the result record for the RPC marker.
static String RESULT
          The name of the field in the result record for the getResult() attribute
 
Method Summary
 String getExceptionMessage()
          Get the exception message if the RPC was not executed successfully.
 IRpcMarker getMarker()
          Get the marker for the RPC invocation this result is for.
 IField getResult()
          Get the result from the RPC
 boolean isSuccessful()
          Determine whether the RPC was successfully executed.
 void updateResultRecord(IRpcMarker marker, IContainer resultRecord)
          Update the RPC's result record with the data from this result instance.
 

Field Detail

MARKER

static final String MARKER
The name of the field in the result record for the RPC marker.

See Also:
IRpcResultHandler, Constant Field Values

IS_SUCCESSFUL

static final String IS_SUCCESSFUL
The name of the field in the result record for the isSuccessful() attribute

See Also:
Constant Field Values

RESULT

static final String RESULT
The name of the field in the result record for the getResult() attribute

See Also:
Constant Field Values

EXCEPTION

static final String EXCEPTION
The name of the field in the result record for the getExceptionMessage() attribute

See Also:
Constant Field Values
Method Detail

isSuccessful

boolean isSuccessful()
Determine whether the RPC was successfully executed. If it was successful, calling getResult() will return the result from the RPC. If it was not successful, calling getExceptionMessage() will return a reason why the RPC was not successful.

Returns:
true if the RPC was successfully executed.

getResult

IField getResult()
Get the result from the RPC

Returns:
the result from the RPC or null if the RPC was not successful
See Also:
isSuccessful()

getExceptionMessage

String getExceptionMessage()
Get the exception message if the RPC was not executed successfully. This can either be due to local context issues or a problem when the RPC was executing in the remote context.

Returns:
the exception message if the RPC was not executed successfully, or null if the RPC was successful
See Also:
isSuccessful()

getMarker

IRpcMarker getMarker()
Get the marker for the RPC invocation this result is for. This allows remote callers to track the results for multiple calls to the same RPC.

Returns:
the marker for the RPC invocation this result is for
See Also:
IRpcManager.invoke(IRpcResultHandler, String, String, IField...)

updateResultRecord

void updateResultRecord(IRpcMarker marker,
                        IContainer resultRecord)
Update the RPC's result record with the data from this result instance.

Parameters:
marker - the marker for the RPC call this result is for
resultRecord - the result record for the RPC this result is for


Copyright © 2007-2009. All Rights Reserved.