Convert the given RemoteException that happened during remote access
to Spring's RemoteAccessException if the method signature does not
support RemoteException.
Convert the given RemoteException that happened during remote access
to Spring's RemoteAccessException if the method signature does not
support RemoteException.
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).
@Nullable
public static java.lang.Object invokeRemoteMethod(MethodInvocation invocation,
java.lang.Object stub)
throws java.lang.reflect.InvocationTargetException
Perform a raw method invocation on the given RMI stub,
letting reflection exceptions through as-is.
Parameters:
invocation - the AOP MethodInvocation
stub - the RMI stub
Returns:
the invocation result, if any
Throws:
java.lang.reflect.InvocationTargetException - if thrown by reflection
convertRmiAccessException
public static java.lang.Exception convertRmiAccessException(java.lang.reflect.Method method,
java.lang.Throwable ex,
java.lang.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!
Parameters:
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
Returns:
the exception to be thrown to the caller
convertRmiAccessException
public static java.lang.Exception convertRmiAccessException(java.lang.reflect.Method method,
java.rmi.RemoteException ex,
java.lang.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.
Parameters:
method - the invoked method
ex - the RemoteException that happened
serviceName - the name of the service (for debugging purposes)
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.
Parameters:
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)
Returns:
the exception to be thrown to the caller
isConnectFailure
public static boolean isConnectFailure(java.rmi.RemoteException ex)
Determine whether the given RMI exception indicates a connect failure.
Treats RMI's ConnectException, ConnectIOException, UnknownHostException,
NoSuchObjectException and StubNotFoundException as connect failure.
Parameters:
ex - the RMI exception to check
Returns:
whether the exception should be treated as connect failure