public class PluginManager extends java.lang.Object implements MainWindowListener
Modifier and Type | Field and Description |
---|---|
static java.io.File |
PLUGINS_DIRECTORY
The root Plugins Directory.
|
Modifier and Type | Method and Description |
---|---|
void |
addPlugin(PublicPlugin plugin)
Adds and installs a new plugin into Spark.
|
void |
deleteOldPlugins(java.io.File pathtosearch)
Deletes Plugins in pathtosearch that have a different md5-hash than
its correspondant in install\spark\plugins\
|
static PluginManager |
getInstance()
Returns the singleton instance of
PluginManager ,
creating it if necessary. |
Plugin |
getPlugin(java.lang.Class<? extends Plugin> communicatorPlugin)
Returns the instance of the plugin class initialized during startup.
|
java.lang.ClassLoader |
getPluginClassLoader()
Returns the plugin classloader.
|
java.util.Collection<Plugin> |
getPlugins()
Returns a Collection of Plugins.
|
java.util.List<PublicPlugin> |
getPublicPlugins()
Returns a collection of all public plugins.
|
void |
initializePlugins()
Loads and initalizes all Plugins.
|
boolean |
isInstalled(PublicPlugin plugin)
Returns true if the specified plugin is installed.
|
void |
loadPlugins()
Loads all
Plugin from the agent plugins.xml and extension lib. |
void |
mainWindowActivated()
Invoked by the
MainWindow when it has been activated, such
as when it is coming out of a minimized state. |
void |
mainWindowDeactivated()
Invoked by the
MainWindow when it has been minimized in the toolbar. |
void |
registerPlugin(Plugin plugin)
Registers a plugin.
|
void |
removePlugin(Plugin plugin)
Removes a plugin from the plugin list.
|
void |
removePublicPlugin(PublicPlugin plugin)
Removes and uninstall a plugin from Spark.
|
void |
shutdown()
Invoked by the
MainWindow when it is about the shutdown. |
public static java.io.File PLUGINS_DIRECTORY
public static PluginManager getInstance()
PluginManager
,
creating it if necessary.
PluginManager
public void deleteOldPlugins(java.io.File pathtosearch)
pathtosearch
- public void loadPlugins()
Plugin
from the agent plugins.xml and extension lib.public java.lang.ClassLoader getPluginClassLoader()
public void registerPlugin(Plugin plugin)
plugin
- the plugin to register.public void removePlugin(Plugin plugin)
plugin
- the plugin to remove.public java.util.Collection<Plugin> getPlugins()
public Plugin getPlugin(java.lang.Class<? extends Plugin> communicatorPlugin)
communicatorPlugin
- the plugin to find.public void initializePlugins()
Plugin
public void shutdown()
MainWindowListener
MainWindow
when it is about the shutdown.
When invoked, the MainWindowListener
should do anything necessary to persist their current state.
MainWindowListeners
authors should take care to ensure
that any extraneous processing is not performed on this method, as it would
cause a delay in the shutdown process.shutdown
in interface MainWindowListener
MainWindow
public void mainWindowActivated()
MainWindowListener
MainWindow
when it has been activated, such
as when it is coming out of a minimized state.
When invoked, the MainWindowListener
should do anything necessary to smoothly transition back to the application.mainWindowActivated
in interface MainWindowListener
MainWindow
public void mainWindowDeactivated()
MainWindowListener
MainWindow
when it has been minimized in the toolbar.mainWindowDeactivated
in interface MainWindowListener
MainWindow
public void addPlugin(PublicPlugin plugin) throws java.lang.Exception
plugin
- the plugin to install.java.lang.Exception
- thrown if there was a problem loading the plugin.public java.util.List<PublicPlugin> getPublicPlugins()
public void removePublicPlugin(PublicPlugin plugin)
plugin
- the plugin to uninstall.public boolean isInstalled(PublicPlugin plugin)
plugin
- the PublicPlugin
plugin to check.