public interface ServiceContainer extends ServiceTarget, ServiceRegistry
Modifier and Type | Interface and Description |
---|---|
static class |
ServiceContainer.Factory
The factory class for service containers.
|
static interface |
ServiceContainer.TerminateListener
A listener for notification of container shutdown.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
String |
getName()
Get the name of this service container.
|
boolean |
isShutdownComplete()
Determine whether the container is completely shut down.
|
void |
shutdown()
Stop all services within this container.
|
addDependency, addDependency, addDependency, addListener, addListener, addListener, addListener, addListener, addListener, addService, addServiceValue, batchTarget, getDependencies, getListeners, removeDependency, removeListener, subTarget
getRequiredService, getService, getServiceNames
void shutdown()
boolean isShutdownComplete()
true
if shutdown is completevoid addTerminateListener(ServiceContainer.TerminateListener listener)
listener
will be invoked when this container shutdown process is complete.listener
- the listenervoid awaitTermination() throws InterruptedException
InterruptedException
- if the current thread is interrupted
while waitingvoid awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumentInterruptedException
- if the current thread is interrupted
while waitingvoid dumpServices()
System.out
.void dumpServices(PrintStream stream)
stream
- the stream to which the service list should be writtenString getName()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.