spring-framework / org.springframework.remoting.rmi / RmiClientInterceptorUtils

RmiClientInterceptorUtils

abstract class RmiClientInterceptorUtils

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.

Author
Juergen Hoeller

Since
1.1

Constructors

<init>

RmiClientInterceptorUtils()

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.

Functions

convertRmiAccessException

open static fun convertRmiAccessException(method: Method, ex: Throwable, message: String): Exception

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!

open static fun convertRmiAccessException(method: Method, ex: RemoteException, serviceName: String): Exception
open static fun convertRmiAccessException(method: Method, ex: RemoteException, isConnectFailure: Boolean, serviceName: String): Exception

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.

invokeRemoteMethod

open static fun invokeRemoteMethod(invocation: MethodInvocation, stub: Any): Any

Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is.

isConnectFailure

open static fun isConnectFailure(ex: RemoteException): Boolean

Determine whether the given RMI exception indicates a connect failure.

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