1. /*
  2. * Copyright 2002-2004 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. package org.springframework.remoting.rmi;
  17. import java.lang.reflect.InvocationTargetException;
  18. import java.rmi.Remote;
  19. import java.rmi.RemoteException;
  20. import org.springframework.remoting.support.RemoteInvocation;
  21. /**
  22. * Interface for RMI invocation handlers instances on the server,
  23. * wrapping exported services. A client uses a stub implementing
  24. * this interface to access such a service.
  25. *
  26. * <p>This is an SPI interface, not to be used directly by applications.
  27. *
  28. * @author Juergen Hoeller
  29. * @since 14.05.2003
  30. */
  31. public interface RmiInvocationHandler extends Remote {
  32. /**
  33. * Apply the given invocation to the target object.
  34. * Called by RmiClientInterceptor.
  35. * @param invocation object that encapsulates invocation parameters
  36. * @return the object returned from the invoked method, if any
  37. * @throws RemoteException in case of communication errors
  38. * @throws NoSuchMethodException if the method name could not be resolved
  39. * @throws IllegalAccessException if the method could not be accessed
  40. * @throws InvocationTargetException if the method invocation resulted in an exception
  41. * @see RmiClientInterceptor
  42. */
  43. public Object invoke(RemoteInvocation invocation)
  44. throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
  45. }