01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.remoting.rmi;
18:
19: import java.lang.reflect.InvocationTargetException;
20: import java.rmi.Remote;
21: import java.rmi.RemoteException;
22:
23: import org.springframework.remoting.support.RemoteInvocation;
24:
25: /**
26: * Interface for RMI invocation handlers instances on the server,
27: * wrapping exported services. A client uses a stub implementing
28: * this interface to access such a service.
29: *
30: * <p>This is an SPI interface, not to be used directly by applications.
31: *
32: * @author Juergen Hoeller
33: * @since 14.05.2003
34: */
35: public interface RmiInvocationHandler extends Remote {
36:
37: /**
38: * Return the name of the target interface that this invoker operates on.
39: * @return the name of the target interface, or <code>null</code> if none
40: * @throws RemoteException in case of communication errors
41: * @see RmiServiceExporter#getServiceInterface()
42: */
43: public String getTargetInterfaceName() throws RemoteException;
44:
45: /**
46: * Apply the given invocation to the target object.
47: * <p>Called by
48: * {@link RmiClientInterceptor#doInvoke(org.aopalliance.intercept.MethodInvocation, RmiInvocationHandler)}.
49: * @param invocation object that encapsulates invocation parameters
50: * @return the object returned from the invoked method, if any
51: * @throws RemoteException in case of communication errors
52: * @throws NoSuchMethodException if the method name could not be resolved
53: * @throws IllegalAccessException if the method could not be accessed
54: * @throws InvocationTargetException if the method invocation resulted in an exception
55: */
56: public Object invoke(RemoteInvocation invocation)
57: throws RemoteException, NoSuchMethodException,
58: IllegalAccessException, InvocationTargetException;
59:
60: }
|