fulmine.rpc
Class RpcResult

java.lang.Object
  extended by fulmine.rpc.RpcResult
All Implemented Interfaces:
IRpcResult

public final class RpcResult
extends Object
implements IRpcResult

Standard implementation.

Author:
Ramon Servadei

Field Summary
 
Fields inherited from interface fulmine.rpc.IRpcResult
EXCEPTION, IS_SUCCESSFUL, MARKER, RESULT
 
Constructor Summary
RpcResult(boolean successful, IField result, String exceptionMessage)
          Construct the RPC result.
RpcResult(IRpcDefinition definition, IContainer resultRecord)
          Construct the RPC result from a result record.
 
Method Summary
 boolean equals(Object obj)
           
 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
 int hashCode()
           
 boolean isSuccessful()
          Determine whether the RPC was successfully executed.
 String toString()
           
 void updateResultRecord(IRpcMarker marker, IContainer resultRecord)
          Update the RPC's result record with the data from this result instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RpcResult

public RpcResult(IRpcDefinition definition,
                 IContainer resultRecord)
Construct the RPC result from a result record. This constructor is called in the remote context that called the RPC.

Parameters:
definition - the definition for the RPC
resultRecord - the result record

RpcResult

public RpcResult(boolean successful,
                 IField result,
                 String exceptionMessage)
Construct the RPC result.

Parameters:
successful - whether the RPC executed successfully
result - the result
exceptionMessage - the exception, if any
Method Detail

getExceptionMessage

public String getExceptionMessage()
Description copied from interface: IRpcResult
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.

Specified by:
getExceptionMessage in interface IRpcResult
Returns:
the exception message if the RPC was not executed successfully, or null if the RPC was successful
See Also:
IRpcResult.isSuccessful()

getResult

public IField getResult()
Description copied from interface: IRpcResult
Get the result from the RPC

Specified by:
getResult in interface IRpcResult
Returns:
the result from the RPC or null if the RPC was not successful
See Also:
IRpcResult.isSuccessful()

isSuccessful

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

Specified by:
isSuccessful in interface IRpcResult
Returns:
true if the RPC was successfully executed.

getMarker

public IRpcMarker getMarker()
Description copied from interface: IRpcResult
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.

Specified by:
getMarker in interface IRpcResult
Returns:
the marker for the RPC invocation this result is for
See Also:
IRpcManager.invoke(IRpcResultHandler, String, String, IField...)

updateResultRecord

public void updateResultRecord(IRpcMarker marker,
                               IContainer resultRecord)
Description copied from interface: IRpcResult
Update the RPC's result record with the data from this result instance.

Specified by:
updateResultRecord in interface IRpcResult
Parameters:
marker - the marker for the RPC call this result is for
resultRecord - the result record for the RPC this result is for

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2007-2009. All Rights Reserved.