01: package org.apache.turbine.services.pull;
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 org.apache.turbine.util.RunData;
20:
21: /**
22: * Tools in the Toolbox that need a Rundata Object on every refresh should
23: * implement this interface.
24: *
25: * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
26: * @version $Id: RunDataApplicationTool.java 264152 2005-08-29 14:50:22Z henning $
27: */
28: public interface RunDataApplicationTool {
29: /**
30: * Initialize the application tool. The data parameter holds a different
31: * type depending on how the tool is being instantiated:
32: * <ul>
33: * <li>For global tools data will be null</li>
34: * <li>For request tools data will be of type RunData</li>
35: * <li>For session and authorized tools data will be of type User</li>
36: * </ul>
37: * <p>
38: * It is possible that session scope tools will be initialized with a null
39: * <code>User</code> object. This happens when the first request on a
40: * session happens to the be login action. The next request on the session
41: * will cause the session tool to be refreshed if
42: * <code>tools.per.request.refresh</code> is set to <code>true</code>
43: * in <code>TurbineResources.properties</code>. You will then be able to
44: * get a <code>User</code> object from the instance of
45: * <code>RunData</object>.
46: *
47: * @param data initialization data
48: */
49: void init(Object data);
50:
51: /**
52: * Refresh the application tool. This is
53: * necessary for development work where you
54: * probably want the tool to refresh itself
55: * if it is using configuration information
56: * that is typically cached after initialization
57: *
58: * @param data The current RunData Object
59: */
60: void refresh(RunData data);
61: }
|