public static < T > Invoker of ( final Provider < T > provider ) { if ( provider == null ) throw new NullPointerException ( "provider" ) ; return new Invoker ( ) { @ Override public Object invoke ( final Invocation invocation ) throws Exception { T service = provider . get ( ) ; return invocation . invoke ( service ) ; } } ; }
Creates an invoker which uses a service provider to execute invocations .