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: /**
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: * Initialize the application tool. The data parameter holds a different
31: * type depending on how the tool is being instantiated:
32: * <ul>
33: * <li>For global tools data will be null</li>
34: * <li>For request tools data will be of type RunData</li>
35: * <li>For session and authorized tools data will be of type User</li>
36: * </ul>
37: * <p>
38: * It is possible that session scope tools will be initialized with a null
39: * <code>User</code> object. This happens when the first request on a
40: * session happens to the be login action.
41: * <p>
42: * If your session tool depends on having a <code>User</code> object, you
43: * should look at implementing the {@link RunDataApplicationTool} interface
44: * instead.
45: *
46: * @param data initialization data
47: */
48: void init(Object data);
49:
50: /**
51: * Refresh the application tool. This is
52: * necessary for development work where you
53: * probably want the tool to refresh itself
54: * if it is using configuration information
55: * that is typically cached after initialization
56: */
57: void refresh();
58: }
|