Java Code Examples for org.jboss.msc.service.StartContext#getChildTarget()

The following examples show how to use org.jboss.msc.service.StartContext#getChildTarget() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenShiftTopologyConnector.java    From thorntail with Apache License 2.0 6 votes vote down vote up
@Override
public void start(StartContext context) throws StartException {
    ServiceTarget target = context.getChildTarget();

    ClientService clientService = new ClientService();
    target.addService(ClientService.SERVICE_NAME, clientService)
            .install();

    NamespaceService namespaceService = new NamespaceService();
    target.addService(NamespaceService.SERVICE_NAME, namespaceService)
            .addDependency(ClientService.SERVICE_NAME, IClient.class, namespaceService.getClientInjector())
            .install();

    ServiceWatcher watcher = new ServiceWatcher();
    target.addService(ServiceWatcher.SERVICE_NAME, watcher)
            .addDependency(ClientService.SERVICE_NAME, IClient.class, watcher.getClientInjector())
            .addDependency(NamespaceService.SERVICE_NAME, String.class, watcher.getNamespaceInjector())
            .addDependency(TopologyManagerActivator.SERVICE_NAME, TopologyManager.class, watcher.getTopologyManagerInjector())
            .install();
}
 
Example 2
Source File: ConsulTopologyConnector.java    From thorntail with Apache License 2.0 5 votes vote down vote up
@Override
public void start(StartContext startContext) throws StartException {
    ServiceTarget target = startContext.getChildTarget();

    CatalogWatcher watcher = new CatalogWatcher();
    target.addService(CatalogWatcher.SERVICE_NAME, watcher)
            .addDependency(CatalogClientService.SERVICE_NAME, CatalogClient.class, watcher.getCatalogClientInjector())
            .addDependency(HealthClientService.SERIVCE_NAME, HealthClient.class, watcher.getHealthClientInjector())
            .addDependency(TopologyManagerActivator.SERVICE_NAME, TopologyManager.class, watcher.getTopologyManagerInjector())
            .install();


}
 
Example 3
Source File: ConsulTopologyConnector.java    From ARCHIVE-wildfly-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public void start(StartContext startContext) throws StartException {
    ServiceTarget target = startContext.getChildTarget();

    ConsulService consul = new ConsulService(this.url);
    target.addService(ConsulService.SERVICE_NAME, consul)
            .install();

    HealthClientService healthClient = new HealthClientService();
    target.addService(HealthClientService.SERIVCE_NAME, healthClient)
            .addDependency(ConsulService.SERVICE_NAME, Consul.class, healthClient.getConsulInjector())
            .install();

    AgentClientService agentClient = new AgentClientService();
    target.addService(AgentClientService.SERVICE_NAME, agentClient)
            .addDependency(ConsulService.SERVICE_NAME, Consul.class, agentClient.getConsulInjector())
            .install();

    CatalogClientService catalogClient = new CatalogClientService();
    target.addService(CatalogClientService.SERVICE_NAME, catalogClient)
            .addDependency(ConsulService.SERVICE_NAME, Consul.class, catalogClient.getConsulInjector())
            .install();


    this.advertiser = new Advertiser();
    target.addService(Advertiser.SERVICE_NAME, advertiser)
            .addDependency(AgentClientService.SERVICE_NAME, AgentClient.class, advertiser.getAgentClientInjector())
            .install();

    CatalogWatcher watcher = new CatalogWatcher();
    target.addService(CatalogWatcher.SERVICE_NAME, watcher)
            .addDependency(CatalogClientService.SERVICE_NAME, CatalogClient.class, watcher.getCatalogClientInjector())
            .addDependency(HealthClientService.SERIVCE_NAME, HealthClient.class, watcher.getHealthClientInjector())
            .addDependency(TopologyManager.SERVICE_NAME, TopologyManager.class, watcher.getTopologyManagerInjector())
            .install();
}
 
Example 4
Source File: CamelContextRegistryService.java    From wildfly-camel with Apache License 2.0 5 votes vote down vote up
@Override
public void start(StartContext startContext) throws StartException {
    ContextCreateHandlerRegistry handlerRegistry = injectedHandlerRegistry.getValue();
    contextRegistry = new CamelContextRegistryImpl(handlerRegistry, startContext.getChildTarget());
    ((CamelContextTracker) contextRegistry).open();

    for (final String name : subsystemState.getContextDefinitionNames()) {
        createCamelContext(name, subsystemState.getContextDefinition(name));
    }
}
 
Example 5
Source File: MscRuntimeContainerDelegate.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: MscRuntimeContainerDelegate.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 7
Source File: ContextCreateHandlerRegistryService.java    From wildfly-camel with Apache License 2.0 4 votes vote down vote up
@Override
public void start(StartContext startContext) throws StartException {
    ServiceContainer serviceContainer = startContext.getController().getServiceContainer();
    createHandlerRegistry = new ContextCreateHandlerRegistryImpl(serviceContainer, startContext.getChildTarget());
}
 
Example 8
Source File: ProcessApplicationModuleService.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void start(StartContext context) throws StartException {
  childTarget = context.getChildTarget();
}
 
Example 9
Source File: ProcessApplicationModuleService.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void start(StartContext context) throws StartException {
  childTarget = context.getChildTarget();
}