Poco::OSP

class ExtensionPoint

Library: OSP
Package: ExtensionPointService
Header: Poco/OSP/ExtensionPoint.h

Description

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.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Known Derived Classes: Poco::OSP::Web::WebServerExtensionPoint

Member Summary

Member Functions: handleExtension

Inherited Functions: duplicate, referenceCount, release

Types

ConstPtr

typedef const Ptr ConstPtr;

Ptr

typedef Poco::AutoPtr < ExtensionPoint > Ptr;

Constructors

ExtensionPoint protected

ExtensionPoint();

Creates the ExtensionPoint.

Destructor

~ExtensionPoint protected virtual

~ExtensionPoint();

Destroys the ExtensionPoint.

Member Functions

handleExtension virtual

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.