public class RemoteInvocationResult extends Object implements Serializable
This is an SPI class, typically not used directly by applications. Can be subclassed for additional invocation parameters.
Both RemoteInvocation
and RemoteInvocationResult
are designed
for use with standard Java serialization as well as JavaBean-style serialization.
RemoteInvocation
,
Serialized FormConstructor and Description |
---|
RemoteInvocationResult()
Create a new RemoteInvocationResult for JavaBean-style deserialization
(e.g.
|
RemoteInvocationResult(Object value)
Create a new RemoteInvocationResult for the given result value.
|
RemoteInvocationResult(Throwable exception)
Create a new RemoteInvocationResult for the given exception.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public RemoteInvocationResult(@Nullable Object value)
value
- the result value returned by a successful invocation
of the target methodpublic RemoteInvocationResult(@Nullable Throwable exception)
exception
- the exception thrown by an unsuccessful invocation
of the target methodpublic RemoteInvocationResult()
public void setValue(@Nullable Object value)
This setter is intended for JavaBean-style deserialization.
Use RemoteInvocationResult(Object)
otherwise.
RemoteInvocationResult()
@Nullable public Object getValue()
hasException()
public void setException(@Nullable Throwable exception)
This setter is intended for JavaBean-style deserialization.
Use RemoteInvocationResult(Throwable)
otherwise.
RemoteInvocationResult()
@Nullable public Throwable getException()
hasException()
public boolean hasException()
false
, the result value applies
(even if it is null
).getValue()
,
getException()
public boolean hasInvocationTargetException()
hasException()
@Nullable public Object recreate() throws Throwable
Throwable
- the exception, if any