Methods are provided on ObjectGridManager and ObjectGridConfigFactory to facilitate creation and configuration of the ObjectGrid
To quickly access ObjectGrid instance and prototype.
ObjectGrid og = ObjectGridManager.createObjectGrid();
It returns a instance with a unique name assigned for that JVM
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.
The ObjectGrid supports attaching of the following custom designed plugins
Plugin pel = ObjectGridConfigFactory.createPlugin(ObjectGridConfiguration.PLUGIN_OBJECTGRID_EVENT_LISTENER,"com.acme.MyObjectGridListener");
ogc.addPlugin(pel);
The BackingMaps supports attaching of the following custom designed plugins
Plugin pev = ObjectGridConfigFactory.createPlugin(BackingMapConfiguration,PLUGIN_EVICTOR,"com.acme.Evictor");
BackingMapConfiguration bmc = ObjectGridConfigFactory.createBackingMapConfiguration(ogc,"savings");
bmc.addPlugin(pev);