public class

RemoteInvocationResult

extends Object
implements Serializable
java.lang.Object
   ↳ org.springframework.remoting.support.RemoteInvocationResult

Class Overview

Encapsulates a remote invocation result, holding a result value or an exception. Used for HTTP-based serialization invokers.

This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.

See Also

Summary

Public Constructors
RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.
RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.
Public Methods
Throwable getException()
Return the exception thrown by an unsuccessful invocation of the target method, if any.
Object getValue()
Return the result value returned by a successful invocation of the target method, if any.
boolean hasException()
Return whether this invocation result holds an exception.
boolean hasInvocationTargetException()
Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.
Object recreate()
Recreate the invocation result, either returning the result value in case of a successful invocation of the target method, or rethrowing the exception thrown by the target method.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RemoteInvocationResult (Object value)

Create a new RemoteInvocationResult for the given result value.

Parameters
value the result value returned by a successful invocation of the target method

public RemoteInvocationResult (Throwable exception)

Create a new RemoteInvocationResult for the given exception.

Parameters
exception the exception thrown by an unsuccessful invocation of the target method

Public Methods

public Throwable getException ()

Return the exception thrown by an unsuccessful invocation of the target method, if any.

See Also

public Object getValue ()

Return the result value returned by a successful invocation of the target method, if any.

See Also

public boolean hasException ()

Return whether this invocation result holds an exception. If this returns false, the result value applies (even if null).

public boolean hasInvocationTargetException ()

Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.

See Also

public Object recreate ()

Recreate the invocation result, either returning the result value in case of a successful invocation of the target method, or rethrowing the exception thrown by the target method.

Returns
  • the result value, if any
Throws
Throwable the exception, if any