Package org.jboss.msc.service
Interface ServiceTarget
-
- All Known Subinterfaces:
ServiceContainer
- All Known Implementing Classes:
DelegatingServiceContainer,DelegatingServiceTarget
public interface ServiceTargetThe target of ServiceBuilder installations. ServiceBuilders to be installed on a target have to be retrieved viaaddService(ServiceName)method. Service installation will only take place afterServiceBuilder.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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ServiceTargetaddDependency(ServiceName dependency)Deprecated.This method will be removed in a future release.ServiceTargetaddListener(LifecycleListener listener)Add a service lifecycle listener that will be added to this service.ServiceTargetaddMonitor(StabilityMonitor monitor)Deprecated.Stability monitors are unreliable - do not use them.ServiceBuilder<?>addService()Get a builder which can be used to add a service to this target.ServiceBuilder<?>addService(ServiceName name)Deprecated.UseaddService()instead.<T> ServiceBuilder<T>addService(ServiceName name, Service<T> service)Deprecated.UseaddService()instead.ServiceTargetremoveListener(LifecycleListener listener)Remove a lifecycle listener from this target, if it exists.ServiceTargetremoveMonitor(StabilityMonitor monitor)Deprecated.Stability monitors are unreliable - do not use them.ServiceTargetsubTarget()Create a sub-target using this as the parent target.
-
-
-
Method Detail
-
addListener
ServiceTarget addListener(LifecycleListener listener)
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
ServiceTarget removeListener(LifecycleListener listener)
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 ServiceBuilder<?> addService(ServiceName name)
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 <T> ServiceBuilder<T> addService(ServiceName name, Service<T> service)
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 ServiceTarget addMonitor(StabilityMonitor monitor)
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 ServiceTarget removeMonitor(StabilityMonitor monitor)
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 ServiceTarget addDependency(ServiceName dependency)
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
-
-