[Java programming language only]

Configuring OSGi-enabled plug-ins using the ObjectGrid descriptor XML file

In this task, you add existing OSGi services to a descriptor XML file so that WebSphere® eXtreme Scale containers can recognize and load the OSGi-enabled plug-ins correctly.

Before you begin

To configure your plug-ins, be sure to:
  • Create your package, and enable dynamic plug-ins for OSGi deployment.
  • Have the names of the OSGi services that represent your plug-ins available.

About this task

You have created an OSGi service to wrap your plug-in. Now, these services must be defined in the objectgrid.xml file so that eXtreme Scale containers can load and configure the plug-in or plug-ins successfully.

Procedure

  1. Any grid-specific plug-ins, such as TransactionCallback, must be specified under the objectGrid element.
    See the following example from the objectgrid.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <objectGridConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://ibm.com/ws/objectgrid/config ../objectGrid.xsd"
        xmlns="http://ibm.com/ws/objectgrid/config">
    
        <objectGrids>
            <objectGrid name="MyGrid" txTimeout="60">
                <bean id="myTranCallback" osgiService="myTranCallbackFactory"/>
                ...
            </objectGrid>
            ...
        </objectGrids>
        ...
    /objectGridConfig>
    Important: The osgiService attribute value must match the ref attribute value that is specified in the blueprint XML file, where the service was defined for myTranCallback PluginServiceFactory.
  2. Any map-specific plug-ins, such as loaders or serializers, for example, must be specified in the backingMapPluginCollections element and referenced from the backingMap element.
    See the following example from the objectgrid.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    
    objectGridConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://ibm.com/ws/objectgrid/config ../objectGrid.xsd"
        xmlns="http://ibm.com/ws/objectgrid/config">
        <objectGrids>
            <objectGrid name="MyGrid" txTimeout="60">
                <backingMap name="MyMap1" lockStrategy="PESSIMISTIC"
                    copyMode="COPY_TO_BYTES" nullValuesSupported="false"
                    pluginCollectionRef="myPluginCollectionRef1"/>
                <backingMap name="MyMap2" lockStrategy="PESSIMISTIC"
                    copyMode="COPY_TO_BYTES" nullValuesSupported="false"
                    pluginCollectionRef="myPluginCollectionRef2"/>
                ...
            </objectGrid>
            ...
        </objectGrids>
        ...
        <backingMapPluginCollections>
            <backingMapPluginCollection id="myPluginCollectionRef1">
                <bean id="MapSerializerPlugin" osgiService="mySerializerFactory"/>
            </backingMapPluginCollection>
            <backingMapPluginCollection id="myPluginCollectionRef2">
                <bean id="MapSerializerPlugin" osgiService="myOtherSerializerFactory"/>
                <bean id="Loader" osgiService="myLoader"/>
            </backingMapPluginCollection>
            ...
        </backingMapPluginCollections>
        ...
    </objectGridConfig>

Results

The objectgrid.xml file in this example tells eXtreme Scale to create a grid called MyGrid with two maps, MyMap1 and MyMap2. The MyMap1 map uses the serializer wrapped by the OSGi service, mySerializerFactory. The MyMap2 map uses a serializer from the OSGi service, myOtherSerializerFactory, and a loader from the OSGi service, myLoader.