KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > plugins > PluginManager


1 package org.objectweb.celtix.plugins;
2
3 import org.objectweb.celtix.configuration.Configuration;
4
5 /**
6  * Provides methods for registering, unregistering and obtaining plugin objects.
7  */

8 public interface PluginManager {
9
10     /**
11      * Get the plugin class loader.
12      * @return ClassLoader
13      */

14     ClassLoader JavaDoc getPluginClassLoader();
15     
16     /**
17      * Returns the <code>Configuration</code>.
18      * @return Configuration
19      */

20     Configuration getConfiguration();
21     
22     /**
23      * Returns the plugin object with the given name.
24      * @param name - the name of the plugin.
25      * @return Object - the plugin.
26      * @throws PluginException - if there is a circular dependency loading
27      * dependent objects of the plugin.
28      */

29     Object JavaDoc getPluginByName(String JavaDoc name) throws PluginException;
30     
31     /**
32      * Returns the plugin object with the given classname.
33      * @param className - the class name of the plugin.
34      * @return Object - the plugin.
35      * @throws PluginException - if there is a circular dependency loading
36      * dependent objects of the plugin.
37      */

38     Object JavaDoc getPlugin(String JavaDoc className) throws PluginException;
39     
40     /**
41      * Registers a plugin object with the bus.
42      * @param plugin - the plugin to register.
43      * @throws PluginException if the given plugin is already registered.
44      */

45     void registerPlugin(Object JavaDoc plugin) throws PluginException;
46     
47     /**
48      * Explicitly unregister the given plugin object from the bus.
49      * A plugin must be unregistered before it can be unloaded.
50      * @param plugin - the plugin to unregister.
51      * @throws PluginException if the given plugin is not registered.
52      */

53     void unregisterPlugin(Object JavaDoc plugin) throws PluginException;
54     
55     /**
56      * Unload a plugin object after it has been explicitly unregistered.
57      * @param plugin - the plugin to unload.
58      * @throws PluginException if the given plugin is still registered.
59      */

60     void unloadPlugin(Object JavaDoc plugin) throws PluginException;
61 }
62
Popular Tags