T
- the service typepublic interface ServiceBuilder<T>
ServiceTarget
. Create an instance via the
ServiceTarget.addService(ServiceName, Service)
,
ServiceTarget.addServiceValue(ServiceName, Value)
or
methods.Modifier and Type | Interface and Description |
---|---|
static class |
ServiceBuilder.DependencyType
The dependency type.
|
Modifier and Type | Method and Description |
---|---|
ServiceBuilder<T> |
addAliases(ServiceName... aliases)
Add aliases for this service.
|
ServiceBuilder<T> |
addDependencies(Iterable<ServiceName> dependencies)
Add multiple, non-injected dependencies.
|
ServiceBuilder<T> |
addDependencies(ServiceBuilder.DependencyType dependencyType,
Iterable<ServiceName> dependencies)
Add multiple, non-injected dependencies.
|
ServiceBuilder<T> |
addDependencies(ServiceBuilder.DependencyType dependencyType,
ServiceName... dependencies)
Add multiple, non-injected dependencies.
|
ServiceBuilder<T> |
addDependencies(ServiceName... dependencies)
Add multiple, non-injected dependencies.
|
ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency)
Add a dependency.
|
<I> ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency,
Class<I> type,
Injector<I> target)
Add a service dependency.
|
ServiceBuilder<T> |
addDependency(ServiceBuilder.DependencyType dependencyType,
ServiceName dependency,
Injector<Object> target)
Add a service dependency.
|
ServiceBuilder<T> |
addDependency(ServiceName dependency)
Add a dependency.
|
<I> ServiceBuilder<T> |
addDependency(ServiceName dependency,
Class<I> type,
Injector<I> target)
Add a service dependency.
|
ServiceBuilder<T> |
addDependency(ServiceName dependency,
Injector<Object> target)
Add a service dependency.
|
<I> ServiceBuilder<T> |
addInjection(Injector<? super I> target,
I value)
Add an injection.
|
ServiceBuilder<T> |
addInjection(Injector<? super T> target)
Add an injection of this service into another target.
|
<I> ServiceBuilder<T> |
addInjectionValue(Injector<? super I> target,
Value<I> value)
Add an injection value.
|
ServiceBuilder<T> |
addListener(Collection<? extends ServiceListener<? super T>> listeners)
Add service listeners that will be added to this service.
|
ServiceBuilder<T> |
addListener(ServiceListener<? super T>... listeners)
Add service listeners that will be added to this service.
|
ServiceBuilder<T> |
addListener(ServiceListener<? super T> listener)
Add a service listener that will be added to this service.
|
ServiceBuilder<T> |
addMonitor(StabilityMonitor monitor)
Add a service stability monitor that will be added to this service.
|
ServiceBuilder<T> |
addMonitors(StabilityMonitor... monitors)
Add service stability monitors that will be added to this service.
|
ServiceController<T> |
install()
Install the defined service into the container.
|
ServiceBuilder<T> |
setInitialMode(ServiceController.Mode mode)
Set the initial mode.
|
ServiceBuilder<T> addAliases(ServiceName... aliases)
aliases
- the service names to use as aliasesServiceBuilder<T> setInitialMode(ServiceController.Mode mode)
mode
- the initial modeServiceBuilder<T> addDependencies(ServiceName... dependencies)
dependencies
- the service names to depend onServiceBuilder<T> addDependencies(ServiceBuilder.DependencyType dependencyType, ServiceName... dependencies)
dependencyType
- the dependency type; must not be null
dependencies
- the service names to depend onServiceBuilder<T> addDependencies(Iterable<ServiceName> dependencies)
dependencies
- the service names to depend onServiceBuilder<T> addDependencies(ServiceBuilder.DependencyType dependencyType, Iterable<ServiceName> dependencies)
dependencyType
- the dependency type; must not be null
dependencies
- the service names to depend onServiceBuilder<T> addDependency(ServiceName dependency)
dependency
- the name of the dependencyServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency)
dependencyType
- the dependency type; must not be null
dependency
- the name of the dependencyServiceBuilder<T> addDependency(ServiceName dependency, Injector<Object> target)
dependency
- the name of the dependencytarget
- the injector into which the dependency should be storedServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency, Injector<Object> target)
dependencyType
- the dependency type; must not be null
dependency
- the name of the dependencytarget
- the injector into which the dependency should be stored<I> ServiceBuilder<T> addDependency(ServiceName dependency, Class<I> type, Injector<I> target)
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<I> ServiceBuilder<T> addDependency(ServiceBuilder.DependencyType dependencyType, ServiceName dependency, Class<I> type, Injector<I> target)
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<I> ServiceBuilder<T> addInjection(Injector<? super I> target, I value)
I
- the injection typetarget
- the injection targetvalue
- the injection value<I> ServiceBuilder<T> addInjectionValue(Injector<? super I> target, Value<I> value)
I
- the injection typetarget
- the injection targetvalue
- the injection valueServiceBuilder<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.
target
- the injector targetServiceBuilder<T> addMonitor(StabilityMonitor monitor)
monitor
- the stability monitor to add to the serviceServiceBuilder<T> addMonitors(StabilityMonitor... monitors)
monitors
- a list of stability monitors to add to the serviceServiceBuilder<T> addListener(ServiceListener<? super T> listener)
listener
- the listener to add to the serviceServiceBuilder<T> addListener(ServiceListener<? super T>... listeners)
listeners
- a list of listeners to add to the serviceServiceBuilder<T> addListener(Collection<? extends ServiceListener<? super T>> listeners)
listeners
- a collection of listeners to add to the serviceServiceController<T> install() throws ServiceRegistryException, IllegalStateException
ServiceRegistryException
- if installation failsIllegalStateException
- if installation has been performed previouslyCopyright © 2017 JBoss by Red Hat. All rights reserved.