|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.remoting.rmi.RmiClientInterceptorUtils
public 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.
Field Summary | |
---|---|
private static Log |
logger
|
private static java.lang.String |
ORACLE_CONNECTION_EXCEPTION
|
Constructor Summary | |
---|---|
RmiClientInterceptorUtils()
|
Method Summary | |
---|---|
static java.lang.Exception |
convertRmiAccessException(java.lang.reflect.Method method,
java.rmi.RemoteException ex,
boolean isConnectFailure,
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. |
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. |
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). |
static java.lang.Object |
doInvoke(MethodInvocation invocation,
java.rmi.Remote stub)
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(MethodInvocation, java.lang.Object) |
static java.lang.Object |
invoke(MethodInvocation invocation,
java.rmi.Remote stub,
java.lang.String serviceName)
Deprecated. as of Spring 2.5, in favor of invokeRemoteMethod(MethodInvocation, java.lang.Object) |
static java.lang.Object |
invokeRemoteMethod(MethodInvocation invocation,
java.lang.Object stub)
Perform a raw method invocation on the given RMI stub, letting reflection exceptions through as-is. |
static boolean |
isConnectFailure(java.rmi.RemoteException ex)
Determine whether the given RMI exception indicates a connect failure. |
private static boolean |
isCorbaConnectFailure(java.lang.Throwable ex)
Check whether the given RMI exception root cause indicates a CORBA connection failure. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ORACLE_CONNECTION_EXCEPTION
private static final Log logger
Constructor Detail |
---|
public RmiClientInterceptorUtils()
Method Detail |
---|
@Deprecated public static java.lang.Object invoke(MethodInvocation invocation, java.rmi.Remote stub, java.lang.String serviceName) throws java.lang.Throwable
invokeRemoteMethod(MethodInvocation, java.lang.Object)
Delegates to the corresponding method if the RMI stub does not directly
implement the invoked method. This typically happens when a non-RMI service
interface is used for an RMI service. The methods of such a service interface
have to match the RMI stub methods, but they typically don't declare
java.rmi.RemoteException
: A RemoteException thrown by the RMI stub
will be automatically converted to Spring's RemoteAccessException.
java.lang.Throwable
@Deprecated public static java.lang.Object doInvoke(MethodInvocation invocation, java.rmi.Remote stub) throws java.lang.reflect.InvocationTargetException
invokeRemoteMethod(MethodInvocation, java.lang.Object)
java.lang.reflect.InvocationTargetException
public static java.lang.Object invokeRemoteMethod(MethodInvocation invocation, java.lang.Object stub) throws java.lang.reflect.InvocationTargetException
invocation
- the AOP MethodInvocationstub
- the RMI stub
java.lang.reflect.InvocationTargetException
- if thrown by reflectionpublic static java.lang.Exception convertRmiAccessException(java.lang.reflect.Method method, java.lang.Throwable ex, java.lang.String message)
Only call this for remote access exceptions, not for exceptions thrown by the target service itself!
method
- the invoked methodex
- the exception that happened, to be used as cause for the
RemoteAccessException or RemoteExceptionmessage
- the message for the RemoteAccessException respectively
RemoteException
public static java.lang.Exception convertRmiAccessException(java.lang.reflect.Method method, java.rmi.RemoteException ex, java.lang.String serviceName)
method
- the invoked methodex
- the RemoteException that happenedserviceName
- the name of the service (for debugging purposes)
public static java.lang.Exception convertRmiAccessException(java.lang.reflect.Method method, java.rmi.RemoteException ex, boolean isConnectFailure, java.lang.String serviceName)
method
- the invoked methodex
- the RemoteException that happenedisConnectFailure
- whether the given exception should be considered
a connect failureserviceName
- the name of the service (for debugging purposes)
public static boolean isConnectFailure(java.rmi.RemoteException ex)
Treats RMI's ConnectException, ConnectIOException, UnknownHostException,
NoSuchObjectException and StubNotFoundException as connect failure,
as well as Oracle's OC4J com.evermind.server.rmi.RMIConnectionException
(which doesn't derive from from any well-known RMI connect exception).
ex
- the RMI exception to check
ConnectException
,
ConnectIOException
,
UnknownHostException
,
NoSuchObjectException
,
StubNotFoundException
private static boolean isCorbaConnectFailure(java.lang.Throwable ex)
This is relevant on the IBM JVM, in particular for WebSphere EJB clients.
See the
IBM website
for details.
ex
- the RMI exception to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |