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.
|
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 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 nulldependencies - 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 nulldependencies - 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 nulldependency - 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 nulldependency - 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 nulldependency - 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> addMonitor(StabilityMonitor monitor)
addMonitor in interface ServiceBuilder<T>monitor - the monitor to add to the service@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 © 2021 Red Hat, Inc.