Interface MethodInvoker


  • public interface MethodInvoker
    Can be used by RpcDispatcher / MethodCall to invoke a method against a given target object
    Since:
    4.1.0
    Author:
    Bela Ban
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(java.lang.Object target, short method_id, java.lang.Object[] args)
      An implementation invokes a method associated with a given ID and the given args against a target object
    • Method Detail

      • invoke

        java.lang.Object invoke​(java.lang.Object target,
                                short method_id,
                                java.lang.Object[] args)
                         throws java.lang.Exception
        An implementation invokes a method associated with a given ID and the given args against a target object
        Parameters:
        target - The object against which to invoke the method
        method_id - The ID of the method. The implementation must assign unique IDs and associate them somehow with a method to invoke
        args - The arguments of the invocation
        Returns:
        The result. It may be null if a method returns void
        Throws:
        java.lang.Exception - Thrown if the invocation threw an exception. The real exception may be wrapped in an InvocationTargetException.