[Java programming language only]

Configuring servers with OSGi Blueprint

You can configure WebSphere® eXtreme Scale container servers using an OSGi blueprint XML file, allowing simplified packaging and development of self-contained server bundles.

Before you begin

This topic assumes that the following tasks have been completed:
  • The Eclipse Equinox OSGi framework has been installed and started with either the Eclipse Gemini or Apache Aries blueprint container.
  • The eXtreme Scale server bundle has been installed and started.
  • The eXtreme Scale dynamic plug-ins bundle has been created.
  • The eXtreme Scale ObjectGrid descriptor XML file and deployment policy XML file have been created.

About this task

This task describes how to configure an eXtreme Scale server with a container using a blueprint XML file. The result of the procedure is a container bundle. When the container bundle is started, the eXtreme Scale server bundle will track the bundle, parse the server XML and start a server and container.

A container bundle can optionally be combined with the application and eXtreme Scale plug-ins when dynamic plug-in updates are not required or the plug-ins do not support dynamic updating.

Procedure

  1. Create a Blueprint XML file with the objectgrid namespace included.
    You can name the file anything. However, it must include the blueprint namespace:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
               xmlns:objectgrid="http://www.ibm.com/schema/objectgrid"
               xsi:schemaLocation="http://www.ibm.com/schema/objectgrid
                    http://www.ibm.com/schema/objectgrid/objectgrid.xsd">
    ...
    </blueprint>
  2. Add the XML definition for the eXtreme Scale server with the appropriate server properties.
    See the Spring descriptor XML file for details on all available configuration properties. See the following example of the XML definition:
    <objectgrid:server id="xsServer" tracespec="ObjectGridOSGi=all=enabled" 
    tracefile="logs/osgi/wxsserver/trace.log" jmxport="1199" listenerPort="2909">
    <objectgrid:catalog host="catserver1.mycompany.com" port="2809" />
    <objectgrid:catalog host="catserver2.mycompany.com" port="2809" />
    </objectgrid:server>
  3. Add the XML definition for the eXtreme Scale container with the reference to the server definition and the ObjectGrid descriptor XML and ObjectGrid deployment XML files embedded in the bundle; for example:
    <objectgrid:container id="container"
        objectgridxml="/META-INF/objectGrid.xml" 
        deploymentxml="/META-INF/objectGridDeployment.xml"
        server="xsServer" />
  4. Store the Blueprint XML file in the container bundle.
    The Blueprint XML must be stored in the OSGI-INF/blueprint directory for the Blueprint container to be found.
    To store the Blueprint XML in a different directory, you must specify the Bundle-Blueprint manifest header; for example:
    Bundle-Blueprint: OSGI-INF/blueprint.xml
  5. Package the files into a single bundle JAR file.
    See the following example of a bundle directory hierarchy:
    MyBundle.jar
        /META-INF/manifest.mf
        /META-INF/objectGrid.xml
        /META-INF/objectGridDeployment.xml
        /OSGI-INF/blueprint/blueprint.xml

Results

An eXtreme Scale container bundle is now created and can be installed in Eclipse Equinox. When the container bundle is started, the eXtreme Scale server runtime environment in the eXtreme Scale server bundle, will automatically start the singleton eXtreme Scale server using the parameters defined in the bundle, and starts a container server. The bundle can be stopped and started, which results in the container stopping and starting. The server is a singleton and does not stop when the bundle is started the first time.