org.springframework.remoting.support

## 类 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` and `RemoteInvocationResult` 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.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### RemoteInvocationResult

          public RemoteInvocationResult(@Nullable
                                        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(@Nullable
                                        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(java.lang.Object)`, `setException(java.lang.Throwable)`

  - ### 方法详细资料

    - #### setValue

          public void setValue(@Nullable
                               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.

      另请参阅:
        `RemoteInvocationResult()`

    - #### getValue

          @Nullable
          public Object getValue()

      Return the result value returned by a successful invocation of the target method, if any.
      另请参阅:
        `hasException()`

    - #### setException

          public void setException(@Nullable
                                   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.

      另请参阅:
        `RemoteInvocationResult()`

    - #### getException

          @Nullable
          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 returns `false`, the result value applies (even if it is `null`).
      另请参阅:
        `getValue()`, `getException()`

    - #### hasInvocationTargetException

          public boolean hasInvocationTargetException()

      Return whether this invocation result holds an InvocationTargetException, thrown by an invocation of the target method itself.
      另请参阅:
        `hasException()`

    - #### recreate

          @Nullable
          public Object recreate()
                                     throws Throwable

      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.
      返回:
        the result value, if any
      抛出:
        `Throwable` - the exception, if any