General changes
There is one new feature, which is provided by the IPC library in this
release. It is possible now to write custom plugin libraries to be used
as both server and client interceptors for the remote methods
invocation. There are already five different plugins, which are
included into release:
- libAMInterceptor.so - implements Access Management specific
client
interceptor. This library is built by the Access Manager (AM)
component. See it for more information. This library is always loaded
by default.
- libipcclicp.so - default IPC client interceptor. It exists for
compatibility with the previous IPC version. In the next release it's
functionality will be replaced by the Access Manager plugin. This
library is always loaded by default.
- libipcsrvicp.so - default IPC server interceptor. It exists for
compatibility with the
previous IPC version. In the next release it's functionality will be
replaced by the Access Manager plugin. This library is always loaded by
default.
- libipccltrace.so - IPC client trace plugin. It is not loaded by
default. User can activate this plugin using the
TDAQ_IPC_CLIENT_INTERCEPTORS environment variable.
- libipcsrvtrace.so - IPC server trace plugin. It is not loaded by
default. User can activate this
plugin using the TDAQ_IPC_SERVER_INTERCEPTORS environment variable.
In order to activate a specific plugin user has to specify it in one of
the TDAQ_IPC_CLIENT_INTERCEPTORS or TDAQ_IPC_SERVER_INTERCEPTORS
environment variables. Each variable can contain a list of plugins,
separated by colons. For example default values for this variables look
like:
>export TDAQ_IPC_CLIENT_INTERCEPTORS=ipcclicp:AMInterceptor
This means that by default for any remote invocation the IPC default
plugin will be called before the Access Manager one on the client side.
>export TDAQ_IPC_SERVER_INTERCEPTORS=ipcsrvicp
This means that by default for any remote invocation the IPC default
plugin will be called before any remote invocation on the server side.
If a user set his own values for one of the interceptor environment
variables, then the default values will be overridden and default
plugins will never be called unless been explicitly mentioned in the
new environment values.
Changes in API
The old API stays unchanged. However there is a new API, which provides
two abstract classes, which can be used as base ones for the user
specific server and client plugins. In order to implement the server
side interceptor, one has to do the following:
- Define a class, which has to inherit from the
IPCServerInterceptor class and implement the receiveRequest virtual
function. For example:
#include <ipc/interceptors.h>
class IPCServerTrace : public IPCServerInterceptor
{
void receiveRequest( const char * interface_id, const char * operation_id, IOP::ServiceContextList & )
{
std::cout << " IPC server trace :: " << interface_id << " : " << operation_id << std::endl;
}
};
- Define the C-like function, which provides an entry point to your
plugin. This function must have the following name:
"create_YOUR_PLUGIN_LIBRARY_NAME". For example:
extern "C" void * create_ipcsrvtrace()
{
return new IPCServerTrace;
}
- Compile your code and build a shared library out of it. For this
particular example it must be libipcsrvtrace.so.
- Set the TDAQ_IPC_SERVER_INTERCEPTORS environment variable to the
name of your plugin library. For example:
> export TDAQ_IPC_SERVER_INTERCEPTORS=ipcsrvicp:ipcsrvtrace
- Any IPC based server, which is started with this value in the
environment, will execute the IPCServerTrace::receiveRequest function
before executing any remote function call (but after executing the
default IPC plugin).
To be implemented
- Fault tolerance for the IPC server
- Up-to-date users guide