Configuring local deployments

A local in-memory eXtreme Scale configuration can be created by using an ObjectGrid descriptor XML file or APIs.

About this task

To create a local deployment, you create an ObjectGrid descriptor XML file and then pass the file to the createObjectGrid methods in the ObjectGridManager interface.

As an alternative, you can also create the entire deployment programmatically with the ObjectGridManager interface.

Procedure

  1. Create an ObjectGrid descriptor XML file.

    The following companyGrid.xml file is an example of an ObjectGrid descriptor XML. The first few lines of the file include the required header for each ObjectGrid XML file. The file defines an ObjectGrid instance named "CompanyGrid" and several BackingMaps named "Customer," "Item," "OrderLine," and "Order."

    companyGrid.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="CompanyGrid">
    			<backingMap name="Customer" />
    			<backingMap name="Item" />
    			<backingMap name="OrderLine" />
    			<backingMap name="Order" />
    		</objectGrid>
    	</objectGrids>
    
    </objectGridConfig>
  2. Pass the XML file to one of the createObjectGrid methods in the ObjectGridManager interface.
    The following code sample validates the companyGrid.xml file against the XML schema, and creates the ObjectGrid instance named "CompanyGrid." The newly created ObjectGrid instance is not cached.
    ObjectGridManager objectGridManager = ObjectGridManagerFactory.getObjectGridManager();
    ObjectGrid companyGrid = objectGridManager.createObjectGrid("CompanyGrid", 
    	new URL("file:etc/test/companyGrid.xml"), true, false);

What to do next

See Creating ObjectGrid instances with the ObjectGridManager interface for more information about defining all of the maps programmatically with the createObjectGrid methods on the ObjectGridManager interface.