| java.lang.Object org.springframework.remoting.rmi.RmiClientInterceptorUtils
RmiClientInterceptorUtils | abstract public class RmiClientInterceptorUtils (Code) | | 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 |
Method Summary | |
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). | 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. | 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. | public static Object | doInvoke(MethodInvocation invocation, Remote stub) Perform a raw method invocation on the given RMI stub,
letting reflection exceptions through as-is. | public static Object | invoke(MethodInvocation invocation, Remote stub, String serviceName) Apply the given method invocation to the given RMI stub.
Delegate to the corresponding method if the RMI stub does not directly
implemented the invoked method. | public static boolean | isConnectFailure(RemoteException ex) Determine whether the given RMI exception indicates a connect failure. |
convertRmiAccessException | public static Exception convertRmiAccessException(Method method, Throwable ex, String message)(Code) | | 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 Parameters: ex - the exception that happened, to be used as cause for theRemoteAccessException or RemoteException Parameters: message - the message for the RemoteAccessException respectivelyRemoteException the exception to be thrown to the caller |
convertRmiAccessException | public static Exception convertRmiAccessException(Method method, RemoteException ex, String serviceName)(Code) | | 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 Parameters: ex - the RemoteException that happened Parameters: 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)(Code) | | 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 Parameters: ex - the RemoteException that happened Parameters: isConnectFailure - whether the given exception should be considereda connect failure Parameters: serviceName - the name of the service (for debugging purposes) the exception to be thrown to the caller |
doInvoke | public static Object doInvoke(MethodInvocation invocation, Remote stub) throws InvocationTargetException(Code) | | Perform a raw method invocation on the given RMI stub,
letting reflection exceptions through as-is.
Parameters: invocation - the AOP MethodInvocation Parameters: stub - the RMI stub the invocation result, if any throws: InvocationTargetException - if thrown by reflection |
invoke | public static Object invoke(MethodInvocation invocation, Remote stub, String serviceName) throws Throwable(Code) | | Apply the given method invocation to the given RMI stub.
Delegate to the corresponding method if the RMI stub does not directly
implemented 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.
Parameters: invocation - the AOP MethodInvocation Parameters: stub - the RMI stub Parameters: serviceName - the name of the service (for debugging purposes) the invocation result, if any throws: Throwable - exception to be thrown to the caller See Also: java.rmi.RemoteException See Also: org.springframework.remoting.RemoteAccessException |
|
|