KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > spec > IExtensionSpecification


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.spec;
16
17 import java.util.Map JavaDoc;
18
19 import org.apache.hivemind.LocationHolder;
20 import org.apache.tapestry.util.IPropertyHolder;
21
22 /**
23  * Defines an "extension", which is much like a helper bean, but is part of a library or application
24  * specification (and has the same lifecycle as the application).
25  *
26  * @author glongman@intelligentworks.com
27  */

28 public interface IExtensionSpecification extends IPropertyHolder, LocationHolder
29 {
30     public abstract String JavaDoc getClassName();
31
32     public abstract void setClassName(String JavaDoc className);
33
34     public abstract void addConfiguration(String JavaDoc propertyName, String JavaDoc value);
35
36     /**
37      * Returns an immutable Map of the configuration; keyed on property name, with values as
38      * properties to assign.
39      */

40     public abstract Map JavaDoc getConfiguration();
41
42     /**
43      * Invoked to instantiate an instance of the extension and return it. It also configures
44      * properties of the extension.
45      */

46     public abstract Object JavaDoc instantiateExtension();
47
48     /**
49      * Returns true if the extensions should be instantiated immediately after the containing
50      * {@link org.apache.tapestry.spec.LibrarySpecification}if parsed. Non-immediate extensions are
51      * instantiated only as needed.
52      */

53     public abstract boolean isImmediate();
54
55     public abstract void setImmediate(boolean immediate);
56 }
Popular Tags