Search in sources :

Example 1 with HK2IntoGuiceBridge

use of org.jvnet.hk2.guice.bridge.api.HK2IntoGuiceBridge in project graylog2-server by Graylog2.

the class Graylog2ServiceLocatorGenerator method create.

@Override
public ServiceLocator create(String name, ServiceLocator parent) {
    final ServiceLocator serviceLocator = super.create(name, parent);
    final Injector injector = GuiceInjectorHolder.getInjector().createChildInjector(new HK2IntoGuiceBridge(serviceLocator));
    GuiceBridge.getGuiceBridge().initializeGuiceBridge(serviceLocator);
    final GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService(GuiceIntoHK2Bridge.class);
    guiceBridge.bridgeGuiceInjector(injector);
    return serviceLocator;
}
Also used : ServiceLocator(org.glassfish.hk2.api.ServiceLocator) GuiceIntoHK2Bridge(org.jvnet.hk2.guice.bridge.api.GuiceIntoHK2Bridge) Injector(com.google.inject.Injector) HK2IntoGuiceBridge(org.jvnet.hk2.guice.bridge.api.HK2IntoGuiceBridge)

Aggregations

Injector (com.google.inject.Injector)1 ServiceLocator (org.glassfish.hk2.api.ServiceLocator)1 GuiceIntoHK2Bridge (org.jvnet.hk2.guice.bridge.api.GuiceIntoHK2Bridge)1 HK2IntoGuiceBridge (org.jvnet.hk2.guice.bridge.api.HK2IntoGuiceBridge)1