[Java programming language only]

Retrieving a ObjectGrid instance with the ObjectGridManager interface

Use the ObjectGridManager.getObjectGrid methods to retrieve cached instances.

Retrieving a cached instance

Since the Employees ObjectGrid instance was cached by the ObjectGridManager interface, another user can access it with the following code snippet:
ObjectGrid myEmployees = oGridManager.getObjectGrid("Employees");

The following two getObjectGrid methods return cached ObjectGrid instances:

  • Retrieving all cached instances

    To obtain all of the ObjectGrid instances that have been previously cached, use the getObjectGrids method, which returns a list of each instance. If no cached instances exist, the method will return null.

  • Retrieving a cached instance by name

    To obtain a single cached instance of an ObjectGrid, use getObjectGrid(String objectGridName), passing the name of the cached instance into the method. The method either returns the ObjectGrid instance with the specified name or returns null if there is no ObjectGrid instance with that name.

Note: You can also use the getObjectGrid method to connect to a distributed grid. See Connecting to distributed ObjectGrid instances programmatically for more information.