|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.messenger.container.PluginManager
public class PluginManager
Loads and manages plugins. The plugins directory is monitored for any new plugins, and they are dynamically loaded.
An instance of this class can be obtained using: XMPPServer.getInstance().getPluginManager()
Plugin
,
XMPPServer.getPluginManager()
Constructor Summary | |
---|---|
PluginManager(File pluginDir)
Constructs a new plugin manager. |
Method Summary | |
---|---|
String |
getAuthor(Plugin plugin)
Returns the author of a plugin. |
String |
getDescription(Plugin plugin)
Returns the description of a plugin. |
PluginDevEnvironment |
getDevEnvironment(Plugin plugin)
Returns a plugin's dev environment if development mode is enabled for the plugin. |
String |
getName(Plugin plugin)
Returns the name of a plugin. |
Plugin |
getPlugin(String name)
Returns a plugin by name or null if a plugin with that name does not exist. |
File |
getPluginDirectory(Plugin plugin)
Returns the plugin's directory. |
Collection<Plugin> |
getPlugins()
Returns a Collection of all installed plugins. |
String |
getVersion(Plugin plugin)
Returns the version of a plugin. |
Class |
loadClass(Plugin plugin,
String className)
Loads a class from the classloader of a plugin. |
void |
shutdown()
Shuts down all running plugins. |
void |
start()
Starts plugins and the plugin monitoring service. |
void |
unloadPlugin(String pluginName)
Unloads a plugin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginManager(File pluginDir)
pluginDir
- the plugin directory.Method Detail |
---|
public void start()
public void shutdown()
public Collection<Plugin> getPlugins()
public Plugin getPlugin(String name)
name
- the name of the plugin.
public File getPluginDirectory(Plugin plugin)
plugin
- the plugin.
public void unloadPlugin(String pluginName)
Plugin.destroyPlugin()
method will be called and then
any resources will be released. The name should be the name of the plugin directory
and not the name as given by the plugin meta-data. This method only removes
the plugin but does not delete the plugin JAR file. Therefore, if the plugin JAR
still exists after this method is called, the plugin will be started again the next
time the plugin monitor process runs. This is useful for "restarting" plugins.This method is called automatically when a plugin's JAR file is deleted.
pluginName
- the name of the plugin to unload.public Class loadClass(Plugin plugin, String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException
plugin
- the plugin.className
- the name of the class to load.
ClassNotFoundException
- if the class was not found.
IllegalAccessException
- if not allowed to access the class.
InstantiationException
- if the class could not be created.public PluginDevEnvironment getDevEnvironment(Plugin plugin)
plugin
- the plugin.
public String getName(Plugin plugin)
plugin
- the plugin.
public String getDescription(Plugin plugin)
plugin
- the plugin.
public String getAuthor(Plugin plugin)
plugin
- the plugin.
public String getVersion(Plugin plugin)
plugin
- the plugin.
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |