T
- the service typepublic class DelegatingServiceBuilder<T> extends Object implements ServiceBuilder<T>
ServiceBuilder.DependencyType
Constructor and Description |
---|
DelegatingServiceBuilder(ServiceBuilder<T> delegate)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
ServiceBuilder<T> |
addAliases(ServiceName... aliases)
Adds aliases for this service.
|
ServiceBuilder<T> |
addDependencies(Iterable<ServiceName> dependencies)
Deprecated.
|
ServiceBuilder<T> |
addDependencies(ServiceBuilder.DependencyType dependencyType,
Iterable<ServiceName> dependencies)
Deprecated.
|
ServiceBuilder<T> |
addDependencies(ServiceBuilder.DependencyType dependencyType,
ServiceName... dependencies)
Deprecated.
|
ServiceBuilder<T> |
addDependencies(ServiceName... dependencies)
Deprecated.
|
ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency)
Deprecated.
|
<I> ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency,
Class<I> type,
Injector<I> target)
Deprecated.
|
ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency,
Injector<Object> target)
Deprecated.
|
ServiceBuilder<T> |
addDependency(ServiceName dependency)
Deprecated.
|
<I> ServiceBuilder<T> |
addDependency(ServiceName dependency,
Class<I> type,
Injector<I> target)
Deprecated.
|
ServiceBuilder<T> |
addDependency(ServiceName dependency,
Injector<Object> target)
Deprecated.
|
<I> ServiceBuilder<T> |
addInjection(Injector<? super I> target,
I value)
Deprecated.
|
ServiceBuilder<T> |
addInjection(Injector<? super T> target)
Deprecated.
|
<I> ServiceBuilder<T> |
addInjectionValue(Injector<? super I> target,
Value<I> value)
Deprecated.
|
ServiceBuilder<T> |
addListener(Collection<? extends ServiceListener<? super T>> listeners)
Deprecated.
|
ServiceBuilder<T> |
addListener(LifecycleListener listener)
Adds a service listener to be added to the service.
|
ServiceBuilder<T> |
addListener(ServiceListener<? super T>... listeners)
Deprecated.
|
ServiceBuilder<T> |
addListener(ServiceListener<? super T> listener)
Deprecated.
|
ServiceBuilder<T> |
addMonitor(StabilityMonitor monitor)
Adds a stability monitor to be added to the service.
|
ServiceBuilder<T> |
addMonitors(StabilityMonitor... monitors)
Deprecated.
|
protected ServiceBuilder<T> |
getDelegate()
Get the ServiceBuilder delegate.
|
ServiceController<T> |
install()
Installs configured service into the container.
|
<V> Consumer<V> |
provides(ServiceName... names)
Specifies injector provided by service.
|
<V> Supplier<V> |
requires(ServiceName name)
Specifies dependency value required by service.
|
ServiceBuilder<T> |
setInitialMode(ServiceController.Mode mode)
Sets initial service mode.
|
ServiceBuilder<T> |
setInstance(Service service)
Sets service instance.
|
public DelegatingServiceBuilder(ServiceBuilder<T> delegate)
delegate
- the builder to delegate toprotected ServiceBuilder<T> getDelegate()
public ServiceBuilder<T> addAliases(ServiceName... aliases)
addAliases
in interface ServiceBuilder<T>
aliases
- the service names to use as aliasespublic <V> Supplier<V> requires(ServiceName name)
requires
in interface ServiceBuilder<T>
V
- required dependency value typename
- required dependency namepublic <V> Consumer<V> provides(ServiceName... names)
provides
in interface ServiceBuilder<T>
V
- provided dependency value typenames
- provided dependency namespublic ServiceBuilder<T> setInitialMode(ServiceController.Mode mode)
setInitialMode
in interface ServiceBuilder<T>
mode
- initial service modepublic ServiceBuilder<T> setInstance(Service service)
ServiceBuilder.install()
method call is issued
without this method being called then NULL
service will be
installed into the container.
When this method have been called then all subsequent
calls of ServiceBuilder.requires(ServiceName)
, and ServiceBuilder.provides(ServiceName...)
methods will fail.
setInstance
in interface ServiceBuilder<T>
service
- the service instancepublic ServiceBuilder<T> addMonitor(StabilityMonitor monitor)
addMonitor
in interface ServiceBuilder<T>
monitor
- the monitor to add to the servicepublic ServiceBuilder<T> addListener(LifecycleListener listener)
addListener
in interface ServiceBuilder<T>
listener
- the listener to add to the servicepublic ServiceController<T> install()
install
in interface ServiceBuilder<T>
@Deprecated public ServiceBuilder<T> addDependencies(ServiceName... dependencies)
addDependencies
in interface ServiceBuilder<T>
dependencies
- the service names to depend on@Deprecated public ServiceBuilder<T> addDependencies(ServiceBuilder.DependencyType dependencyType, ServiceName... dependencies)
addDependencies
in interface ServiceBuilder<T>
dependencyType
- the dependency type; must not be null
dependencies
- the service names to depend on@Deprecated public ServiceBuilder<T> addDependencies(Iterable<ServiceName> dependencies)
addDependencies
in interface ServiceBuilder<T>
dependencies
- the service names to depend on@Deprecated public ServiceBuilder<T> addDependencies(ServiceBuilder.DependencyType dependencyType, Iterable<ServiceName> dependencies)
addDependencies
in interface ServiceBuilder<T>
dependencyType
- the dependency type; must not be null
dependencies
- the service names to depend on@Deprecated public ServiceBuilder<T> addDependency(ServiceName dependency)
addDependency
in interface ServiceBuilder<T>
dependency
- the name of the dependency@Deprecated public ServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency)
addDependency
in interface ServiceBuilder<T>
dependencyType
- the dependency type; must not be null
dependency
- the name of the dependency@Deprecated public ServiceBuilder<T> addDependency(ServiceName dependency, Injector<Object> target)
addDependency
in interface ServiceBuilder<T>
dependency
- the name of the dependencytarget
- the injector into which the dependency should be stored@Deprecated public ServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency, Injector<Object> target)
addDependency
in interface ServiceBuilder<T>
dependencyType
- the dependency type; must not be null
dependency
- the name of the dependencytarget
- the injector into which the dependency should be stored@Deprecated public <I> ServiceBuilder<T> addDependency(ServiceName dependency, Class<I> type, Injector<I> target)
addDependency
in interface ServiceBuilder<T>
I
- the type of the value of the dependencydependency
- the name of the dependencytype
- the class of the value of the dependencytarget
- the injector into which the dependency should be stored@Deprecated public <I> ServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency, Class<I> type, Injector<I> target)
addDependency
in interface ServiceBuilder<T>
I
- the type of the value of the dependencydependencyType
- the dependency type; must not be null
dependency
- the name of the dependencytype
- the class of the value of the dependencytarget
- the injector into which the dependency should be stored@Deprecated public <I> ServiceBuilder<T> addInjection(Injector<? super I> target, I value)
addInjection
in interface ServiceBuilder<T>
I
- the injection typetarget
- the injection targetvalue
- the injection value@Deprecated public <I> ServiceBuilder<T> addInjectionValue(Injector<? super I> target, Value<I> value)
addInjectionValue
in interface ServiceBuilder<T>
I
- the injection typetarget
- the injection targetvalue
- the injection value@Deprecated public ServiceBuilder<T> addInjection(Injector<? super T> target)
Differently from other injection types, failures to perform an outward injection will not result in a failure to start the service.
addInjection
in interface ServiceBuilder<T>
target
- the injector target@Deprecated public ServiceBuilder<T> addMonitors(StabilityMonitor... monitors)
addMonitors
in interface ServiceBuilder<T>
monitors
- a list of stability monitors to add to the service@Deprecated public ServiceBuilder<T> addListener(ServiceListener<? super T> listener)
addListener
in interface ServiceBuilder<T>
listener
- the listener to add to the service@Deprecated public ServiceBuilder<T> addListener(ServiceListener<? super T>... listeners)
addListener
in interface ServiceBuilder<T>
listeners
- a list of listeners to add to the service@Deprecated public ServiceBuilder<T> addListener(Collection<? extends ServiceListener<? super T>> listeners)
addListener
in interface ServiceBuilder<T>
listeners
- a collection of listeners to add to the serviceCopyright © 2019 JBoss by Red Hat. All rights reserved.