Library: OSP
Package: ExtensionPointService
Header: Poco/OSP/ExtensionPoint.h
An extension point allows a bundle to provide "hooks" that other bundles can hook into to extend a bundle's functionality.
A bundle registers one or more instances of subclasses of ExtensionPoint with the ExtensionPointService. The ExtensionPointService then looks for an "extensions.xml" file in every bundle that is started and calls the handleExtension() member function for every extension element targetted at the extension point.
When a bundle defining an extension is stopped, the ExtensionPoint's removeExtension() member function is invoked.
Direct Base Classes: Poco::RefCountedObject
All Base Classes: Poco::RefCountedObject
Known Derived Classes: Poco::OSP::Web::WebServerExtensionPoint
Member Functions: handleExtension, removeExtension
Inherited Functions: duplicate, referenceCount, release
typedef Poco::AutoPtr < ExtensionPoint > Ptr;
Creates the ExtensionPoint.
~ExtensionPoint();
Destroys the ExtensionPoint.
virtual void handleExtension(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
) = 0;
Handles the "extension" element in a bundle's "extensions.xml" configuration file. Must be overridden by subclasses.
The ExtensionPoint facility entirely leaves it to the ExtensionPoint subclass to define the content (child elements and attributes) of the extension element. The only required attribute on the "extension" element is the "point" attribute identifying the extension point (and thus the ExtensionPoint object handling the "extension" element.
virtual void removeExtension(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
Removes an extension from the extension point.
Usually this includes reverting actions, performed in handleExtension().
To keep compatibility with existing extension points, this member function is not pure virtual.