Remote Invocation Service for C++ Clients

Skip to end of metadata
Go to start of metadata

An Invocable can execute any arbitrary action and can use any cluster-side services (cache services, grid services, etc.) necessary to perform their work. The Invocable operations can also be stateful, which means that their state is serialized and transmitted to the grid nodes on which the Invocable is run.

Coherence for C++ provides a Remote Invocation Service which allows the execution of Invocables within the cluster-side JVM to which the client is connected. In Java, Invocables are simply runnable application classes that implement the ${xhtml} interface. To employ an Invocable in Coherence for C++, you must deploy a compiled Java implementation of the Invocable task on the cluster-side node, in addtion to providing a C++ implementation of Invocable ${xhtml}. Since execution is server-side (that is, Java), the C++ invocable only needs to be concerned with state; the methods themselves can be no-ops.

Configuring and Using the Remote Invocation Service

A Remote Invocation Service is configured using the remote-invocation-scheme element in the cache configuration descriptor. For example:

A reference to a configured Remote Invocation Service can then be obtained by name by using the ${xhtml} class:

To execute an agent on the grid node to which the client is connected requires only one line of code:

The Map returned from query is keyed by the member on which the query is run. For Extend clients, there is no concept of membership, so the result is keyed by the local member which can be retrieved by calling CacheFactory::getConfigurableCacheFactory()::GetLocalMember()

Registering Invocable Implementation Classes
Like cached value objects, all Invocable implementation classes must be correctly registered in the POF context of the C++ application (see the PortableObject description in Integrating user data types#PortableObject) and cluster-side node to which the client is connected. As such, a Java implementation of the Invocable task (a ${xhtml} implementation) must be created, compiled, and deployed on the cluster-side node.

See Configuring a POF Context for additional details.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.