@SuppressWarnings("unchecked") @Override public void start(StartContext context) throws StartException { super.start(context); ServiceRegistry registry = context.getController().getServiceContainer(); this.primaryController = (ServiceController<T>) registry.getService(this.getServiceName().append("primary")); this.backupController = (ServiceController<T>) registry.getService(this.getServiceName().append("backup")); this.started = true; }
@Override public T get() { ServiceTarget target = this.registry.getRequiredService(this.name).getServiceContainer();
/** * 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); } }
protected void stopInternal(StopContext context) { if (getLifecycleState().isAfter(BeanState.DESCRIBED)) { InstancesService.removeInstance(context.getController().getServiceContainer(), getLifecycleState(), getBean()); removeCallbacks(true); removeCallbacks(false); } executeUninstalls(); }
final RuntimeBindReleaseService.References duBindingReferences = (RuntimeBindReleaseService.References) binderServiceController.getServiceContainer().getService(JndiNamingDependencyProcessor.serviceName(deploymentUnitServiceName)).getValue(); duBindingReferences.add(binderService);
ServiceController<?> controller = context.getController().getServiceContainer().getService(deploymentServiceName); controller.addListener(new LifecycleListener() { @Override
public synchronized void start(StartContext startContext) throws StartException { try { final ServiceContainer container = startContext.getController().getServiceContainer(); deploymentMD = getDeployer().deploy(container); if (deploymentMD.getCfs().length != 1) { throw ConnectorLogger.ROOT_LOGGER.cannotStartDs(); } sqlDataSource = new WildFlyDataSource((javax.sql.DataSource) deploymentMD.getCfs()[0], jndiName.getAbsoluteJndiName()); DS_DEPLOYER_LOGGER.debugf("Adding datasource: %s", deploymentMD.getCfJndiNames()[0]); CommonDeploymentService cdService = new CommonDeploymentService(deploymentMD); final ServiceName cdServiceName = CommonDeploymentService.getServiceName(jndiName); final ServiceBuilder cdServiceSB = startContext.getChildTarget().addService(cdServiceName, cdService); // The dependency added must be the JNDI name which for subsystem resources is an alias. This service // is also used in deployments where the capability service name is not registered for the service. cdServiceSB.requires(getServiceName(jndiName)); cdServiceSB.setInitialMode(ServiceController.Mode.ACTIVE).install(); } catch (Throwable t) { throw ConnectorLogger.ROOT_LOGGER.deploymentError(t, dsName); } }
}; getUndertowService().registerStatisticsListener(statisticsChangeListener); final ServiceContainer container = context.getController().getServiceContainer(); this.stoppingWrapper = new HandlerWrapper() { @Override
public void rebind(Name name, Object object) throws NamingException { final Object owner = requireOwner(); // re-set the existent binder service injected value final ServiceName bindName = buildServiceName(name); final ServiceController<?> controller = getServiceRegistry().getService(bindName); if (controller == null) { bind(name, object, owner, bindName); } else { final BinderService binderService = (BinderService) controller.getService(); if (owner instanceof ServiceName) { final ServiceName deploymentUnitServiceName = (ServiceName) owner; binderService.acquire(); final RuntimeBindReleaseService.References duBindingReferences = (RuntimeBindReleaseService.References) controller.getServiceContainer().getService(JndiNamingDependencyProcessor.serviceName(deploymentUnitServiceName)).getValue(); duBindingReferences.add(binderService); } binderService.getManagedObjectInjector().setValue(new ImmediateValue(new ImmediateManagedReferenceFactory(object))); } }
addCallbacks(false); ServiceRegistry registry = context.getController().getServiceContainer(); InstancesService.addInstance(registry, context.getChildTarget(), getLifecycleState(), getBean());
@SuppressWarnings("unchecked") private ProcessApplicationDeploymentService getDeploymentService(StartContext context, ServiceName deploymentServiceName) { final ServiceContainer serviceContainer = context.getController().getServiceContainer(); ServiceController<ProcessApplicationDeploymentService> deploymentService = (ServiceController<ProcessApplicationDeploymentService>) serviceContainer.getRequiredService(deploymentServiceName); return deploymentService.getValue(); }
@SuppressWarnings("unchecked") private ProcessApplicationDeploymentService getDeploymentService(StartContext context, ServiceName deploymentServiceName) { final ServiceContainer serviceContainer = context.getController().getServiceContainer(); ServiceController<ProcessApplicationDeploymentService> deploymentService = (ServiceController<ProcessApplicationDeploymentService>) serviceContainer.getRequiredService(deploymentServiceName); return deploymentService.getValue(); }
@SuppressWarnings("unchecked") private ProcessApplicationDeploymentService getDeploymentService(StartContext context, ServiceName deploymentServiceName) { final ServiceContainer serviceContainer = context.getController().getServiceContainer(); ServiceController<ProcessApplicationDeploymentService> deploymentService = (ServiceController<ProcessApplicationDeploymentService>) serviceContainer.getRequiredService(deploymentServiceName); return deploymentService.getValue(); }
public void start(StartContext context) throws StartException { serviceContainer = context.getController().getServiceContainer(); childTarget = context.getChildTarget(); startTrackingServices(); createJndiBindings(); // set this implementation as Runtime Container RuntimeContainerDelegate.INSTANCE.set(this); }
public void start(StartContext context) throws StartException { serviceContainer = context.getController().getServiceContainer(); childTarget = context.getChildTarget(); startTrackingServices(); createJndiBindings(); // set this implementation as Runtime Container RuntimeContainerDelegate.INSTANCE.set(this); }
public void start(StartContext context) throws StartException { serviceContainer = context.getController().getServiceContainer(); childTarget = context.getChildTarget(); startTrackingServices(); createJndiBindings(); // set this implementation as Runtime Container RuntimeContainerDelegate.INSTANCE.set(this); }
@Override public synchronized void start(StartContext context) throws StartException { if (serviceContainer != null) { throw ServerLogger.ROOT_LOGGER.serviceModuleLoaderAlreadyStarted(); } serviceContainer = context.getController().getServiceContainer(); }
@Override public void start(StartContext context) throws StartException { if (serviceContainer != null) { throw ServerLogger.ROOT_LOGGER.externalModuleServiceAlreadyStarted(); } serviceContainer = context.getController().getServiceContainer(); }
@Override public synchronized void start(StartContext context) throws StartException { if (serviceContainer != null) { throw ServerMessages.MESSAGES.serviceModuleLoaderAlreadyStarted(); } serviceContainer = context.getController().getServiceContainer(); }
/** * 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()); } }