KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > ControllerParser


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;
8
9
10 import com.inversoft.verge.mvc.MVCException;
11 import com.inversoft.verge.mvc.MVCRequest;
12
13
14 /**
15  * <p>
16  * This interface describes the method by which the default
17  * Inversoft MVC implementation parses the HttpServletRequest
18  * parameters to determine how the control of the application
19  * should be done. Implementations are also responsible for
20  * doing the work or delegating the work of controlling the
21  * flow of the application.
22  * </p>
23  *
24  * @author Brian Pontarelli
25  * @since 2.0
26  * @version 2.0
27  */

28 public interface ControllerParser {
29
30     /**
31      * Gives the controller parser and the controller implementation the chance
32      * to setup the {@link com.inversoft.verge.mvc.MVCRequest MVCRequest} objcet however they need.
33      * Usually this involves setting the configuration, the {@link
34      * ControllerMVCInfo ControllerMVCInfo} and whatever else is needed.
35      *
36      * @param mvcRequest The MVCRequest to setup
37      * @throws com.inversoft.verge.mvc.MVCException If there were any errors encountered
38      */

39     void preExecute(MVCRequest mvcRequest) throws MVCException;
40
41     /**
42      * Using the HttpServletRequest, this method parses out the information
43      * needed to handle the control of the application. This could include calling
44      * business logic, event handlers or whatever the implementation needs. In
45      * addition to parsing out this information, implementations are responsible
46      * for doing the work or delegating the work of handling the control of the
47      * application. For this purpose, the HttpServletResponse has be supplied so
48      * that the request can be forwarded or a redirect can be sent back to the
49      * client.
50      *
51      * @param mvcRequest The MVCRequest that is built as part of the
52      * MVCMediators mediation routine. This has the servlet request used
53      * for parsing the controller information if need be. It also has
54      * the response used for forwarding / redirecting the client to a
55      * new view
56      * @throws com.inversoft.verge.mvc.MVCException If there was any problems parse or handling the
57      * control of the application
58      * @since 2.0
59      */

60     void execute(MVCRequest mvcRequest) throws MVCException;
61 }
Popular Tags