1 package org.apache.turbine.services.rundata;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import javax.servlet.ServletConfig;
20 import javax.servlet.http.HttpServletRequest;
21 import javax.servlet.http.HttpServletResponse;
22
23 import org.apache.turbine.services.Service;
24 import org.apache.turbine.util.RunData;
25 import org.apache.turbine.util.TurbineException;
26
27 /***
28 * The RunData Service provides the implementations for RunData and
29 * related interfaces required by request processing. It supports
30 * different configurations of implementations, which can be selected
31 * by specifying a configuration key. It may use pooling, in which case
32 * the implementations should implement the Recyclable interface.
33 *
34 * @author <a href="mailto:ilkka.priha@simsoft.fi">Ilkka Priha</a>
35 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
36 * @version $Id: RunDataService.java 264148 2005-08-29 14:21:04Z henning $
37 */
38 public interface RunDataService
39 extends Service
40 {
41 /*** The key under which this service is stored in TurbineServices. */
42 String SERVICE_NAME = "RunDataService";
43
44 /*** The default parser configuration key. */
45 String DEFAULT_CONFIG = "default";
46
47 /*** The property for the implemention of the RunData object */
48 String RUN_DATA_KEY = "run.data";
49
50 /*** The property for the implemention of the ParameterParser. */
51 String PARAMETER_PARSER_KEY = "parameter.parser";
52
53 /*** The property for the implemention of the CookieParser. */
54 String COOKIE_PARSER_KEY = "cookie.parser";
55
56 /***
57 * Gets a default RunData object.
58 *
59 * @param req a servlet request.
60 * @param res a servlet response.
61 * @param config a servlet config.
62 * @return a new or recycled RunData object.
63 * @throws TurbineException if the operation fails.
64 */
65 RunData getRunData(HttpServletRequest req,
66 HttpServletResponse res,
67 ServletConfig config)
68 throws TurbineException;
69
70 /***
71 * Gets a RunData object from a specific configuration.
72 *
73 * @param key a configuration key.
74 * @param req a servlet request.
75 * @param res a servlet response.
76 * @param config a servlet config.
77 * @return a new or recycled RunData object.
78 * @throws TurbineException if the operation fails.
79 */
80 RunData getRunData(String key,
81 HttpServletRequest req,
82 HttpServletResponse res,
83 ServletConfig config)
84 throws TurbineException;
85
86 /***
87 * Puts the used RunData object back to the factory for recycling.
88 *
89 * @param data the used RunData object.
90 * @return true, if pooling is supported and the object was accepted.
91 */
92 boolean putRunData(RunData data);
93 }