|
JBoss Modular Service Kernel API 1.0.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.msc.service.DelegatingServiceContainer
public final class DelegatingServiceContainer
A delegating container for things which depend on a service container rather than a specific target or registry instance.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.msc.service.ServiceContainer |
---|
ServiceContainer.Factory, ServiceContainer.TerminateListener |
Constructor Summary | |
---|---|
DelegatingServiceContainer(ServiceTarget delegateTarget,
ServiceRegistry delegateRegistry)
Construct a new instance. |
Method Summary | ||
---|---|---|
ServiceContainer |
addDependency(Collection<ServiceName> dependencies)
Add a collection of dependencies that will be added to the all ServiceBuilders installed in this target |
|
ServiceContainer |
addDependency(ServiceName... dependencies)
Add a list of dependencies that will be added to the all ServiceBuilders installed in this target. |
|
ServiceContainer |
addDependency(ServiceName dependency)
Add a dependency that will be added to the all ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(Collection<ServiceListener<Object>> listeners)
Add a collection of service listener that will be added to all ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(ServiceListener.Inheritance inheritance,
Collection<ServiceListener<Object>> listeners)
Add a collection of service listener that will be added to all ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(ServiceListener.Inheritance inheritance,
ServiceListener<Object>... listeners)
Add a list of service listener that will be added to all ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(ServiceListener.Inheritance inheritance,
ServiceListener<Object> listener)
Add a service listener that will be added to all the ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(ServiceListener<Object>... listeners)
Add a list of service listener that will be added to all ServiceBuilders installed in this target. |
|
ServiceContainer |
addListener(ServiceListener<Object> listener)
Add a service listener that will be added to all the ServiceBuilders installed in this target. |
|
|
addService(ServiceName name,
Service<T> service)
Get a builder which can be used to add a service to this target. |
|
|
addServiceValue(ServiceName name,
Value<? extends Service<T>> value)
Get a builder which can be used to add a service to this target. |
|
void |
addTerminateListener(ServiceContainer.TerminateListener listener)
Add a terminate listener to this container. |
|
void |
awaitTermination()
Causes the current thread to wait until the container is shutdown. |
|
void |
awaitTermination(long timeout,
TimeUnit unit)
Causes the current thread to wait until the container is shutdown. |
|
BatchServiceTarget |
batchTarget()
Create a new batch service target, which is used to install described services in this target. |
|
void |
dumpServices()
Dump a complete list of services to System.out . |
|
void |
dumpServices(PrintStream stream)
Dump a complete list of services to the given stream. |
|
Set<ServiceName> |
getDependencies()
Returns a set of all dependencies added to this target. |
|
Set<ServiceListener<Object>> |
getListeners()
Returns a set of the listeners added to this target. |
|
String |
getName()
Get the name of this service container. |
|
ServiceController<?> |
getRequiredService(ServiceName serviceName)
Get a service, throwing an exception if it is not found. |
|
ServiceController<?> |
getService(ServiceName serviceName)
Get a service, returning null if it is not found. |
|
List<ServiceName> |
getServiceNames()
Get a list of service names installed in this registry. |
|
boolean |
isShutdownComplete()
Determine whether the container is completely shut down. |
|
ServiceContainer |
removeDependency(ServiceName dependency)
Remove a dependency from this target. |
|
ServiceContainer |
removeListener(ServiceListener<Object> listener)
Remove a listener from this target, if it exists. |
|
void |
shutdown()
Stop all services within this container. |
|
ServiceTarget |
subTarget()
Create a sub-target using this as the parent target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegatingServiceContainer(ServiceTarget delegateTarget, ServiceRegistry delegateRegistry)
delegateTarget
- the delegate to forward service target requests todelegateRegistry
- the delegate to forward registry requests toMethod Detail |
---|
public <T> ServiceBuilder<T> addServiceValue(ServiceName name, Value<? extends Service<T>> value) throws IllegalArgumentException
addServiceValue
in interface ServiceTarget
name
- the service namevalue
- the service value
IllegalArgumentException
public <T> ServiceBuilder<T> addService(ServiceName name, Service<T> service) throws IllegalArgumentException
addService
in interface ServiceTarget
name
- the service nameservice
- the service
IllegalArgumentException
public ServiceContainer addListener(ServiceListener<Object> listener)
addListener
in interface ServiceTarget
listener
- the listener to add to the target
public ServiceContainer addListener(ServiceListener<Object>... listeners)
addListener
in interface ServiceTarget
listeners
- a list of listeners to add to the target
public ServiceContainer addListener(Collection<ServiceListener<Object>> listeners)
addListener
in interface ServiceTarget
listeners
- a collection of listeners to add to the target
public ServiceContainer addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object> listener)
addListener
in interface ServiceTarget
inheritance
- the inheritance type for this listenerlistener
- the listener to add to the target
public ServiceContainer addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object>... listeners)
addListener
in interface ServiceTarget
inheritance
- the inheritance type for this listenerlisteners
- a list of listeners to add to the target
public ServiceContainer addListener(ServiceListener.Inheritance inheritance, Collection<ServiceListener<Object>> listeners)
addListener
in interface ServiceTarget
inheritance
- the inheritance type for this listenerlisteners
- a collection of listeners to add to the target
public ServiceContainer removeListener(ServiceListener<Object> listener)
removeListener
in interface ServiceTarget
listener
- the listener to remove
public Set<ServiceListener<Object>> getListeners()
getListeners
in interface ServiceTarget
public ServiceContainer addDependency(ServiceName dependency)
addDependency
in interface ServiceTarget
dependency
- the dependency to add to the target
public ServiceContainer addDependency(ServiceName... dependencies)
addDependency
in interface ServiceTarget
dependencies
- a list of dependencies to add to the target
public ServiceContainer addDependency(Collection<ServiceName> dependencies)
addDependency
in interface ServiceTarget
dependencies
- a collection of dependencies to add to this target
public ServiceContainer removeDependency(ServiceName dependency)
removeDependency
in interface ServiceTarget
dependency
- the dependency
public Set<ServiceName> getDependencies()
getDependencies
in interface ServiceTarget
public ServiceTarget subTarget()
subTarget
in interface ServiceTarget
public BatchServiceTarget batchTarget()
batchTarget
in interface ServiceTarget
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException
getRequiredService
in interface ServiceRegistry
serviceName
- the service name
ServiceNotFoundException
- if the service is not present in the registrypublic ServiceController<?> getService(ServiceName serviceName)
null
if it is not found.
getService
in interface ServiceRegistry
serviceName
- the service name
null
if it is not foundpublic List<ServiceName> getServiceNames()
getServiceNames
in interface ServiceRegistry
public String getName()
getName
in interface ServiceContainer
public void shutdown()
shutdown
in interface ServiceContainer
public boolean isShutdownComplete()
isShutdownComplete
in interface ServiceContainer
true
if shutdown is completepublic void dumpServices()
System.out
.
dumpServices
in interface ServiceContainer
public void dumpServices(PrintStream stream)
dumpServices
in interface ServiceContainer
stream
- the stream to which the service list should be writtenpublic void addTerminateListener(ServiceContainer.TerminateListener listener)
listener
will be invoked when this container shutdown process is complete.
addTerminateListener
in interface ServiceContainer
listener
- the listenerpublic void awaitTermination()
awaitTermination
in interface ServiceContainer
public void awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ServiceContainer
timeout
- the maximum time to waitunit
- the time unit of the timeout
argument
InterruptedException
- if the current thread is interrupted
while waiting
|
JBoss Modular Service Kernel API 1.0.0.CR2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |