/** * Creates the naming store if not provided by the constructor. * * @param context The start context * @throws StartException If any problems occur creating the context */ public void start(final StartContext context) throws StartException { if(store == null) { final ServiceRegistry serviceRegistry = context.getController().getServiceContainer(); final ServiceName serviceNameBase = context.getController().getName(); final ServiceTarget serviceTarget = context.getChildTarget(); store = readOnly ? new ServiceBasedNamingStore(serviceRegistry, serviceNameBase) : new WritableServiceBasedNamingStore(serviceRegistry, serviceNameBase, serviceTarget); } }
/** * Creates the naming store if not provided by the constructor. * * @param context The start context * @throws StartException If any problems occur creating the context */ public synchronized void start(final StartContext context) throws StartException { if(store == null) { store = new WritableServiceBasedNamingStore(context.getController().getServiceContainer(), context.getController().getName(),context.getChildTarget()); } }
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) 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) 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) 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)
/** * Creates the naming store if not provided by the constructor. * * @param context The start context * @throws StartException If any problems occur creating the context */ public void start(final StartContext context) throws StartException { if(store == null) { final ServiceRegistry serviceRegistry = context.getController().getServiceContainer(); final ServiceName serviceNameBase = context.getController().getName(); final ServiceTarget serviceTarget = context.getChildTarget(); store = readOnly ? new ServiceBasedNamingStore(serviceRegistry, serviceNameBase) : new WritableServiceBasedNamingStore(serviceRegistry, serviceNameBase, serviceTarget); } }
/** * Creates the naming store if not provided by the constructor. * * @param context The start context * @throws StartException If any problems occur creating the context */ public void start(final StartContext context) throws StartException { if(store == null) { final ServiceRegistry serviceRegistry = context.getController().getServiceContainer(); final ServiceName serviceNameBase = context.getController().getName(); final ServiceTarget serviceTarget = context.getChildTarget(); store = readOnly ? new ServiceBasedNamingStore(serviceRegistry, serviceNameBase) : new WritableServiceBasedNamingStore(serviceRegistry, serviceNameBase, serviceTarget); } }