* @param diskStorePath disk path to store data in
* @return a fully initialized store
*/
public static OverflowToDiskStore create(Cache cache, String diskStorePath) {
CacheConfiguration config = cache.getCacheConfiguration();
DiskOverflowStorageFactory disk = new DiskOverflowStorageFactory(cache, diskStorePath);
CapacityLimitedInMemoryFactory memory = new CapacityLimitedInMemoryFactory(disk, config.getMaxElementsInMemory(),
determineEvictionPolicy(config), cache.getCacheEventNotificationService());
OverflowToDiskStore store = new OverflowToDiskStore(memory, disk, config);
cache.getCacheConfiguration().addConfigurationListener(store);
return store;