Package io.zeebe.servicecontainer.impl
Class ServiceContainerImpl
- java.lang.Object
-
- io.zeebe.util.sched.Actor
-
- io.zeebe.servicecontainer.impl.ServiceContainerImpl
-
- All Implemented Interfaces:
ServiceContainer
public class ServiceContainerImpl extends Actor implements ServiceContainer
-
-
Field Summary
Fields Modifier and Type Field Description protected ActorScheduleractorSchedulerprotected ConcurrentQueueChannel<ServiceEvent>channelprotected ServiceDependencyResolverdependencyResolverprotected AtomicBooleanisOpenendstatic org.slf4j.LoggerLOGprotected io.zeebe.servicecontainer.impl.ServiceContainerImpl.ContainerStatestate
-
Constructor Summary
Constructors Constructor Description ServiceContainerImpl(ActorScheduler scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(long awaitTime, TimeUnit timeUnit)ActorFuture<Void>closeAsync()CompositeServiceBuildercreateComposite(ServiceName<Void> name)<S> ServiceBuilder<S>createService(ServiceName<S> name, Service<S> service)ActorSchedulergetActorScheduler()ConcurrentQueueChannel<ServiceEvent>getChannel()StringgetName()ActorFuture<Boolean>hasService(ServiceName<?> name)protected voidonActorStarted()<S> ActorFuture<S>onServiceBuilt(ServiceBuilder<S> serviceBuilder)protected voidonServiceEvent()ActorFuture<Void>removeService(ServiceName<?> serviceName)voidstart()-
Methods inherited from class io.zeebe.util.sched.Actor
onActorClosed, onActorCloseRequested, onActorClosing, onActorStarting, wrap
-
-
-
-
Field Detail
-
LOG
public static final org.slf4j.Logger LOG
-
dependencyResolver
protected final ServiceDependencyResolver dependencyResolver
-
channel
protected final ConcurrentQueueChannel<ServiceEvent> channel
-
actorScheduler
protected final ActorScheduler actorScheduler
-
isOpenend
protected final AtomicBoolean isOpenend
-
state
protected io.zeebe.servicecontainer.impl.ServiceContainerImpl.ContainerState state
-
-
Constructor Detail
-
ServiceContainerImpl
public ServiceContainerImpl(ActorScheduler scheduler)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceServiceContainer
-
hasService
public ActorFuture<Boolean> hasService(ServiceName<?> name)
- Specified by:
hasServicein interfaceServiceContainer
-
createService
public <S> ServiceBuilder<S> createService(ServiceName<S> name, Service<S> service)
- Specified by:
createServicein interfaceServiceContainer
-
createComposite
public CompositeServiceBuilder createComposite(ServiceName<Void> name)
- Specified by:
createCompositein interfaceServiceContainer
-
removeService
public ActorFuture<Void> removeService(ServiceName<?> serviceName)
- Specified by:
removeServicein interfaceServiceContainer
-
close
public void close(long awaitTime, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException- Specified by:
closein interfaceServiceContainer- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
closeAsync
public ActorFuture<Void> closeAsync()
- Specified by:
closeAsyncin interfaceServiceContainer
-
onActorStarted
protected void onActorStarted()
- Overrides:
onActorStartedin classActor
-
onServiceEvent
protected void onServiceEvent()
-
onServiceBuilt
public <S> ActorFuture<S> onServiceBuilt(ServiceBuilder<S> serviceBuilder)
-
getChannel
public ConcurrentQueueChannel<ServiceEvent> getChannel()
-
getActorScheduler
public ActorScheduler getActorScheduler()
-
-