public class PluginManager extends Object
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 |
getCanonicalName(Plugin plugin)
Returns the canonical name for a loaded 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.
|
String |
getLicense(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getLicense(Plugin) . |
PluginMetadata |
getMetadata(String canonicalName)
Returns metadata for an extracted plugin, or null when the plugin is extracted nor loaded.
|
Map<String,PluginMetadata> |
getMetadataExtractedPlugins()
Returns metadata for all extracted plugins, mapped by their canonical name.
|
String |
getMinServerVersion(Plugin plugin)
Deprecated.
|
String |
getName(Plugin plugin)
Deprecated.
Moved to
PluginMetadataHelper.getName(Plugin) . |
Plugin |
getPlugin(String canonicalName)
Returns an loaded plugin by its canonical 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.
|
Path |
getPluginPath(Plugin plugin)
Returns the plugin's directory.
|
Collection<Plugin> |
getPlugins()
Returns a Collection of all loaded plugins.
|
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 |
isExtracted(String canonicalName)
Returns true if the plugin by the specified name is extracted.
|
boolean |
isInstalled(String canonicalName)
Returns true if the plugin by the specified name is installed.
|
boolean |
isLoaded(String canonicalName)
Returns true if the plugin by the specified name is loaded.
|
boolean |
isMonitorTaskRunning() |
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 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 isInstalled(String canonicalName)
canonicalName
- the canonical filename of the plugin (cannot be null).public boolean isExtracted(String canonicalName)
canonicalName
- the canonical filename of the plugin (cannot be null).public boolean isLoaded(String canonicalName)
canonicalName
- the canonical filename of the plugin (cannot be null).public Map<String,PluginMetadata> getMetadataExtractedPlugins()
public PluginMetadata getMetadata(String canonicalName)
public Collection<Plugin> getPlugins()
public String getCanonicalName(Plugin plugin)
plugin
- A plugin (cannot be null).public Plugin getPlugin(String canonicalName)
canonicalName
- the name of the plugin.@Deprecated public File getPluginDirectory(Plugin plugin)
public 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
plugin
- the plugin.className
- the name of the class to load.ClassNotFoundException
- if the class was not found.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 String 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–2019 Ignite Realtime. All rights reserved.