Using Plugins with Static Libraries
When an Ice plug-in is packaged in a static library, you need to link your application with the plug-in's static library and call a register
function from your application to ensure the corresponding code gets correctly included.
Linux Only
You need to call these register
functions when linking with static libraries on Linux. On other platforms, all Ice plug-ins included in the Ice static library are registered automatically.
Ice provides the following plug-in registration functions:
namespace Ice { void registerIceDiscovery(bool loadOnInitialize = true); void registerIceLocatorDiscovery(bool loadOnInitialize = true); void registerIceSSL(bool loadOnInitialize = true); void registerIceStringConverter(bool loadOnInitialize = true); }
For example, if you are using a static IceSSL plug-in, link your application with libIce.a
and call Ice::registerIceSSL
from your application. All Ice plug-ins (IceDiscovery, IceLocatorDiscovery and IceSSL) are included in the Ice static library (libIce.a
).
When the bool parameter is true
(the default), the plug-in is always loaded (created) during communicator initialization, even if Ice.Plugin.name
is not set. When false
, the plug-in is loaded (created) during communication initialization only if Ice.Plugin.name
is set to a non-empty value (e.g., Ice.Plugin.IceSSL=1
).
The table below summarizes the registration functions:
Plug-in Name | Functionality | Function |
---|---|---|
IceStringConverter | convert native string encoding to/from UTF-8 | Ice::registerIceStringConverter |
IceSSL | icessl transport | Ice::registerIceSSL |
IceDiscovery | Location service implemented using UDP multicast | Ice::registerIceDiscovery |
IceLocatorDiscovery | Location service implemented using UDP multicast | Ice::registerIceLocatorDiscovery |
Ice::registerPluginFactory
. Refer to the Plug-in API for more information on this function.