WebLVC 1.7d API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
9 - The Broker Plug-in API

WebLVC brokers support the loading of plug-ins to alter a broker's behavior.

The primary use for this is to change the translators used by a broker. Existing translators can be removed from the broker and new or overridden translators can be registered for creation and use.

All brokers have a 'Plugin Directory' setting, which specifies the directory the broker should check for plug-ins. For the brokers shipped with WebLVC, this setting defaults to ./plugins/[brokertype], for example, the default plug-in directory for the DIS broker is ./plugins/disBroker. On Windows, this directory is checked for separate 'release' and 'debug' directories for the plug-ins to use for each type of build (these subdirectories are not necessary on Linux).

Plugins are supplied to the broker as shared libraries that export a single initialization method named brokerPluginInit(). This method takes a pointer to a DtBroker as an argument, which can be cast to the appropriate type of broker and used in conjunction with the broker's object and interaction translators to change the translators used by the broker. The brokerPluginInit() also returns a boolean value in order to report back to the broker whether the initialization was successful or not.

To build a plug-in, the plug-in library must link against the broker library for the type of broker the plug-in is designed to work with, as well as the main 'broker' library. The broker libraries are necessary for correctly casting the broker and modifying the translators registered with the broker's translator factories. Please see the brokerPlugin example for more details regarding the creation of a broker plug-in.

[<< The TENA Broker API] [Home] [Top of Page] [Extending the Portal Application >>]


Document ID: Generated on Wed Jun 21 15:05:44 EDT 2023 from SVN revision 256253
Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)