public static Managed registerInjector ( final Application application , final Injector injector ) { Preconditions . checkNotNull ( application , "Application instance required" ) ; Preconditions . checkArgument ( ! INJECTORS . containsKey ( application ) , "Injector already registered for application %s" , application . getClass ( ) . getName ( ) ) ; INJECTORS . put ( application , injector ) ; return new Managed ( ) { @ Override public void start ( ) throws Exception { // not used } @ Override public void stop ( ) throws Exception { INJECTORS . remove ( application ) ; } } ; }
Used internally to register application specific injector .