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  /***
23   * Tools that go into the Toolbox should implement this interface.
24   *
25   * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
26   * @version $Id: ApplicationTool.java 534527 2007-05-02 16:10:59Z tv $
27   */
28  public interface ApplicationTool
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.
42       * <p>
43       * If your session tool depends on having a <code>User</code> object, you
44       * should look at implementing the {@link RunDataApplicationTool} interface
45       * instead.
46       *
47       * @param data initialization data
48       */
49      void init(Object data);
50  
51      /***
52       * Refresh the application tool. This is
53       * necessary for development work where you
54       * probably want the tool to refresh itself
55       * if it is using configuration information
56       * that is typically cached after initialization
57       */
58      void refresh();
59  }