View Javadoc

1   package org.apache.turbine.services.pull;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "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      /***
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  }