public class PluginManager extends Object
An instance of this class can be obtained using:
XMPPServer.getInstance().getPluginManager()Plugin,
XMPPServer.getPluginManager()| Constructor and Description |
|---|
PluginManager(File pluginDir)
Constructs a new plugin manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPluginListener(PluginListener listener)
Registers a PluginListener, which will now start receiving events regarding plugin creation and destruction.
|
void |
addPluginManagerListener(PluginManagerListener listener)
Registers a PluginManagerListener, which will now start receiving events regarding plugin management.
|
void |
deletePlugin(String pluginName)
Delete a plugin, which removes the plugin.jar/war file after which the plugin is unloaded.
|
String |
getAuthor(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getAuthor(Plugin). |
String |
getDatabaseKey(Plugin plugin)
Deprecated.
|
int |
getDatabaseVersion(Plugin plugin)
Deprecated.
|
String |
getDescription(Plugin plugin)
Deprecated.
|
PluginDevEnvironment |
getDevEnvironment(Plugin plugin)
Returns a plugin's dev environment if development mode is enabled for
the plugin.
|
License |
getLicense(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getLicense(Plugin). |
String |
getMinServerVersion(Plugin plugin)
Deprecated.
|
String |
getName(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getName(Plugin). |
Plugin |
getPlugin(String name)
Returns a plugin by name or null if a plugin with that name does not
exist.
|
PluginClassLoader |
getPluginClassloader(Plugin plugin)
Returns the classloader of a plugin.
|
File |
getPluginDirectory(Plugin plugin)
Deprecated.
Use #getPluginPath() instead.
|
java.nio.file.Path |
getPluginPath(Plugin plugin)
Returns the plugin's directory.
|
Collection<Plugin> |
getPlugins()
Returns a Collection of all installed plugins.
|
java.nio.file.Path |
getPluginsDirectory()
Returns the directory that contains all plugins.
|
String |
getVersion(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getVersion(Plugin). |
boolean |
installPlugin(InputStream in,
String pluginFilename)
Installs or updates an existing plugin.
|
boolean |
isExecuted()
Returns true if at least one attempt to load plugins has been done.
|
boolean |
isMonitorTaskRunning() |
boolean |
isPluginDownloaded(String pluginFilename)
Returns true if the specified filename, that belongs to a plugin, exists.
|
Class |
loadClass(Plugin plugin,
String className)
Loads a class from the classloader of a plugin.
|
boolean |
reloadPlugin(String pluginName) |
void |
removePluginListener(PluginListener listener)
Deregisters a PluginListener, which will no longer receive events.
|
void |
removePluginManagerListener(PluginManagerListener listener)
Deregisters a PluginManagerListener, which will no longer receive events.
|
void |
shutdown()
Shuts down all running plugins.
|
void |
start()
Starts plugins and the plugin monitoring service.
|
public PluginManager(File pluginDir)
pluginDir - the directory containing all Openfire plugins, typically OPENFIRE_HOME/plugins/public void start()
public void shutdown()
public java.nio.file.Path getPluginsDirectory()
public boolean installPlugin(InputStream in, String pluginFilename)
in - the input stream that contains the new plugin definition.pluginFilename - the filename of the plugin to create or update.public boolean isPluginDownloaded(String pluginFilename)
pluginFilename - the filename of the plugin to create or update.public Collection<Plugin> getPlugins()
public Plugin getPlugin(String name)
name - the name of the plugin.@Deprecated public File getPluginDirectory(Plugin plugin)
public java.nio.file.Path getPluginPath(Plugin plugin)
plugin - the plugin.public boolean isExecuted()
public void deletePlugin(String pluginName)
public boolean reloadPlugin(String pluginName)
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.@Deprecated public String getName(Plugin plugin)
PluginMetadataHelper.getName(Plugin).@Deprecated public String getDescription(Plugin plugin)
PluginMetadataHelper.getDescription(Plugin).@Deprecated public String getAuthor(Plugin plugin)
PluginMetadataHelper.getAuthor(Plugin).@Deprecated public String getVersion(Plugin plugin)
PluginMetadataHelper.getVersion(Plugin).@Deprecated public String getMinServerVersion(Plugin plugin)
PluginMetadataHelper.getMinServerVersion(Plugin).@Deprecated public String getDatabaseKey(Plugin plugin)
PluginMetadataHelper.getDatabaseKey(Plugin).@Deprecated public int getDatabaseVersion(Plugin plugin)
PluginMetadataHelper.getDatabaseVersion(Plugin).@Deprecated public License getLicense(Plugin plugin)
PluginMetadataHelper.getLicense(Plugin).public PluginClassLoader getPluginClassloader(Plugin plugin)
plugin - the plugin.public void addPluginListener(PluginListener listener)
listener - the listener to be notified (cannot be null).public void removePluginListener(PluginListener listener)
listener - the listener to be removed (cannot be null).public void addPluginManagerListener(PluginManagerListener listener)
listener - the listener to be notified (cannot be null).public void removePluginManagerListener(PluginManagerListener listener)
listener - the listener to be notified (cannot be null).public boolean isMonitorTaskRunning()
Copyright © 2003-2008 Jive Software.