01: package org.apache.turbine.services.rundata;
02:
03: /*
04: * Copyright 2001-2005 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License")
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
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 extends Service {
39: /** The key under which this service is stored in TurbineServices. */
40: String SERVICE_NAME = "RunDataService";
41:
42: /** The default parser configuration key. */
43: String DEFAULT_CONFIG = "default";
44:
45: /** The property for the implemention of the RunData object */
46: String RUN_DATA_KEY = "run.data";
47:
48: /** The property for the implemention of the ParameterParser. */
49: String PARAMETER_PARSER_KEY = "parameter.parser";
50:
51: /** The property for the implemention of the CookieParser. */
52: String COOKIE_PARSER_KEY = "cookie.parser";
53:
54: /**
55: * Gets a default RunData object.
56: *
57: * @param req a servlet request.
58: * @param res a servlet response.
59: * @param config a servlet config.
60: * @return a new or recycled RunData object.
61: * @throws TurbineException if the operation fails.
62: */
63: RunData getRunData(HttpServletRequest req, HttpServletResponse res,
64: ServletConfig config) throws TurbineException;
65:
66: /**
67: * Gets a RunData object from a specific configuration.
68: *
69: * @param key a configuration key.
70: * @param req a servlet request.
71: * @param res a servlet response.
72: * @param config a servlet config.
73: * @return a new or recycled RunData object.
74: * @throws TurbineException if the operation fails.
75: */
76: RunData getRunData(String key, HttpServletRequest req,
77: HttpServletResponse res, ServletConfig config)
78: throws TurbineException;
79:
80: /**
81: * Puts the used RunData object back to the factory for recycling.
82: *
83: * @param data the used RunData object.
84: * @return true, if pooling is supported and the object was accepted.
85: */
86: boolean putRunData(RunData data);
87: }
|