NamingContext.initializeNamingManager();
final ServiceContainer serviceContainer = CurrentServiceContainer.getServiceContainer();
final ServiceTarget target = context.getServiceTarget();
// Create the Naming Service
final ServiceBasedNamingStore namingStore = new WritableServiceBasedNamingStore(serviceContainer, ContextNames.JAVA_CONTEXT_SERVICE_NAME,target);
newControllers.add(target.addService(NamingService.SERVICE_NAME, new NamingService(namingStore))
.addAliases(ContextNames.JAVA_CONTEXT_SERVICE_NAME)
.setInitialMode(ServiceController.Mode.ACTIVE)
.addListener(verificationHandler)
.install());
// Create the java:global namespace
final ServiceBasedNamingStore globalNamingStore = new WritableServiceBasedNamingStore(serviceContainer, ContextNames.GLOBAL_CONTEXT_SERVICE_NAME,target);
newControllers.add(target.addService(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, new NamingStoreService(globalNamingStore))
.setInitialMode(ServiceController.Mode.ACTIVE)
.addListener(verificationHandler)
.install());
// Create the java:jboss vendor namespace
final ServiceBasedNamingStore jbossNamingStore = new WritableServiceBasedNamingStore(serviceContainer, ContextNames.JBOSS_CONTEXT_SERVICE_NAME,target);
newControllers.add(target.addService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, new NamingStoreService(jbossNamingStore))
.setInitialMode(ServiceController.Mode.ACTIVE)
.addListener(verificationHandler)
.install());
// Setup remote naming store
//we always install the naming store, but we don't install the server unless it has been explicitly enabled
final ServiceBasedNamingStore remoteExposedNamingStore = new WritableServiceBasedNamingStore(serviceContainer, ContextNames.EXPORTED_CONTEXT_SERVICE_NAME,target);
newControllers.add(target.addService(ContextNames.EXPORTED_CONTEXT_SERVICE_NAME, new NamingStoreService(remoteExposedNamingStore))
.setInitialMode(ServiceController.Mode.ACTIVE)
.addListener(verificationHandler)
.install());