KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > api > plugin > IExtensionHandler


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columba.api.plugin;
19
20 import java.io.InputStream JavaDoc;
21 import java.util.Enumeration JavaDoc;
22
23 /**
24  * Extension handler is a registry for extensions and resembles a hook
25  * to extend Columba's functionality.
26  *
27  * @author fdietz
28  *
29  */

30 public interface IExtensionHandler {
31
32     /**
33      * Add new extension to handler.
34      *
35      * @param id extension id, unique for this extension handler
36      *
37      * @param extension extension
38      */

39     public void addExtension(String JavaDoc id, IExtension extension);
40     
41     
42     /**
43      * Add many extensions at once using a xml file.
44      *
45      * @param is xml file path
46      */

47     public void loadExtensionsFromStream(InputStream JavaDoc is);
48     
49     /**
50      * Add many extensions at once using a xml file. In this case
51      * these are all extensions which can only be loaded using
52      * the plugin classloader.
53      *
54      * @param is xml file path
55      */

56     public void loadExternalExtensionsFromStream(PluginMetadata pluginMetadata, InputStream JavaDoc is);
57     
58     /**
59      * Check if extension exists.
60      *
61      * @param id extension id
62      * @return true, if extension exists. False, otherwise.
63      */

64     public boolean exists(String JavaDoc id);
65     
66     
67     /**
68      * Get extension.
69      *
70      * @param id extension id
71      * @return extension
72      */

73     public IExtension getExtension(String JavaDoc id);
74     
75     /**
76      * Retrieve enumeration of all extensions.
77      *
78      * @return enumeration of IExtension
79      */

80     public Enumeration JavaDoc<IExtension> getExtensionEnumeration();
81     
82     /**
83      * Retrieve enumeration of all external extensions.
84      *
85      * @return enumeration of IExtension
86      */

87     public Enumeration JavaDoc getExternalExtensionsEnumeration();
88     
89     /**
90      * Retrieve array of all extension ids.
91      *
92      * @return String array of ids
93      */

94     public String JavaDoc[] getPluginIdList();
95     
96     /**
97      * Get id of this extension handler.
98      *
99      * @return extension handler id
100      */

101     public String JavaDoc getId();
102 }
103
Popular Tags