org.springframework.remoting.rmi

## 类 RmiClientInterceptorUtils

- java.lang.Object
- - org.springframework.remoting.rmi.RmiClientInterceptorUtils

-     public abstract class RmiClientInterceptorUtils
      extends Object

  Factored-out methods for performing invocations within an RMI client. Can handle both RMI and non-RMI service interfaces working on an RMI stub.

  Note: This is an SPI class, not intended to be used by applications.

  从以下版本开始:
    1.1
  作者:
    Juergen Hoeller

- - ### 构造器概要

    构造器
    构造器和说明
    `RmiClientInterceptorUtils()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static Exception` | `convertRmiAccessException(Method method, RemoteException ex, boolean isConnectFailure, String serviceName)` Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
    `static Exception` | `convertRmiAccessException(Method method, RemoteException ex, String serviceName)` Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException.
    `static Exception` | `convertRmiAccessException(Method method, Throwable ex, String message)` Wrap the given arbitrary exception that happened during remote access in either a RemoteException or a Spring RemoteAccessException (if the method signature does not support RemoteException).
    `static Object` | `invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation invocation, Object stub)` Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.
    `static boolean` | `isConnectFailure(RemoteException ex)` Determine whether the given RMI exception indicates a connect failure.

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

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

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

    - #### RmiClientInterceptorUtils

          public RmiClientInterceptorUtils()

  - ### 方法详细资料

    - #### invokeRemoteMethod

          @Nullable
          public static Object invokeRemoteMethod(org.aopalliance.intercept.MethodInvocation invocation,
                                                             Object stub)
                                                      throws InvocationTargetException

      Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.
      参数:
        `invocation` - the AOP MethodInvocation
        `stub` - the RMI stub
      返回:
        the invocation result, if any
      抛出:
        `InvocationTargetException` - if thrown by reflection

    - #### convertRmiAccessException

          public static Exception convertRmiAccessException(Method method,
                                                            Throwable ex,
                                                            String message)

      Wrap the given arbitrary exception that happened during remote access in either a RemoteException or a Spring RemoteAccessException (if the method signature does not support RemoteException).

      Only call this for remote access exceptions, not for exceptions thrown by the target service itself!

      参数:
        `method` - the invoked method
        `ex` - the exception that happened, to be used as cause for the RemoteAccessException or RemoteException
        `message` - the message for the RemoteAccessException respectively RemoteException
      返回:
        the exception to be thrown to the caller

    - #### convertRmiAccessException

          public static Exception convertRmiAccessException(Method method,
                                                            RemoteException ex,
                                                            String serviceName)

      Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException. Else, return the original RemoteException.
      参数:
        `method` - the invoked method
        `ex` - the RemoteException that happened
        `serviceName` - the name of the service (for debugging purposes)
      返回:
        the exception to be thrown to the caller

    - #### convertRmiAccessException

          public static Exception convertRmiAccessException(Method method,
                                                            RemoteException ex,
                                                            boolean isConnectFailure,
                                                            String serviceName)

      Convert the given RemoteException that happened during remote access to Spring's RemoteAccessException if the method signature does not support RemoteException. Else, return the original RemoteException.
      参数:
        `method` - the invoked method
        `ex` - the RemoteException that happened
        `isConnectFailure` - whether the given exception should be considered a connect failure
        `serviceName` - the name of the service (for debugging purposes)
      返回:
        the exception to be thrown to the caller

    - #### isConnectFailure

          public static boolean isConnectFailure(RemoteException ex)

      Determine whether the given RMI exception indicates a connect failure.

      Treats RMI's ConnectException, ConnectIOException, UnknownHostException, NoSuchObjectException and StubNotFoundException as connect failure.

      参数:
        `ex` - the RMI exception to check
      返回:
        whether the exception should be treated as connect failure
      另请参阅:
        `ConnectException`, `ConnectIOException`, `UnknownHostException`, `NoSuchObjectException`, `StubNotFoundException`