File Information
Library: OSP/JS
Package: Module
Header: Poco/OSP/JS/ModuleExtensionPoint.h
Description
ModuleExtensionPoint is used to add native (C++) JavaScript Modules to the JavaScript environment.
To register a native JavaScript Module:
<extension point="com.appinf.osp.js.module" module="<module>" class="<factory class>" library="<library name>"/>
Note that the extension points are automatically removed if a bundle is stopped.
The following attributes can be specified for the extension point:
- module: the name of the module (e.g., "net"), as passed as argument to the JavaScript require() function.
- class: the class name of the ModuleFactory (see the ModuleFactory and Poco::JS::Module classes).
- library: the name of the shared library containing the ModuleFactory.
Inheritance
Direct Base Classes: Poco::OSP::ExtensionPoint
All Base Classes: Poco::OSP::ExtensionPoint, Poco::RefCountedObject
Member Summary
Member Functions: handleExtension, handleModule, moduleRegistry, onBundleStopped
Inherited Functions: duplicate, handleExtension, referenceCount, release, removeExtension
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < ModuleExtensionPoint >;
Constructors
ModuleExtensionPoint
ModuleExtensionPoint(
Poco::OSP::BundleContext::Ptr pContext
);
Creates the ModuleExtensionPoint, using the given bundle context.
Destructor
~ModuleExtensionPoint
Destroys the ModuleExtensionPoint.
Member Functions
handleExtension
void handleExtension(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
moduleRegistry
Poco::JS::Core::ModuleRegistry::Ptr moduleRegistry() const;
Returns the ModuleRegistry.
handleModule
void handleModule(
Bundle::ConstPtr pBundle,
Poco::XML::Element * pExtensionElem
);
Handle the Module extension point.
onBundleStopped
void onBundleStopped(
const void * pSender,
Poco::OSP::BundleEvent & ev
);
When a bundle is stopped, all of its Modules are automatically disabled.
Variables
EXTPOINT
static const std::string EXTPOINT;
ATTR_CLASS
static const std::string ATTR_CLASS;
ATTR_LIBRARY
static const std::string ATTR_LIBRARY;
ATTR_MODULE
static const std::string ATTR_MODULE;
MANIFEST_NAME
static const std::string MANIFEST_NAME;