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 Details

  • Constructor Details

    • DefaultPluginManager

      public DefaultPluginManager​(Preferences prefs)
      Constructs a new PluginManger instance.
      Parameters:
      prefs - the preferences, which contain information about what to load during the instanciation of the plugin manager.
  • Method Details

    • isInstalled

      public boolean isInstalled​(String name)
      Checks if the plugin is already installed, i.e. if the plugin's name is in the list of plugin entries.
      Specified by:
      isInstalled in interface PluginManager
      Parameters:
      name - name of the plugin.
      Returns:
      true if the plugin's name is in the list of plugin entries, false otherwise.
    • setLoadOnStartup

      public void setLoadOnStartup​(String name, Boolean loadOnStartup)
      Sets the loadOnStartup flag of the given object, to the given value.
      Specified by:
      setLoadOnStartup in interface PluginManager
      Parameters:
      name - the name of the plugin.
      loadOnStartup - true, if the plugin should be loaded at startup.
    • getPluginEntries

      public Collection<PluginEntry> getPluginEntries()
      Returns the corrent list of plugin entries.
      Specified by:
      getPluginEntries in interface PluginManager
      Returns:
      a Collection containing all the plugin entries.
    • getPluginInstance

      public GenericPlugin getPluginInstance​(String name)
      Returns the plugin instance of the given plugin name.
      Specified by:
      getPluginInstance in interface PluginManager
      Parameters:
      name - the name of the plugin.
      Returns:
      the instance of the plugin of the given name.
    • addPluginManagerListener

      public void addPluginManagerListener​(PluginManagerListener listener)
      Adds the given plugin manager listener to the list of listeners.
      Specified by:
      addPluginManagerListener in interface PluginManager
      Parameters:
      listener - the new listener to add to the list.
    • createInstance

      public GenericPlugin createInstance​(URL pluginLocation) throws PluginManagerException
      Returns a new instance of the plugin "main" class with the given plugin name.
      Specified by:
      createInstance in interface PluginManager
      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 PluginManagerException
      Returns 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 PluginManagerException
      Loads the plugin from the given location.
      Specified by:
      loadPlugin in interface PluginManager
      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

      public void loadPlugins​(PluginEntry[] plugins) throws PluginManagerException
      Loads the plugin from the given location.
      Specified by:
      loadPlugins in interface PluginManager
      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 PluginManagerException
      Loads the plugin from the given location.The progress made is displayed with progressViewer.
      Parameters:
      plugins - the plugin entries describing the plugins to be loaded
      progressViewer - the progress viewer that display the progress made
      Throws:
      PluginManagerException - if an error occurs while loading or instantiating the plugin.
    • loadStartupPlugins

      public void loadStartupPlugins() throws PluginManagerException
      Loads the plugins which should be loaded on startup.
      Specified by:
      loadStartupPlugins in interface PluginManager
      Throws:
      PluginManagerException - if an error occurred while loading one of the plugins.
    • loadStartupPlugins

      @Deprecated public void loadStartupPlugins​(ProgressViewer progressViewer) throws PluginManagerException
      Deprecated.
      Loads the plugins which should be loaded on startup. The progress made is displayed with progressViewer.
      Specified by:
      loadStartupPlugins in interface PluginManager
      Parameters:
      progressViewer - the progress viewer that display the progress made
      Throws:
      PluginManagerException - if an error occurred while loading one of the plugins.
    • removePluginManagerListener

      public void removePluginManagerListener​(PluginManagerListener listener)
      Removes the given plugin manager listener from the list of listeners.
      Specified by:
      removePluginManagerListener in interface PluginManager
      Parameters:
      listener - the listener to remove from the list of listeners.
    • savePrefs

      public void savePrefs() throws PluginManagerException
      Saves the plugin manager's prefs.
      Specified by:
      savePrefs in interface PluginManager
      Throws:
      PluginManagerException - if an error occurs while saving the preferences.
    • getPluginFeeds

      public Collection<RSSfeedDefinition> getPluginFeeds()
      Specified by:
      getPluginFeeds in interface PluginManager