Package org.wildfly.service
Class AsyncServiceBuilder<T>
java.lang.Object
org.jboss.msc.service.DelegatingServiceBuilder<T>
org.wildfly.service.AsyncServiceBuilder<T>
- All Implemented Interfaces:
ServiceBuilder<T>
- Direct Known Subclasses:
AsyncServiceBuilder
A
ServiceBuilder decorator whose installed Service will start and/or stop asynchronously.
This both reduces boilerplate code, and ensures that service implementors implement async behavior correctly.- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates theServicemethods that should execute asynchronously. -
Constructor Summary
ConstructorsConstructorDescriptionAsyncServiceBuilder(ServiceBuilder<T> builder, Supplier<Executor> executor) Decorates a service builder transparently applying asynchronous start/stop semantics.AsyncServiceBuilder(ServiceBuilder<T> builder, Supplier<Executor> executor, AsyncServiceBuilder.Async async) Decorates a service builder transparently applying asynchronous start/stop semantics. -
Method Summary
Methods inherited from class org.jboss.msc.service.DelegatingServiceBuilder
addAliases, addDependency, addListener, addMonitor, getDelegate, install, provides, requires, setInitialMode
-
Constructor Details
-
AsyncServiceBuilder
Decorates a service builder transparently applying asynchronous start/stop semantics.- Parameters:
builder- a service builderexecutor- an executor provider
-
AsyncServiceBuilder
public AsyncServiceBuilder(ServiceBuilder<T> builder, Supplier<Executor> executor, AsyncServiceBuilder.Async async) Decorates a service builder transparently applying asynchronous start/stop semantics.- Parameters:
builder- a service builderexecutor- an executor providerasync- indicates theServicemethods that should execute asynchronously
-
-
Method Details
-
setInstance
Description copied from class:DelegatingServiceBuilderSets service instance. IfServiceBuilder.install()method call is issued without this method being called thenNULLservice will be installed into the container.Once this method have been called then all subsequent calls of
ServiceBuilder.requires(ServiceName), andServiceBuilder.provides(ServiceName...)methods will fail because their return values should be provided to service instance.- Specified by:
setInstancein interfaceServiceBuilder<T>- Overrides:
setInstancein classDelegatingServiceBuilder<T>- Parameters:
service- the service instance- Returns:
- this configurator
-