01: package org.apache.turbine.services.pull;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
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: * Initialize the application tool. The data parameter holds a different
34: * type depending on how the tool is being instantiated:
35: * <ul>
36: * <li>For global tools data will be null</li>
37: * <li>For request tools data will be of type RunData</li>
38: * <li>For session and authorized tools data will be of type User</li>
39: * </ul>
40: * <p>
41: * It is possible that session scope tools will be initialized with a null
42: * <code>User</code> object. This happens when the first request on a
43: * session happens to the be login action. The next request on the session
44: * will cause the session tool to be refreshed if
45: * <code>tools.per.request.refresh</code> is set to <code>true</code>
46: * in <code>TurbineResources.properties</code>. You will then be able to
47: * get a <code>User</code> object from the instance of
48: * <code>RunData</object>.
49: *
50: * @param data initialization data
51: */
52: void init(Object data);
53:
54: /**
55: * Refresh the application tool. This is
56: * necessary for development work where you
57: * probably want the tool to refresh itself
58: * if it is using configuration information
59: * that is typically cached after initialization
60: *
61: * @param data The current RunData Object
62: */
63: void refresh(RunData data);
64: }
|