View Javadoc

1   package org.apache.turbine.services.pull;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
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  /***
20   * Tools that go into the Toolbox should implement this interface.
21   *
22   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
23   * @version $Id: ApplicationTool.java 264148 2005-08-29 14:21:04Z henning $
24   */
25  public interface ApplicationTool
26  {
27      /***
28       * Initialize the application tool. The data parameter holds a different
29       * type depending on how the tool is being instantiated:
30       * <ul>
31       * <li>For global tools data will be null</li>
32       * <li>For request tools data will be of type RunData</li>
33       * <li>For session and authorized tools data will be of type User</li>
34       * </ul>
35       * <p>
36       * It is possible that session scope tools will be initialized with a null
37       * <code>User</code> object.  This happens when the first request on a
38       * session happens to the be login action.
39       * <p>
40       * If your session tool depends on having a <code>User</code> object, you
41       * should look at implementing the {@link RunDataApplicationTool} interface
42       * instead.
43       *
44       * @param data initialization data
45       */
46      void init(Object data);
47  
48      /***
49       * Refresh the application tool. This is
50       * necessary for development work where you
51       * probably want the tool to refresh itself
52       * if it is using configuration information
53       * that is typically cached after initialization
54       */
55      void refresh();
56  }