类 RemoteInvocationResult
- java.lang.Object
- org.springframework.remoting.support.RemoteInvocationResult
- 所有已实现的接口:
Serializable
public class RemoteInvocationResult extends Object implements Serializable
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.
Both
RemoteInvocation
andRemoteInvocationResult
are designed for use with standard Java serialization as well as JavaBean-style serialization.- 从以下版本开始:
- 1.1
- 作者:
- Juergen Hoeller
- 另请参阅:
RemoteInvocation
, 序列化表格
构造器概要
构造器 构造器 说明 RemoteInvocationResult()
Create a new RemoteInvocationResult for JavaBean-style deserialization (e.g. with Jackson).RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.void
setException(Throwable exception)
Set the exception thrown by an unsuccessful invocation of the target method, if any.void
setValue(Object value)
Set the result value returned by a successful invocation of the target method, if any.
构造器详细资料
RemoteInvocationResult
public RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.- 参数:
value
- the result value returned by a successful invocation of the target method
RemoteInvocationResult
public RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.- 参数:
exception
- the exception thrown by an unsuccessful invocation of the target method
RemoteInvocationResult
public RemoteInvocationResult()
Create a new RemoteInvocationResult for JavaBean-style deserialization (e.g. with Jackson).
方法详细资料
setValue
public void setValue(Object value)
Set the result value returned by a successful invocation of the target method, if any.This setter is intended for JavaBean-style deserialization. Use
RemoteInvocationResult(Object)
otherwise.
getValue
public Object getValue()
Return the result value returned by a successful invocation of the target method, if any.- 另请参阅:
hasException()
setException
public void setException(Throwable exception)
Set the exception thrown by an unsuccessful invocation of the target method, if any.This setter is intended for JavaBean-style deserialization. Use
RemoteInvocationResult(Throwable)
otherwise.
getException
public Throwable getException()
Return the exception thrown by an unsuccessful invocation of the target method, if any.- 另请参阅:
hasException()
hasException
public boolean hasException()
Return whether this invocation result holds an exception. If this returnsfalse
, the result value applies (even if it isnull
).- 另请参阅:
getValue()
,getException()
hasInvocationTargetException
public boolean hasInvocationTargetException()
Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.- 另请参阅:
hasException()