Package org.apache.activemq.util
Class ServiceStopper
- java.lang.Object
-
- org.apache.activemq.util.ServiceStopper
-
public class ServiceStopper extends Object
A helper class used to stop a bunch of services, catching and logging any exceptions and then throwing the first exception when everything is stoped.
-
-
Constructor Summary
Constructors Constructor Description ServiceStopper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidlogError(Object service, Throwable e)voidonException(Object owner, Throwable e)voidrun(Callback stopClosure)Performs the given code to stop some service handling the exceptions which may be thrown properlyvoidstop(Service service)Stops the given service, catching any exceptions that are thrown.voidstopServices(List services)Stops a list of servicesvoidthrowFirstException()Throws the first exception that was thrown if there was one.
-
-
-
Method Detail
-
stop
public void stop(Service service)
Stops the given service, catching any exceptions that are thrown.
-
run
public void run(Callback stopClosure)
Performs the given code to stop some service handling the exceptions which may be thrown properly
-
stopServices
public void stopServices(List services)
Stops a list of services
-
throwFirstException
public void throwFirstException() throws ExceptionThrows the first exception that was thrown if there was one.- Throws:
Exception
-
-