use of org.glassfish.hk2.api.DynamicConfiguration in project Payara by payara.
the class HK2IntegrationExtension method afterDeploymentValidation.
/**
* Called by CDI after it has been completely validated. Will add the JIT resolver to HK2
* with the BeanManager
*
* @param event This is just to mark the type of the event
* @param manager The manager that will be used to get references
*/
@SuppressWarnings("unused")
private void afterDeploymentValidation(@Observes AfterDeploymentValidation event) {
if (locator == null)
return;
DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
DynamicConfiguration config = dcs.createDynamicConfiguration();
config.addActiveDescriptor(CDISecondChanceResolver.class);
config.addActiveDescriptor(CDIContextBridge.class);
config.commit();
}
use of org.glassfish.hk2.api.DynamicConfiguration in project Payara by payara.
the class WebContainer method addAndGetWebConfigListener.
private WebConfigListener addAndGetWebConfigListener() {
ServiceLocator locator = serviceLocator;
DynamicConfiguration config = locator.getService(DynamicConfigurationService.class).createDynamicConfiguration();
config.addActiveDescriptor(WebConfigListener.class);
config.commit();
return locator.getService(WebConfigListener.class);
}
use of org.glassfish.hk2.api.DynamicConfiguration in project Payara by payara.
the class ConfigListenerTest method registerAndCreateHttpListenerContainer.
private HttpListenerContainer registerAndCreateHttpListenerContainer(ServiceLocator locator) {
HttpListenerContainer retVal = locator.getService(HttpListenerContainer.class);
if (retVal != null)
return retVal;
DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
Assert.assertNotNull(dcs);
DynamicConfiguration config = dcs.createDynamicConfiguration();
config.addActiveDescriptor(HttpListenerContainer.class);
config.commit();
return locator.getService(HttpListenerContainer.class);
}
use of org.glassfish.hk2.api.DynamicConfiguration in project Payara by payara.
the class ConfigTest method before.
@BeforeClass
public static void before() {
DynamicConfigurationService dcs = habitat.getService(DynamicConfigurationService.class);
DynamicConfiguration config = dcs.createDynamicConfiguration();
new ConfigModule(habitat).configure(config);
config.commit();
}
use of org.glassfish.hk2.api.DynamicConfiguration in project Payara by payara.
the class ConfigDisposalTest method before.
@Before
public void before() {
String testName = TEST_NAME + RANDOM.nextInt();
habitat = ServiceLocatorFactory.getInstance().create(testName);
DynamicConfigurationService dcs = habitat.getService(DynamicConfigurationService.class);
DynamicConfiguration config = dcs.createDynamicConfiguration();
new ConfigModule(habitat).configure(config);
config.commit();
parseDomainXml();
}
Aggregations