KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > actionflow > ExceptionHandler


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.controller.actionflow;
8
9
10 /**
11  * <p>
12  * This interface describes the ActionFlow exception
13  * handling mechanism. When an exception is encountered
14  * during execution of an ActionFlow, this handler is
15  * called to optionally handle the exception. The handler
16  * can choose, based on whatever criteria it wants,
17  * whether or not to handle the exception.
18  * </p>
19  *
20  * <p>
21  * The ActionFlow system will allow the ExceptionHandler
22  * instance registered with the {@link NodeExecutorRegistry
23  * NodeExecutorRegistry} class to handle the exception
24  * first. If either no handler is registered, or the
25  * registered does not handle the exception, the ActionFlow
26  * system throws the exception to the caller.
27  * </p>
28  *
29  * <p>
30  * The default implemenation of this is the {@link
31  * BaseExceptionHandler BaseExceptionHandler} class in this
32  * package. This class should be consulted unless you decide
33  * to register your own custom ExceptionHandler with the
34  * registry.
35  * </p>
36  *
37  * @author Brian Pontarelli
38  * @since 2.0
39  * @version 2.0
40  */

41 public interface ExceptionHandler {
42
43     /**
44      * <p>
45      * Optionally handles the Exception given. This method is called by the ActionFlow
46      * system to handle any exception that is generated during execution. This could
47      * be a configuration exception or an execution exception. If the handler decides
48      * to handle the exception, it should return true to notify the ActionFlow system
49      * that the exception has been handled. If not, it should return false.
50      * </p>
51      *
52      * <p>
53      * Generally, this handler will need to forward or redirect the response to
54      * some page otherwise the request will be dropped on the floor. The default
55      * behavior of the ActionFlow system is to take no action, after a successful
56      * handling of an exception.
57      * </p>
58      *
59      * @param exception The Exception to optionally handle
60      * @param action The current ActionFlow action being executed
61      * @return True if the Exception was handled, false otherwise
62      */

63     boolean handleException(Exception JavaDoc exception, ActionFlowAction action);
64 }
65
Popular Tags