public Object invoke ( RpcRequest req , Object handler ) throws RpcException , IllegalAccessException , InvocationTargetException { if ( contract == null ) { throw new IllegalStateException ( "contract cannot be null" ) ; } if ( req == null ) { throw new IllegalArgumentException ( "req cannot be null" ) ; } if ( handler == null ) { throw new IllegalArgumentException ( "handler cannot be null" ) ; } Method method = getMethod ( handler ) ; Object reqParams [ ] = unmarshalParams ( req , method ) ; return marshalResult ( method . invoke ( handler , reqParams ) ) ; }
Invokes this Function against the given handler Class for the given request . This is the heart of the RPC dispatch and is where your application code gets run .