public static RmiServiceInvocation create ( Object remoteTarget , Method method , Object [ ] args ) { RmiServiceInvocation serviceInvocation = new RmiServiceInvocation ( ) ; if ( Proxy . isProxyClass ( remoteTarget . getClass ( ) ) ) { serviceInvocation . setRemote ( method . getDeclaringClass ( ) . getName ( ) ) ; } else { serviceInvocation . setRemote ( remoteTarget . getClass ( ) . getName ( ) ) ; } serviceInvocation . setMethod ( method . getName ( ) ) ; if ( args != null ) { serviceInvocation . setArgs ( new RmiServiceInvocation . Args ( ) ) ; for ( Object arg : args ) { MethodArg methodArg = new MethodArg ( ) ; methodArg . setValueObject ( arg ) ; if ( Map . class . isAssignableFrom ( arg . getClass ( ) ) ) { methodArg . setType ( Map . class . getName ( ) ) ; } else if ( List . class . isAssignableFrom ( arg . getClass ( ) ) ) { methodArg . setType ( List . class . getName ( ) ) ; } else { methodArg . setType ( arg . getClass ( ) . getName ( ) ) ; } serviceInvocation . getArgs ( ) . getArgs ( ) . add ( methodArg ) ; } } return serviceInvocation ; }
Static create method from target object and method definition .