KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > remoting > rmi > RmiInvocationHandler


1 /*
2  * Copyright 2002-2007 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc;
20 import java.rmi.Remote JavaDoc;
21 import java.rmi.RemoteException JavaDoc;
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 JavaDoc {
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 JavaDoc getTargetInterfaceName() throws RemoteException JavaDoc;
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 JavaDoc invoke(RemoteInvocation invocation)
57         throws RemoteException JavaDoc, NoSuchMethodException JavaDoc, IllegalAccessException JavaDoc, InvocationTargetException JavaDoc;
58
59 }
60
Popular Tags