[Java programming language only]

Creating dynamic maps with Java APIs

You can create dynamic maps with Java APIs after the data grid has been instantiated. You can dynamically instantiate maps that are based on a set of map templates. You can create your own map templates.

Before you begin

Configure a dynamic map template. For more information, see Configuring dynamic maps.

Procedure

Call the Session.getMap(String) method.
If you pass in a String that matches the regular expresssion of a template map that you created in the ObjectGrid XML file, an ObjectMap based on the BackingMap that was configured by the ObjectGrid XML file is created. The following example matches the templateMap.* template name that is defined in the ObjectGrid XML file:
Session session = og.getSession();
ObjectMap map = session.getMap("templateMap1");
A dynamic map is created based on the template map in this XML file. In this example, the map has an evictor configured with a pessimistic lock strategy.