use of org.glassfish.hk2.utilities.DuplicatePostProcessor in project Payara by payara.
the class MicroGlassFishRuntime method newGlassFish.
@Override
public GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException {
System.setProperty("com.sun.aas.installRoot", System.getProperty("com.sun.aas.instanceRoot"));
System.setProperty("com.sun.aas.installRootURI", System.getProperty("com.sun.aas.instanceRootURI"));
glassfishProperties.setProperty("com.sun.aas.installRoot", System.getProperty("com.sun.aas.instanceRoot"));
glassfishProperties.setProperty("com.sun.aas.installRootURI", System.getProperty("com.sun.aas.instanceRootURI"));
StartupContext context = new StartupContext(glassfishProperties.getProperties());
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
SingleHK2Factory.initialize(tccl);
registry = new SingleModulesRegistry(tccl);
registry.setParentClassLoader(tccl);
habitat = registry.newServiceLocator();
DynamicConfigurationService dcs = habitat.getService(DynamicConfigurationService.class);
DynamicConfiguration config = dcs.createDynamicConfiguration();
config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(context));
config.commit();
registry.populateServiceLocator("default", habitat, Arrays.asList(new PayaraMicroInhabitantsParser(), new EmbeddedInhabitantsParser(), new DuplicatePostProcessor()));
registry.populateConfig(habitat);
ModuleStartup kernel = habitat.getService(ModuleStartup.class);
gf = new MicroGlassFish(kernel, habitat, glassfishProperties.getProperties());
return gf;
}
Aggregations