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