scone.util
Class PluginRepository

java.lang.Object
  extended by scone.util.PluginRepository

public class PluginRepository
extends java.lang.Object

a repository of Scone plugins. The plugins' states (enabled/disabled) are mirrored in a configuration file to make them persistent.


Constructor Summary
PluginRepository()
          creates a new repository.
 
Method Summary
 java.util.Enumeration getEntries()
          returns an enumeration of the entries.
 PluginRepositoryEntry getEntryByName(java.lang.String name)
          returns the entry for the named plugin.
 PluginRepositoryEntry getEntryByNumber(int pos)
          returns the entry at the given position
 int getRequirements()
          returns the requirements of the enabled registered plugins.
 PluginRepositoryEntry register(java.lang.String name)
          registers a new plugin.
 void store()
          stores the XML definition of the repository to the file.
 void terminate()
          terminates the plugins does not disable them
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginRepository

public PluginRepository()
creates a new repository. The repository definition is read from the file. For each plugin element, a PluginRepositoryEntry is created. This constructor also compiles the plugins' requirements.

Method Detail

terminate

public void terminate()
terminates the plugins does not disable them


getEntryByName

public PluginRepositoryEntry getEntryByName(java.lang.String name)
returns the entry for the named plugin.

Parameters:
name - the full classname of the plugin
Returns:
the entry for that plugin or null if not found

getEntryByNumber

public PluginRepositoryEntry getEntryByNumber(int pos)
returns the entry at the given position

Parameters:
pos - the position of the entry
Returns:
the entry

register

public PluginRepositoryEntry register(java.lang.String name)
registers a new plugin. If a plugin with the given name exists, a new entry for that plugin will be generated and added to the repository. There cannot be two plugins with the same name in the repository. A RuntimeException will be thrown in case this method is used to register a registered plugin. Please not that Scone should be restarted to ensure that the plugin's requirements are met.

Parameters:
name - the full classname of the plugin
Returns:
the entry for the plugin if successful

store

public void store()
stores the XML definition of the repository to the file.


getEntries

public java.util.Enumeration getEntries()
returns an enumeration of the entries.

Returns:
the entries

getRequirements

public int getRequirements()
returns the requirements of the enabled registered plugins.

Returns:
the requirements