T - the service typepublic class DelegatingServiceBuilder<T> extends Object implements ServiceBuilder<T>
| Constructor and Description |
|---|
DelegatingServiceBuilder(ServiceBuilder<T> delegate)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ServiceBuilder<T> |
addAliases(ServiceName... aliases)
Deprecated.
|
<I> ServiceBuilder<T> |
addDependency(ServiceName dependency,
Class<I> type,
Injector<I> target)
Deprecated.
|
ServiceBuilder<T> |
addListener(LifecycleListener listener)
Adds a service listener to be added to the service.
|
ServiceBuilder<T> |
addMonitor(StabilityMonitor monitor)
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 value provided by service.
|
<V> Supplier<V> |
requires(ServiceName name)
Specifies value name 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 <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)
name parameter must be provided to this method. If there are more names
in the vararg array then the first one is called provided value name and other are called provided value aliases.provides in interface ServiceBuilder<T>V - provided value typenames - provided value name (and its aliases)public 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.
Once this method have been called then all subsequent
calls of ServiceBuilder.requires(ServiceName), and ServiceBuilder.provides(ServiceName...)
methods will fail because their return values should be provided to service instance.
setInstance in interface ServiceBuilder<T>service - the service instancepublic 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> addAliases(ServiceName... aliases)
addAliases in interface ServiceBuilder<T>aliases - the service names to use as aliases@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 ServiceBuilder<T> addMonitor(StabilityMonitor monitor)
addMonitor in interface ServiceBuilder<T>monitor - the monitor to add to the serviceCopyright © 2021 Red Hat, Inc.