|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.digitalis.dif.controller.ExceptionHandlers
public class ExceptionHandlers
Exception Handler stages registry class. Allows registering of all stages that declare to handle specific exceptions.
Field Summary | |
---|---|
static String |
RAISED_EXCEPTION_ATTRIBUTE
Attribute ID to save the raised exception caught by the exception handler |
Constructor Summary | |
---|---|
ExceptionHandlers()
|
Method Summary | |
---|---|
static void |
addExceptionHandler(Class<Throwable> exceptionClass,
String stageID)
Registers a new Exception handler |
static void |
addExceptionHandler(String exceptionClassName,
String stageID)
Registers a new Exception handler |
static String |
getExceptionHandler(Class<? extends Throwable> exceptionClass)
Gets the ID of the handler stage for the given exception |
static String |
getExceptionHandler(String exceptionClassName)
Gets the ID of the handler stage for the given exception |
static String |
getExceptionHandler(Throwable exception)
Gets the ID of the handler stage for the given exception |
static void |
handleException(IDIFContext context,
Exception exception)
Handles redirection actions for a given exsception. |
static boolean |
hasHandler(Class<? extends Throwable> exceptionClass)
Inspector for a given exception. |
static boolean |
hasHandler(Exception exception)
Inspector for a given exception. |
static boolean |
hasHandler(String exceptionClassName)
Inspector for a given exception. |
static void |
removeExceptionHandler(String key)
Removes a registered exception handler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RAISED_EXCEPTION_ATTRIBUTE
Constructor Detail |
---|
public ExceptionHandlers()
Method Detail |
---|
public static void addExceptionHandler(Class<Throwable> exceptionClass, String stageID)
exceptionClass
- the exception class to registerstageID
- the ID for the handler stagepublic static void addExceptionHandler(String exceptionClassName, String stageID)
exceptionClassName
- the exception class name to registerstageID
- the ID for the handler stagepublic static String getExceptionHandler(Class<? extends Throwable> exceptionClass)
exceptionClass
- the class of the exception
public static String getExceptionHandler(String exceptionClassName)
exceptionClassName
- the class name of the exception
public static String getExceptionHandler(Throwable exception)
exception
- the exception
public static void handleException(IDIFContext context, Exception exception)
context
- the current running stage contextexception
- the exception raised to handlepublic static boolean hasHandler(Class<? extends Throwable> exceptionClass)
exceptionClass
- the exception class
public static boolean hasHandler(Exception exception)
exception
- the exception
public static boolean hasHandler(String exceptionClassName)
exceptionClassName
- the exception class name
public static void removeExceptionHandler(String key)
key
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |