Search in sources :

Example 6 with ServiceContainer

use of io.zeebe.servicecontainer.ServiceContainer in project zeebe by zeebe-io.

the class ClusterComponent method init.

@Override
public void init(final SystemContext context) {
    final ServiceContainer serviceContainer = context.getServiceContainer();
    final ConfigurationManager configurationManager = context.getConfigurationManager();
    final TransportComponentCfg config = configurationManager.readEntry("network", TransportComponentCfg.class);
    initMemberList(serviceContainer);
    initGossip(serviceContainer, config);
    initClusterManager(serviceContainer, config);
}
Also used : TransportComponentCfg(io.zeebe.broker.transport.cfg.TransportComponentCfg) ServiceContainer(io.zeebe.servicecontainer.ServiceContainer)

Example 7 with ServiceContainer

use of io.zeebe.servicecontainer.ServiceContainer in project zeebe by zeebe-io.

the class EmbeddedBrokerRule method getService.

public <S> S getService(ServiceName<S> serviceName) {
    final ServiceContainer serviceContainer = broker.getBrokerContext().getServiceContainer();
    final Injector<S> injector = new Injector<>();
    final ServiceName<Object> accessorServiceName = ServiceName.newServiceName("serviceAccess" + serviceName.getName(), Object.class);
    try {
        serviceContainer.createService(accessorServiceName, new NoneService()).dependency(serviceName, injector).install().get();
    } catch (InterruptedException | ExecutionException e) {
        throw new RuntimeException(e);
    }
    serviceContainer.removeService(accessorServiceName);
    return injector.getValue();
}
Also used : ServiceContainer(io.zeebe.servicecontainer.ServiceContainer) Injector(io.zeebe.servicecontainer.Injector) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ServiceContainer (io.zeebe.servicecontainer.ServiceContainer)7 TransportComponentCfg (io.zeebe.broker.transport.cfg.TransportComponentCfg)2 Broker (io.zeebe.broker.Broker)1 RaftApiMessageHandlerService (io.zeebe.broker.clustering.raft.RaftApiMessageHandlerService)1 DeploymentManager (io.zeebe.broker.system.deployment.service.DeploymentManager)1 WorkflowRequestMessageHandlerService (io.zeebe.broker.system.deployment.service.WorkflowRequestMessageHandlerService)1 PartitionManagerService (io.zeebe.broker.system.log.PartitionManagerService)1 SystemPartitionManager (io.zeebe.broker.system.log.SystemPartitionManager)1 MetricsFileWriterService (io.zeebe.broker.system.metrics.MetricsFileWriterService)1 MetricsCfg (io.zeebe.broker.system.metrics.cfg.MetricsCfg)1 ClientApiMessageHandlerService (io.zeebe.broker.transport.clientapi.ClientApiMessageHandlerService)1 ControlMessageHandlerManagerService (io.zeebe.broker.transport.controlmessage.ControlMessageHandlerManagerService)1 StreamProcessorController (io.zeebe.logstreams.processor.StreamProcessorController)1 Raft (io.zeebe.raft.Raft)1 Injector (io.zeebe.servicecontainer.Injector)1 InetSocketAddress (java.net.InetSocketAddress)1 ExecutionException (java.util.concurrent.ExecutionException)1 Test (org.junit.Test)1