Package org.jboss.msc.service
Interface ServiceTarget
- All Known Subinterfaces:
ServiceContainer,SingletonServiceTarget
- All Known Implementing Classes:
DelegatingServiceContainer,DelegatingServiceTarget
public interface ServiceTarget
The target of ServiceBuilder installations.
ServiceBuilders to be installed on a target have to be retrieved via
addService(ServiceName) method.
Service installation will only take place after ServiceBuilder.install() is issued.
ServiceBuilders that are not installed will be ignored.
Implementations of this interface are thread safe.
- Author:
- Flavia Rainone, Richard Opalka
-
Method Summary
Modifier and TypeMethodDescriptionaddDependency(ServiceName dependency) Deprecated.This method will be removed in a future release.addListener(LifecycleListener listener) Add a service lifecycle listener that will be added to this service.addMonitor(StabilityMonitor monitor) Deprecated.Stability monitors are unreliable - do not use them.Get a builder which can be used to add a service to this target.addService(ServiceName name) Deprecated.UseaddService()instead.<T> ServiceBuilder<T>addService(ServiceName name, Service<T> service) Deprecated.UseaddService()instead.removeListener(LifecycleListener listener) Remove a lifecycle listener from this target, if it exists.removeMonitor(StabilityMonitor monitor) Deprecated.Stability monitors are unreliable - do not use them.Create a sub-target using this as the parent target.
-
Method Details
-
addListener
Add a service lifecycle listener that will be added to this service.- Parameters:
listener- the lifecycle listener to add to the service- Returns:
- this target
-
removeListener
Remove a lifecycle listener from this target, if it exists.- Parameters:
listener- the lifecycle listener to remove- Returns:
- this target
-
addService
ServiceBuilder<?> addService()Get a builder which can be used to add a service to this target.- Returns:
- new service configurator
-
subTarget
ServiceTarget subTarget()Create a sub-target using this as the parent target.- Returns:
- the new service target
-
addService
Deprecated.UseaddService()instead. This method will be removed in a future release.Get a builder which can be used to add a service to this target.- Parameters:
name- the service name- Returns:
- new service configurator
-
addService
Deprecated.UseaddService()instead. This method will be removed in a future release.Get a builder which can be used to add a service to this target.- Parameters:
name- the service nameservice- the service- Returns:
- the builder for the service
-
addMonitor
Deprecated.Stability monitors are unreliable - do not use them. This method will be removed in a future release.Add a stability monitor that will be added to all the ServiceBuilders installed in this target.- Parameters:
monitor- the monitor to add to the target- Returns:
- this target
-
removeMonitor
Deprecated.Stability monitors are unreliable - do not use them. This method will be removed in a future release.Remove a monitor from this target, if it exists.- Parameters:
monitor- the monitor to remove- Returns:
- this target
-
addDependency
Deprecated.This method will be removed in a future release.Add a dependency that will be added to the all ServiceBuilders installed in this target.- Parameters:
dependency- the dependency to add to the target- Returns:
- this target
-