com.ibm.rational.test.lt.kernel.action.impl
Class KExceptionHandler
java.lang.Object
com.ibm.rational.test.lt.kernel.action.impl.KExceptionHandler
- All Implemented Interfaces:
- IKExceptionHandler
public class KExceptionHandler
- extends Object
- implements IKExceptionHandler
A KExceptionHandler maps an exception (java.lang.Throwable) to an IKAction that defines the action(s)
to execute in the event the exception occurs.
An instance of this class can be installed as a catcher in a container via IContainer.addCatch()
Method Summary |
void |
acquire(Object owner)
Any time the exception handler is about to be executed the container doing the execution
needs to acquire the handler so that the same instance of the action cannot be executed by
multiple threads concurrently. |
IKAction |
getAction()
|
Class<? extends Throwable> |
getExceptionClass()
|
void |
release(Object owner)
Called when the executing container is done with the exception handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KExceptionHandler
public KExceptionHandler(String className,
IKAction action)
KExceptionHandler
public KExceptionHandler(Throwable example,
IKAction action)
KExceptionHandler
public KExceptionHandler(Class<? extends Throwable> exceptionClass,
IKAction action)
getAction
public IKAction getAction()
- Specified by:
getAction
in interface IKExceptionHandler
- Returns:
- The action to execute upon occurrence of the handled exception Class
getExceptionClass
public Class<? extends Throwable> getExceptionClass()
- Specified by:
getExceptionClass
in interface IKExceptionHandler
- Returns:
- The Class of the exception that is handled by this handler.
acquire
public void acquire(Object owner)
- Description copied from interface:
IKExceptionHandler
- Any time the exception handler is about to be executed the container doing the execution
needs to acquire the handler so that the same instance of the action cannot be executed by
multiple threads concurrently. This is important for RAISE and in case something throws
the same exception that is being processed by a RAISE.
- Specified by:
acquire
in interface IKExceptionHandler
release
public void release(Object owner)
- Description copied from interface:
IKExceptionHandler
- Called when the executing container is done with the exception handler. Should be called
in finish(IKAction).
- Specified by:
release
in interface IKExceptionHandler
© Copyright IBM Corp. 2012. All rights reserved.