Poco::OSP::Web

class WebFilterExtensionPoint

File Information

Library: OSP/Web
Package: Web
Header: Poco/OSP/Web/WebFilterExtensionPoint.h

Description

WebServerExtension handles the "osp.web.server.filter" extensions point.

To register a Filter, for processing a resource before it's being sent as response:

<extension point="osp.web.server.filter"
           mediaType="media/type"
           class="MyFilterFactory"
           library="MyLib"/>

Note that the extension points are automatically removed if a bundle is stopped.

The following attributes can be specified for "osp.web.server.directory":

  • mediaType: The media type this filter applies to. Every resource having this media type will be passed to the filter.
  • class: the class name of the request handler factory.
  • library: the name of the shared library containing the request handler factory.

Any additional attributes are passed to the factory's createFilter() method.

Inheritance

Direct Base Classes: Poco::OSP::ExtensionPoint

All Base Classes: Poco::OSP::ExtensionPoint, Poco::RefCountedObject

Member Summary

Member Functions: handleExtension, handleFilter, onBundleStopped

Inherited Functions: duplicate, handleExtension, referenceCount, release, removeExtension

Constructors

WebFilterExtensionPoint

WebFilterExtensionPoint(
    BundleContext::Ptr pContext,
    WebServerDispatcher * pDispatcher
);

Creates the WebServerExtension. Expects a not null pointer to the Web which must be valid during the whole life-time of the extension object

Destructor

~WebFilterExtensionPoint virtual

~WebFilterExtensionPoint();

Destroys the WebServerExtension.

Member Functions

handleExtension virtual

void handleExtension(
    Bundle::ConstPtr pBundle,
    Poco::XML::Element * pExtensionElem
);

handleFilter protected

void handleFilter(
    Bundle::ConstPtr pBundle,
    Poco::XML::Element * pExtensionElem
);

onBundleStopped protected

void onBundleStopped(
    const void * pSender,
    BundleEvent & ev
);

When a bundle is stopped, all of its request handlers and mappings are automatically disabled.

Variables

EXTPOINT_FILTER static

static const std::string EXTPOINT_FILTER;

ATTR_CLASS protected static

static const std::string ATTR_CLASS;

ATTR_LIBRARY protected static

static const std::string ATTR_LIBRARY;

ATTR_MEDIATYPE protected static

static const std::string ATTR_MEDIATYPE;

MANIFEST_NAME protected static

static const std::string MANIFEST_NAME;