You can use the preload method in the Loader interface to call a client loader.
void preloadMap(Session session, BackingMap backingMap) throws LoaderException;
This method signals the loader to preload the data into the map. A loader implementation can use a client loader to preload the data to all its partitions. For example, the JPA loader uses the client loader to preload data into the map. See Client-based JPA preload utility overview for more information.
void preloadMap (Session session, BackingMap backingMap) throws LoaderException {
....
ObjectGrid objectGrid = session.getObjectGrid();
int partitionId = backingMap.getPartitionId();
int numPartitions = backingMap.getPartitionManager().getNumOfPartitions();
// Only call client loader data in one partition
if (partitionId == preloadPartition) {
ClientLoader c = ClientLoaderFactory.getClientLoader();
// Call the client loader to load the data
try {
c.load(objectGrid, "CUSTOMER", "customerPU",
null, entityClass, null, null, true, null);
} catch (ObjectGridException e) {
LoaderException le = new LoaderException("Exception caught in ObjectMap " +
ogName + "." + mapName);
le.initCause(e);
throw le;
}
}
}