|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.plugin.PluginManager
public class PluginManager
Loads and manages plugins. The plugins directory is monitored for any new plugins, and they are dynamically loaded.
Plugin
Nested Class Summary | |
---|---|
static class |
PluginManager.License
An enumberation for plugin license agreement types. |
Constructor Summary | |
---|---|
PluginManager(java.io.File pluginDir)
Constructs a new plugin manager. |
Method Summary | |
---|---|
void |
addActionMapping(java.lang.String namespace,
java.lang.String action,
Plugin plugin)
Used to map a namespace and action to a plugin. |
void |
addPluginListener(PluginListener listener)
Registers a plugin listener. |
void |
deletePlugin(Plugin plugin)
Removes a plugin from the system. |
void |
destroy()
Shuts down all running plugins. |
java.lang.String |
getAuthor(Plugin plugin)
Returns the author of a plugin. |
java.lang.String |
getDatabaseKey(Plugin plugin)
Returns the database schema key of a plugin, if it exists. |
int |
getDatabaseVersion(Plugin plugin)
Returns the database schema version of a plugin, if it exists. |
java.lang.String |
getDescription(Plugin plugin)
Returns the description of a plugin. |
protected java.util.Set |
getDevPlugins()
Returns a set of all the plugins that have been specified with -DpluginDirs system property |
PluginManager.License |
getLicense(Plugin plugin)
Returns the license agreement type that the plugin is governed by. |
java.lang.String |
getMinServerVersion(Plugin plugin)
Returns the minimum server version this plugin can run within. |
java.lang.String |
getName(Plugin plugin)
Returns the name of a plugin. |
Plugin |
getPlugin(java.lang.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. |
protected java.io.File |
getPluginDirectory()
Returns the directory {jiveHome}/plugins. |
java.io.File |
getPluginDirectory(Plugin plugin)
Returns the plugin's directory. |
Plugin |
getPluginForAction(java.lang.String namepace,
java.lang.String action)
Returns what plugin (if any) is mapped to a specific namespace and action. |
protected java.util.Map |
getPluginMap()
Returns a map of plugin name plugin entries. |
protected com.jivesoftware.base.plugin.PluginMonitor |
getPluginMonitor()
Returns the PluginMonitor instance. |
java.util.Collection |
getPlugins()
Returns a Collection of all installed plugins. |
java.lang.String |
getVersion(Plugin plugin)
Returns the version of a plugin. |
void |
initialize()
Starts plugins and the plugin monitoring service. |
boolean |
installPlugin(java.io.InputStream in,
java.lang.String pluginFilename)
Installs or updates an existing plugin. |
boolean |
isPluginDownloaded(java.lang.String pluginFilename)
Returns true if the specified filename, that belongs to a plugin, exists. |
java.lang.Class |
loadClass(Plugin plugin,
java.lang.String className)
Loads a class from the classloader of a plugin. |
protected void |
loadPlugin(java.io.File pluginDir)
Loads a plug-in module into the container. |
void |
removePluginListener(PluginListener listener)
Unregisters a plugin listener. |
void |
restartPlugin(Plugin plugin)
Restarts the specified plugin. |
void |
unloadPlugin(java.lang.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(java.io.File pluginDir)
pluginDir
- the plugin directory.Method Detail |
---|
public void initialize()
initialize
in interface JiveManager
public void destroy()
destroy
in interface JiveManager
public boolean installPlugin(java.io.InputStream in, java.lang.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(java.lang.String pluginFilename)
pluginFilename
- the filename of the plugin to create or update.
public java.util.Collection getPlugins()
public Plugin getPlugin(java.lang.String name)
name
- the name of the plugin.
public java.io.File getPluginDirectory(Plugin plugin)
plugin
- the plugin.
protected void loadPlugin(java.io.File pluginDir)
pluginDir
- the plugin directory.public void unloadPlugin(java.lang.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 java.lang.Class loadClass(Plugin plugin, java.lang.String className) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
plugin
- the plugin.className
- the name of the class to load.
java.lang.ClassNotFoundException
- if the class was not found.
java.lang.IllegalAccessException
- if not allowed to access the class.
java.lang.InstantiationException
- if the class could not be created.public java.lang.String getName(Plugin plugin)
plugin
- the plugin.
public java.lang.String getDescription(Plugin plugin)
plugin
- the plugin.
public java.lang.String getAuthor(Plugin plugin)
plugin
- the plugin.
public java.lang.String getVersion(Plugin plugin)
plugin
- the plugin.
public java.lang.String getMinServerVersion(Plugin plugin)
plugin
- the plugin.
public java.lang.String getDatabaseKey(Plugin plugin)
plugin
- the plugin.
public int getDatabaseVersion(Plugin plugin)
plugin
- the plugin.
public PluginManager.License getLicense(Plugin plugin)
PluginManager.License.other
is returned.
plugin
- the plugin.
public PluginClassLoader getPluginClassloader(Plugin plugin)
plugin
- the plugin.
public void addPluginListener(PluginListener listener)
listener
- The plugin to register.PluginListener
public void removePluginListener(PluginListener listener)
listener
- the plugin to remove as a listener.public void addActionMapping(java.lang.String namespace, java.lang.String action, Plugin plugin)
namespace
- The namespace of the action to map the plugin too.action
- The action to map the plugin too.plugin
- The plugin to map to this namespace, action.public Plugin getPluginForAction(java.lang.String namepace, java.lang.String action)
namepace
- The namespace to acquire a plugin for.action
- The action to acquire a plugin for.
public void deletePlugin(Plugin plugin)
plugin
- The plugin too delete.public void restartPlugin(Plugin plugin)
plugin
- the specified plugin.protected java.util.Set getDevPlugins()
protected java.util.Map getPluginMap()
protected java.io.File getPluginDirectory()
protected com.jivesoftware.base.plugin.PluginMonitor getPluginMonitor()
PluginMonitor
instance.
PluginMonitor
instance.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |