Library: OSP/Web
Package: Web
Header: Poco/OSP/Web/WebServerExtensionPoint.h
WebServerExtension handles two extensions points. To register a directory in the Webserver:
<extension point="osp.web.server.directory" path="URI" resource="dir inside bundle" allowSpecialization="none|owner|all" index="index.html"/>
To register a RequestHandlerFactory for a given server uri/set of uris:
<extension point="osp.web.server.requesthandler" path="URI" class="MyRequestHandlerFactory" library="MyLib"/>
Note that the extension points are automatically removed if a bundle is stopped.
The following attributes can be specified for both extension points:
The following attributes can be specified for "osp.web.server.directory":
The following attributes can be specified for "osp.web.server.requesthandler":
Direct Base Classes: Poco::OSP::ExtensionPoint
All Base Classes: Poco::OSP::ExtensionPoint, Poco::RefCountedObject
Member Functions: handleCommon, handleDirectory, handleExtension, handleRequestHandler, onBundleStopped
Inherited Functions: duplicate, handleExtension, referenceCount, release, removeExtension
WebServerExtensionPoint(
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
Destroys the WebServerExtension.
void handleExtension(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
void handleCommon(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem,
WebServerDispatcher::VirtualPath & vPath
);
void handleDirectory(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
void handleRequestHandler(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
void onBundleStopped(
const void * pSender,
BundleEvent & ev
);
When a bundle is stopped, all of its request handlers and mappings are automatically disabled.
static const std::string EXTPOINT_DIRECTORY;
static const std::string EXTPOINT_HANDLER;
static const std::string ATTR_ALLOWSPECIALIZATION;
static const std::string ATTR_CLASS;
static const std::string ATTR_DESCRIPTION;
static const std::string ATTR_HIDDEN;
static const std::string ATTR_INDEX;
static const std::string ATTR_LIBRARY;
static const std::string ATTR_PATH;
static const std::string ATTR_PERMISSION;
static const std::string ATTR_REALM;
static const std::string ATTR_RESOURCE;
static const std::string ATTR_SECURE;
static const std::string MANIFEST_NAME;