| java.lang.Object net.sourceforge.cruisecontrol.PluginRegistry
PluginRegistry | final public class PluginRegistry implements Serializable(Code) | | Handles "registering" plugins that will be used by the CruiseControl
configuration file.
A PluginRegistry can have a parent registry, which it will query for
a plugin if it's not defined in the registry itself. This is used to
enable projects to have their own plugins and override the classname
for a specific plugin, like the labelincrementer.
The root-registry contains the default list of plugins, i.e. those
that are already registered like AntBuilder that don't have to be registered
separately in the configuration file.
The registry keeps track of the
PluginRegistry.getPluginConfig(String) plugin configurations in order to allow full plugin preconfigurations (default properties + nested elements).
See Also: PluginXMLHelper |
Method Summary | |
public static PluginRegistry | createRegistry() | public static PluginRegistry | createRegistry(PluginRegistry parent) | public Class | getPluginClass(String pluginName) Returns null if no plugin has been registered with the specifiedname, otherwise the Class representing the plugin class. | public String | getPluginClassname(String pluginName) Returns null if no plugin has been registered with the specifiedname, otherwise a String representing the fully qualified classnamefor the plugin class. | public Element | getPluginConfig(String pluginName) | public PluginDetail[] | getPluginDetails() | public String | getPluginName(Class pluginClass) | public PluginType[] | getPluginTypes() | public Class | instanciatePluginClass(String pluginClassname, String pluginName) | public boolean | isPluginRegistered(String pluginName) True if this registry or its parent containsan entry for the plugin specified by the name.The name is the short name for the plugin, notthe classname, e.g. | static PluginRegistry | loadDefaultPluginRegistry() Returns a PluginRegistry containing all the default plugins.
The key is the plugin name (e.g. | public void | register(String pluginName, String pluginClassname) Parameters: pluginName - The name for the plugin, e.g. | public void | register(PluginPlugin plugin) | public void | register(Element pluginElement) Registers the given plugin, including plugin configuration. | static void | registerToRoot(Element pluginElement) Registers the given plugin in the root registry, so it will be
available to all projects. | static void | resetRootRegistry() Clears all plugin registrations and defaults in the root registry, so they can be re-registered
when reloading the config file. |
createRegistry | public static PluginRegistry createRegistry()(Code) | | PluginRegistry with the ROOTREGISTRY as its parent. |
getPluginClass | public Class getPluginClass(String pluginName) throws CruiseControlException(Code) | | Returns null if no plugin has been registered with the specifiedname, otherwise the Class representing the plugin class. Note thatplugin names are always treated as case insensitive, so Ant, ant,and AnT are all treated as the same plugin. throws: CruiseControlException - If the class provided cannot be loaded. |
getPluginClassname | public String getPluginClassname(String pluginName)(Code) | | Returns null if no plugin has been registered with the specifiedname, otherwise a String representing the fully qualified classnamefor the plugin class. Note that pluginnames are always treated as case insensitive, so Ant, ant, and AnT areall treated as the same plugin.Note: a parent name->class mapping can be overridden by children registries. |
getPluginConfig | public Element getPluginConfig(String pluginName)(Code) | | Get the plugin configuration particular to this plugin, merged with the parents
throws: NullPointerException - if pluginName is null |
isPluginRegistered | public boolean isPluginRegistered(String pluginName)(Code) | | True if this registry or its parent containsan entry for the plugin specified by the name.The name is the short name for the plugin, notthe classname, e.g. ant. Note that pluginnames are always treated as case insensitive, so Ant, ant, and AnT areall treated as the same plugin. throws: NullPointerException - If a null pluginName is passed, thena NullPointerException will occur. It's recommended to not pass anull pluginName. |
loadDefaultPluginRegistry | static PluginRegistry loadDefaultPluginRegistry()(Code) | | Returns a PluginRegistry containing all the default plugins.
The key is the plugin name (e.g. ant) and the value is
the fully qualified classname
(e.g. net.sourceforge.cruisecontrol.builders.AntBuilder).
throws: RuntimeException - in case of IOException during the reading of the properties-file |
register | public void register(String pluginName, String pluginClassname)(Code) | | Parameters: pluginName - The name for the plugin, e.g. ant. Note that pluginnames are always treated as case insensitive, so Ant, ant, and AnT areall treated as the same plugin. Parameters: pluginClassname - The fully qualified classname for theplugin class, e.g. net.sourceforge.cruisecontrol.builders.AntBuilder. |
registerToRoot | static void registerToRoot(Element pluginElement) throws CruiseControlException(Code) | | Registers the given plugin in the root registry, so it will be
available to all projects.
|
resetRootRegistry | static void resetRootRegistry()(Code) | | Clears all plugin registrations and defaults in the root registry, so they can be re-registered
when reloading the config file. The default-properties are re-read.
|
|
|