/** * Initialize the hk2 bridge * * @param locator the HK2 locator * @param injector the Guice injector */ protected void initBridge(ServiceLocator locator, Injector injector) { GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator); GuiceIntoHK2Bridge guiceBridge = locator.getService(GuiceIntoHK2Bridge.class); guiceBridge.bridgeGuiceInjector(injector); injectMultibindings(locator, injector); }
/** * Initialize the hk2 bridge * * @param locator the HK2 locator * @param injector the Guice injector */ protected void initBridge(ServiceLocator locator, Injector injector) { // Set up bridge GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator); GuiceIntoHK2Bridge guiceBridge = locator.getService(GuiceIntoHK2Bridge.class); guiceBridge.bridgeGuiceInjector(injector); injectMultibindings(locator, injector); // Bind guice scope context ServiceLocatorUtilities.bind(locator, new AbstractBinder() { @Override protected void configure() { bind(GuiceScopeContext.class).to(new TypeLiteral<Context<GuiceScope>>() { }).in(Singleton.class); } }); }
/** * Initialize the hk2 bridge * * @param locator the HK2 locator * @param injector the Guice injector */ protected void initBridge(ServiceLocator locator, Injector injector) { // Set up bridge GuiceBridge.getGuiceBridge().initializeGuiceBridge(locator); GuiceIntoHK2Bridge guiceBridge = locator.getService(GuiceIntoHK2Bridge.class); guiceBridge.bridgeGuiceInjector(injector); injectMultibindings(locator, injector); // Bind guice scope context ServiceLocatorUtilities.bind(locator, new AbstractBinder() { @Override protected void configure() { bind(GuiceScopeContext.class).to(new TypeLiteral<Context<GuiceScope>>() { }).in(Singleton.class); } }); }