NAME
PXP::PluginRegistry - Registry of plugins for PXP
SYNOPSIS
use PXP::PluginRegistry;
PXP::init(dir => './plugins', default => 'all', load => [], noload => []);
...
my $plugin = PXP::PluginRegistry::getExtension(ref($self))->plugin();
my $extpt = PXP::PluginRegistry::getExtensionPoint('PXP::StaticResourcesHandler');
ABSTRACT
The PluginRegistry manages plugins, extension points and extensions.
DESCRIPTION
The PluginRegistry manages plugins, extension points and extensions.
- init
-
Initialize the plugin registry. Note: only one instance of PluginRegistry is supported (singleton pattern).
- getPlugin(id)
-
Return a plugin referenced by its id, or undef if no such plugin exists.
Warning : a plugin id can be different from its actual object class, as declared in plugin.xml
- loadPluginsFromDirectory(directory)
-
Load all plugins present in the directory.
This is usually called once by by PXP::init. Plugin developpers can call this function to load plugins installed outside of the system default directory ('plugins' at the root of the IMC home directory).
See below for details about the loading process.
- getExtensionNode()
-
Return the internal XML node describing the extension in the plugin.xml file.
This is mostly used by plugin developpers to get access to the XML config.
- getExtension(id)
-
Search the registry for an
Extension
and return it, based on its id.This returns the internal extension descriptor object, ie an PXP::Extension object, not the real extension See the code for details of the private API.
Loading process
First, the PluginRegistry calls loadPluginFromDirectory to load all the plugins installed in the system directory (usually called 'plugins' inside the IMC hierarchy). The loader calculate the dependencies so that plugin can resolve symbols.
For each plugin, its extension points are instantiated and registered into the global registry.
Then, extension _definitions_ are handed to the extension points to be registered. Extension points choose wether to instantiate a particular objet for each of their extensions.
Last, the PluginRegistry calls the 'startup' routine of each plugin that declared a specific class (class="" attribute inside the plugin.xml header).
An error during plugin load stops the process for a whole plugin dependency branch, but plugin startup is still called for plugins that have already been loaded.
SEE ALSO
See PXP::ExtensionPoint
, PXP::Extension
for details about the concepts
COPYRIGHT AND LICENSE
Copyright 2003-2004 by IDEALX
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 64:
'=item' outside of any '=over'