@Deprecated
public final class StabilityMonitor
extends java.lang.Object
StabilityMonitor
are in REST state.
The following controller substates are considered to be in REST state:
ServiceController.Substate.NEW
ServiceController.Substate.CANCELLED
ServiceController.Substate.WAITING
ServiceController.Substate.WONT_START
ServiceController.Substate.PROBLEM
ServiceController.Substate.START_FAILED
ServiceController.Substate.UP
ServiceController.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 stateSample 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 and Description |
---|
StabilityMonitor()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addController(ServiceController<?> controller)
Deprecated.
Register controller with this monitor.
|
void |
awaitStability()
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
boolean |
awaitStability(long timeout,
java.util.concurrent.TimeUnit unit)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
boolean |
awaitStability(long timeout,
java.util.concurrent.TimeUnit unit,
java.util.Set<? super ServiceController<?>> failed,
java.util.Set<? super ServiceController<?>> problems)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
boolean |
awaitStability(long timeout,
java.util.concurrent.TimeUnit unit,
java.util.Set<? super ServiceController<?>> failed,
java.util.Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
boolean |
awaitStability(long timeout,
java.util.concurrent.TimeUnit unit,
StabilityStatistics statistics)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
void |
awaitStability(java.util.Set<? super ServiceController<?>> failed,
java.util.Set<? super ServiceController<?>> problems)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
void |
awaitStability(java.util.Set<? super ServiceController<?>> failed,
java.util.Set<? super ServiceController<?>> problems,
StabilityStatistics statistics)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
void |
awaitStability(StabilityStatistics statistics)
Deprecated.
Causes the current thread to wait until the monitor is stable.
|
void |
clear()
Deprecated.
Removes all the registered controllers in this monitor.
|
void |
removeController(ServiceController<?> controller)
Deprecated.
Unregister controller with this monitor.
|
public void addController(ServiceController<?> controller) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
controller
- to be registered for stability detection.java.lang.IllegalArgumentException
- if controller
is nulljava.lang.IllegalStateException
- if controller
s lock is held by current threadpublic void removeController(ServiceController<?> controller) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
controller
- to be unregistered from stability detection.java.lang.IllegalArgumentException
- if controller
is nulljava.lang.IllegalStateException
- if controller
s lock is held by current threadpublic void clear()
public void awaitStability() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic void awaitStability(StabilityStatistics statistics) throws java.lang.InterruptedException
statistics
- stability statistics report to fill injava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic boolean awaitStability(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumentjava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic boolean awaitStability(long timeout, java.util.concurrent.TimeUnit unit, StabilityStatistics statistics) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumentstatistics
- stability statistics report to fill injava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic void awaitStability(java.util.Set<? super ServiceController<?>> failed, java.util.Set<? super ServiceController<?>> problems) throws java.lang.InterruptedException
failed
- a set into which failed services should be copiedproblems
- a set into which problem services should be copiedjava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic boolean awaitStability(long timeout, java.util.concurrent.TimeUnit unit, java.util.Set<? super ServiceController<?>> failed, java.util.Set<? super ServiceController<?>> problems) throws java.lang.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 copiedjava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic void awaitStability(java.util.Set<? super ServiceController<?>> failed, java.util.Set<? super ServiceController<?>> problems, StabilityStatistics statistics) throws java.lang.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 injava.lang.InterruptedException
- if the current thread is interrupted
while waitingpublic boolean awaitStability(long timeout, java.util.concurrent.TimeUnit unit, java.util.Set<? super ServiceController<?>> failed, java.util.Set<? super ServiceController<?>> problems, StabilityStatistics statistics) throws java.lang.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 injava.lang.InterruptedException
- if the current thread is interrupted
while waitingCopyright © 2012 JBoss, a division of Red Hat, Inc.