org.activemq.util
Class ExceptionTemplate
java.lang.Object
org.activemq.util.ExceptionTemplate
public class ExceptionTemplate
- extends Object
A helper class for ensuring that a number of tasks occur, whether they
throw exceptions or not and saving the first exception so that we can
throw it properly.
This class is particularly useful for shutting things down, where we
want to try close all resources, whether they fail or not.
- Version:
- $Revision: 1.1.1.1 $
Method Summary |
Throwable |
getFirstException()
Returns the first exception thrown during the execution of this
template or returns null if there has been no exception thrown yet. |
void |
run(Callback task)
|
void |
throwJMSException()
Throws the first exception caught during the execution of this template
as a JMS exception or do nothing if we have not caught and exception |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExceptionTemplate
public ExceptionTemplate()
run
public void run(Callback task)
getFirstException
public Throwable getFirstException()
- Returns the first exception thrown during the execution of this
template or returns null if there has been no exception thrown yet.
- Returns:
- the first caught exception or null if none has occured yet
throwJMSException
public void throwJMSException()
throws JMSException
- Throws the first exception caught during the execution of this template
as a JMS exception or do nothing if we have not caught and exception
- Throws:
JMSException
Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.