TracNav
- Introduction
- Credits and Contributors
Overview
Zen Core
Zen Engine
Zen Enterprise
Miscellaneous
Enterprise Plugins :: ZBoostNetworking
The ZBoostNetworking plugin is actually mis-named. Originally it was intended as a generic Boost networking using the boost asio library, but it eventually became a Web Services plugin. I'll rename it before 1.0 but probably not for awhile.
Usage Notes
When using this plugin with Zen Server, you will need to configure the protocol adapter in the protocols block of the application configuration file passed as the -c parameter to Zen Server. (See the Zen Server configuration documentation for more details.
Example:
<application> ... <protocols> <protocol type="http" address="localhost" port="80" threads="2" > <map url="/" destination="root"/> <map url="/xyz" destination="xyz"/> </protocol> </protocols> ... </application>
In this example, anything HTTP request sent to a URL that starts with "/xyz" will be sent to the protocol adapter registered at the resource location "xyz".
All other requests will be sent to the protocol adapter registered at the resource location "root".
See Zen::Enterprise::AppServer::I_ApplicationServerManager::createLocation() for creating locations like "root" and "xyz".
See Zen::Enterprise::AppServer::I_ApplicationServer::installApplication() for installing an application service at a specified resource location.
Application services handling installed at a resource location handled by a http protocol adapter will receive an I_Request that is also a I_WebRequest declared in this plugin.
The first parameter is the string used to partially match the URL. The second entry is the location used by the application server to dispatch the request to the correct application service. The longest match will be used.
Example:
| url | destination resource location |
| / | root |
| /xyz | xyz |
If there are more than one matches, the longest match will be used.
In the above example url = /xyz will actually end up matching HTTP request /xyz even though url = / also matches.
In this case a request going to /xyz will be dispatched to the I_ApplicationService registered at resource location "xyz". Every other request will match the URL "/" which will dispatch to the I_ApplicationService registered at resource location "root".
Dynamic Configuration
If you are using this plugin outside of Zen Server or you need to dynamically register a URL handler, see the I_WebProtocolService::registerURL() method in this plugin. The example given above is also appropriate for dynamic configuration.
Compiling
The compiling instructions? shows you how to compile ZBoostNetworking.
