|
JBoss Modular Service Container 1.2.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.msc.service.StabilityMonitor
public final class StabilityMonitor

A stability detection utility. It can be used to detect
if all the registered controllers with StabilityMonitor are in REST state.
The following controller substates are considered to be in REST state:
ServiceController.Substate.CANCELLEDServiceController.Substate.WAITINGServiceController.Substate.WONT_STARTServiceController.Substate.PROBLEMServiceController.Substate.START_FAILEDServiceController.Substate.UPServiceController.Substate.REMOVED
Set<ServiceController<?>> controllers = ...
StabilityMonitor monitor = new StabilityMonitor();
for (ServiceController<?> controller : controllers) {
monitor.addController(controller);
}
try {
monitor.awaitStability();
} finally {
monitor.clear();
// since now on the monitor can be reused for another stability detection
}
// do something after all the controllers are in REST state
Sample simple usage:
ServiceController<?> controller = ...
StabilityMonitor monitor = new StabilityMonitor();
monitor.addController(controller);
controller.setMode(REMOVE);
try {
monitor.awaitStability();
} finally {
monitor.removeController(controller);
}
// do something after controller have been removed from container
StabilityStatistics| Constructor Summary | |
|---|---|
StabilityMonitor()
|
|
| Method Summary | |
|---|---|
void |
addController(ServiceController<?> controller)
Register controller with this monitor. |
void |
awaitStability()
Causes the current thread to wait until the monitor is stable. |
boolean |
awaitStability(long timeout,
TimeUnit unit)
Causes the current thread to wait until the monitor is stable. |
boolean |
awaitStability(long timeout,
TimeUnit unit,
Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems)
Causes the current thread to wait until the monitor is stable. |
boolean |
awaitStability(long timeout,
TimeUnit unit,
Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
Causes the current thread to wait until the monitor is stable. |
boolean |
awaitStability(long timeout,
TimeUnit unit,
StabilityStatistics statistics)
Causes the current thread to wait until the monitor is stable. |
void |
awaitStability(Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems)
Causes the current thread to wait until the monitor is stable. |
void |
awaitStability(Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
Causes the current thread to wait until the monitor is stable. |
void |
awaitStability(StabilityStatistics statistics)
Causes the current thread to wait until the monitor is stable. |
void |
clear()
Removes all the registered controllers in this monitor. |
void |
removeController(ServiceController<?> controller)
Unregister controller with this monitor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StabilityMonitor()
| Method Detail |
|---|
public void addController(ServiceController<?> controller)
controller - to be registered for stability detection.public void removeController(ServiceController<?> controller)
controller - to be unregistered from stability detection.public void clear()
public void awaitStability()
throws InterruptedException
InterruptedException - if the current thread is interrupted
while waiting
public void awaitStability(StabilityStatistics statistics)
throws InterruptedException
statistics - stability statistics report to fill in
InterruptedException - if the current thread is interrupted
while waiting
public boolean awaitStability(long timeout,
TimeUnit unit)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argument
InterruptedException - if the current thread is interrupted
while waiting
public boolean awaitStability(long timeout,
TimeUnit unit,
StabilityStatistics statistics)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argumentstatistics - stability statistics report to fill in
InterruptedException - if the current thread is interrupted
while waiting
public void awaitStability(Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems)
throws InterruptedException
failed - a set into which failed services should be copiedproblems - a set into which problem services should be copied
InterruptedException - if the current thread is interrupted
while waiting
public boolean awaitStability(long timeout,
TimeUnit unit,
Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argumentfailed - a set into which failed services should be copiedproblems - a set into which problem services should be copied
InterruptedException - if the current thread is interrupted
while waiting
public void awaitStability(Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
throws InterruptedException
failed - a set into which failed services should be copiedproblems - a set into which problem services should be copiedstatistics - stability statistics report to fill in
InterruptedException - if the current thread is interrupted
while waiting
public boolean awaitStability(long timeout,
TimeUnit unit,
Set<? super ServiceController<?>> failed,
Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argumentfailed - a set into which failed services should be copiedproblems - a set into which problem services should be copiedstatistics - stability statistics report to fill in
InterruptedException - if the current thread is interrupted
while waiting
|
JBoss Modular Service Container 1.2.0.Beta2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||