IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
    
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerworks > My developerWorks >  Dashboard > WebSphere eXtreme Scale V6.1 User Guide > ... > Introduction to ObjectGrid configuration > Local ObjectGrid configuration
developerWorks
Log In   View a printable version of the current page.
Overview Connect Spaces Forums Wikis
Local ObjectGrid configuration
Added by Chris.D.Johnson, last edited by Jian.Tang on May 29, 2007  (view change)
Labels: 

Getting Started Examples Reference API documentation

See the WebSphere eXtreme Scale Wiki for links to eXtreme Scale Version 7.0 documentation.
If you log in with your developerWorks ID, you can leave comments and feedback for the development team.

A local ObjectGrid can be configured by using an ObjectGrid descriptor XML file or ObjectGrid APIs.

A simple XML example follows: the companyGrid.xml file. The file is also printed below. The first few lines of the file include the required header for each ObjectGrid XML file. The file defines the CompanyGrid ObjectGrid with Customer, Item, OrderLine, and Order BackingMaps.

companyGrid.xml
<?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>

Pass the XML file to one of the createObjectGrid methods in the ObjectGridManager interface. The following code snippet validates the companyGrid.xml file against the XML schema, and creates the CompanyGrid ObjectGrid. 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);

As an alternative to using XML, ObjectGrids can be created programmatically. The following code snippet can be used in place of the previous XML and code.

ObjectGridManager objectGridManager = ObjectGridManagerFactory.getObjectGridManager();
ObjectGrid companyGrid = objectGridManager.createObjectGrid ("CompanyGrid", false);
BackingMap customerMap= companyGrid.defineMap("Customer");
BackingMap itemMap= companyGrid.defineMap("Item");
BackingMap orderLineMap= companyGrid.defineMap("OrderLine");
BackingMap orderMap = companyGrid.defineMap("Order");

ObjectGrid has many customizable plug-ins and attributes. For a complete description of the ObjectGrid XML file, see ObjectGrid configuration reference.

Wiki Disclaimer and License
© Copyright IBM Corporation 2007,2009. All Rights Reserved.
Docs ObjectGrid configuration reference (WebSphere eXtreme Scale V6.1 User Guide)
Docs ObjectGrid XML schema (WebSphere eXtreme Scale V6.1 User Guide)


 
    About IBM Privacy Contact