Package org.graffiti.managers.pluginmgr
Class DefaultPluginManager
java.lang.Object
org.graffiti.managers.pluginmgr.DefaultPluginManager
- All Implemented Interfaces:
PluginManager
public class DefaultPluginManager extends Object implements PluginManager
Manages the list of plugins.
- Version:
- $Revision: 1.31 $
-
Field Summary
Fields Modifier and Type Field Description static DefaultPluginManagerlastInstance -
Constructor Summary
Constructors Constructor Description DefaultPluginManager(Preferences prefs)Constructs a newPluginMangerinstance. -
Method Summary
Modifier and Type Method Description voidaddPluginManagerListener(PluginManagerListener listener)Adds the given plugin manager listener to the list of listeners.GenericPlugincreateInstance(URL pluginLocation)Returns a new instance of the plugin "main" class with the given plugin name.GenericPlugincreateInstance(URL pluginLocation, ProgressViewer progressViewer)Returns a new instance of the plugin "main" class with the given plugin name.Collection<PluginEntry>getPluginEntries()Returns the corrent list of plugin entries.Collection<RSSfeedDefinition>getPluginFeeds()GenericPlugingetPluginInstance(String name)Returns the plugin instance of the given plugin name.booleanisInstalled(String name)Checks if the plugin is already installed, i.e.voidloadPlugin(PluginDescription description, URL pluginLocation, Boolean loadOnStartup)Loads the plugin from the given location.voidloadPlugins(PluginEntry[] plugins)Loads the plugin from the given location.voidloadPlugins(PluginEntry[] plugins, ProgressViewer progressViewer)voidloadPlugins(PluginEntry[] plugins, ProgressViewer progressViewer, boolean doAutomatic)Loads the plugin from the given location.The progress made is displayed with progressViewer.voidloadStartupPlugins()Loads the plugins which should be loaded on startup.voidloadStartupPlugins(ProgressViewer progressViewer)Deprecated.voidremovePluginManagerListener(PluginManagerListener listener)Removes the given plugin manager listener from the list of listeners.voidsavePrefs()Saves the plugin manager's prefs.voidsetLoadOnStartup(String name, Boolean loadOnStartup)Sets theloadOnStartupflag of the given object, to the given value.
-
Field Details
-
lastInstance
-
-
Constructor Details
-
DefaultPluginManager
Constructs a newPluginMangerinstance.- Parameters:
prefs- the preferences, which contain information about what to load during the instanciation of the plugin manager.
-
-
Method Details
-
isInstalled
Checks if the plugin is already installed, i.e. if the plugin's name is in the list of plugin entries.- Specified by:
isInstalledin interfacePluginManager- Parameters:
name- name of the plugin.- Returns:
trueif the plugin's name is in the list of plugin entries,falseotherwise.
-
setLoadOnStartup
Sets theloadOnStartupflag of the given object, to the given value.- Specified by:
setLoadOnStartupin interfacePluginManager- Parameters:
name- the name of the plugin.loadOnStartup-true, if the plugin should be loaded at startup.
-
getPluginEntries
Returns the corrent list of plugin entries.- Specified by:
getPluginEntriesin interfacePluginManager- Returns:
- a
Collectioncontaining all the plugin entries.
-
getPluginInstance
Returns the plugin instance of the given plugin name.- Specified by:
getPluginInstancein interfacePluginManager- Parameters:
name- the name of the plugin.- Returns:
- the instance of the plugin of the given name.
-
addPluginManagerListener
Adds the given plugin manager listener to the list of listeners.- Specified by:
addPluginManagerListenerin interfacePluginManager- Parameters:
listener- the new listener to add to the list.
-
createInstance
Returns a new instance of the plugin "main" class with the given plugin name.- Specified by:
createInstancein interfacePluginManager- Parameters:
pluginLocation- the URL to the plugin.- Returns:
- the instantiated plugin.
- Throws:
PluginManagerException- an error occured while loading or instantiating the plugin.
-
createInstance
public GenericPlugin createInstance(URL pluginLocation, ProgressViewer progressViewer) throws PluginManagerExceptionReturns a new instance of the plugin "main" class with the given plugin name. The progress made is displayed with progressViewer.- Parameters:
pluginLocation- the URL to the plugin.progressViewer- the progress viewer that display the progress made- Returns:
- the instantiated plugin.
- Throws:
PluginManagerException- an error occured while loading or instantiating the plugin.
-
loadPlugin
public void loadPlugin(PluginDescription description, URL pluginLocation, Boolean loadOnStartup) throws PluginManagerExceptionLoads the plugin from the given location.- Specified by:
loadPluginin interfacePluginManager- Parameters:
description- DOCUMENT ME!pluginLocation- the location of the plugin.loadOnStartup-true, if the given plugin should be loaded at the startup.- Throws:
PluginManagerException- if an error occurs while loading or instantiating the plugin.
-
loadPlugins
Loads the plugin from the given location.- Specified by:
loadPluginsin interfacePluginManager- Parameters:
plugins- the plugin entries describing the plugins to be loaded- Throws:
PluginManagerException- if an error occurs while loading or instantiating the plugin.
-
loadPlugins
public void loadPlugins(PluginEntry[] plugins, ProgressViewer progressViewer) throws PluginManagerException- Throws:
PluginManagerException
-
loadPlugins
public void loadPlugins(PluginEntry[] plugins, ProgressViewer progressViewer, boolean doAutomatic) throws PluginManagerExceptionLoads the plugin from the given location.The progress made is displayed with progressViewer.- Parameters:
plugins- the plugin entries describing the plugins to be loadedprogressViewer- the progress viewer that display the progress made- Throws:
PluginManagerException- if an error occurs while loading or instantiating the plugin.
-
loadStartupPlugins
Loads the plugins which should be loaded on startup.- Specified by:
loadStartupPluginsin interfacePluginManager- Throws:
PluginManagerException- if an error occurred while loading one of the plugins.
-
loadStartupPlugins
@Deprecated public void loadStartupPlugins(ProgressViewer progressViewer) throws PluginManagerExceptionDeprecated.Loads the plugins which should be loaded on startup. The progress made is displayed with progressViewer.- Specified by:
loadStartupPluginsin interfacePluginManager- Parameters:
progressViewer- the progress viewer that display the progress made- Throws:
PluginManagerException- if an error occurred while loading one of the plugins.
-
removePluginManagerListener
Removes the given plugin manager listener from the list of listeners.- Specified by:
removePluginManagerListenerin interfacePluginManager- Parameters:
listener- the listener to remove from the list of listeners.
-
savePrefs
Saves the plugin manager's prefs.- Specified by:
savePrefsin interfacePluginManager- Throws:
PluginManagerException- if an error occurs while saving the preferences.
-
getPluginFeeds
- Specified by:
getPluginFeedsin interfacePluginManager
-