Class RemoteMethodExecutorImpl<T>

java.lang.Object
org.nuiton.util.rmi.RemoteMethodExecutorImpl<T>
All Implemented Interfaces:
java.rmi.Remote, RemoteMethodExecutor

public class RemoteMethodExecutorImpl<T>
extends java.lang.Object
implements RemoteMethodExecutor
RMI implementation of an invocation handler. This object will be exported to a RMI registry and will delegate method calls to some business service. The service is provided in the constructor.
Author:
Arnaud Thimel - thimel@codelutin.com
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected T service
    The target service on which calls will be made
  • Constructor Summary

    Constructors 
    Constructor Description
    RemoteMethodExecutorImpl​(T service)
    This is the only available constructor.
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object execute​(java.lang.String methodName, java.lang.Class<?>[] parametersType, java.lang.Object[] args)
    Acts like an InvocationHandler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • service

      protected T service
      The target service on which calls will be made
  • Constructor Details

    • RemoteMethodExecutorImpl

      public RemoteMethodExecutorImpl​(T service)
      This is the only available constructor. It is mandatory to specify a target service on which call will be delegated.
      Parameters:
      service - the mandatory service which calls will be delegated on
  • Method Details

    • execute

      public java.lang.Object execute​(java.lang.String methodName, java.lang.Class<?>[] parametersType, java.lang.Object[] args) throws java.rmi.RemoteException
      Description copied from interface: RemoteMethodExecutor
      Acts like an InvocationHandler.
      Specified by:
      execute in interface RemoteMethodExecutor
      Parameters:
      methodName - name of the method to invoke
      parametersType - parameters type to reliably identify the method
      args - method arguments to process the effective call
      Returns:
      the result of the delegate method
      Throws:
      java.rmi.RemoteException - for any error. Business exceptions will be wrapped.