These are the main configuration APIs for the ObjectGrid. These API's aid in creating and configuring ObjectGrid Instances.

Introduction

Methods are provided on ObjectGridManager and ObjectGridConfigFactory to facilitate creation and configuration of the ObjectGrid

Programming Tutorial

  1. Simple Case to create an instance of ObjectGrid

    To quickly access ObjectGrid instance and prototype.

    ObjectGrid og = ObjectGridManager.createObjectGrid();

    It returns a instance with a unique name assigned for that JVM

  2. Configuring an ObjectGrid with BackingMaps

    Lets assume, we want to create an ObjectGrid with name "Accounts", and which has three backing maps "savings","checking" and "moneymarket". First step is to create an ObjectGridConfiguration object, followed by creating all three backing map configuration objects (BackingMapConfiguration), which belong to objectgrid "Accounts". Code snippet is shown below.

    ObjectGridConfiguration ogc = ObjectGridConfigFactory.createObjectGridConfiguration("Accounts");
    ObjectGridConfigFactory.createBackingMapConfiguration(ogc,"savings");
    ObjectGridConfigFactory.createBackingMapConfiguration(ogc,"checking");
    ObjectGridConfigFactory.createBackingMapConfiguration(ogc,"moneymarket");
    ObjectGrid og = ogc.getObjectGrid();

    The above code snippet allows you to access ObjectGrid in a "programmatic" way.

  3. Configuring an ObjectGrid with Plugins

    The ObjectGrid supports attaching of the following custom designed plugins

    Code snippet to attach an Event Listener. Assuming the custom class name is com.acme.MyObjectGridListener, which implements ObjectGridEventListener

    Plugin pel = ObjectGridConfigFactory.createPlugin(ObjectGridConfiguration.PLUGIN_OBJECTGRID_EVENT_LISTENER,"com.acme.MyObjectGridListener");
    ogc.addPlugin(pel);

  4. Configuring BackingMaps with Plugins

    The BackingMaps supports attaching of the following custom designed plugins

    Code snippet to attach an Evictor. Assuming the custom class name is com.acme.Evictor, which implements Evictor

    Plugin pev = ObjectGridConfigFactory.createPlugin(BackingMapConfiguration,PLUGIN_EVICTOR,"com.acme.Evictor");
    BackingMapConfiguration bmc = ObjectGridConfigFactory.createBackingMapConfiguration(ogc,"savings");
    bmc.addPlugin(pev);