1 package org.apache.turbine.services.pull;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 /***
31 * Initialize the application tool. The data parameter holds a different
32 * type depending on how the tool is being instantiated:
33 * <ul>
34 * <li>For global tools data will be null</li>
35 * <li>For request tools data will be of type RunData</li>
36 * <li>For session and authorized tools data will be of type User</li>
37 * </ul>
38 * <p>
39 * It is possible that session scope tools will be initialized with a null
40 * <code>User</code> object. This happens when the first request on a
41 * session happens to the be login action. The next request on the session
42 * will cause the session tool to be refreshed if
43 * <code>tools.per.request.refresh</code> is set to <code>true</code>
44 * in <code>TurbineResources.properties</code>. You will then be able to
45 * get a <code>User</code> object from the instance of
46 * <code>RunData</object>.
47 *
48 * @param data initialization data
49 */
50 void init(Object data);
51
52 /***
53 * Refresh the application tool. This is
54 * necessary for development work where you
55 * probably want the tool to refresh itself
56 * if it is using configuration information
57 * that is typically cached after initialization
58 *
59 * @param data The current RunData Object
60 */
61 void refresh(RunData data);
62 }