org.springframework.data.gemfire.support
Class GemfireCacheManager

java.lang.Object
  extended by org.springframework.cache.support.AbstractCacheManager
      extended by org.springframework.data.gemfire.support.GemfireCacheManager
All Implemented Interfaces:
InitializingBean, CacheManager

public class GemfireCacheManager
extends AbstractCacheManager

Spring Framework CacheManager backed by a Gemfire Cache. Automatically discovers the created caches (or Regions in Gemfire terminology).

See Also:
Cache, CacheManager, AbstractCacheManager, Cache, Region

Constructor Summary
GemfireCacheManager()
           
 
Method Summary
 Cache getCache(String name)
          Gets a Cache (GemFire Cache Region) by name.
protected  Collection<Cache> loadCaches()
          Loads the GemFire Cache Regions managed by this CacheManager.
 void setCache(com.gemstone.gemfire.cache.Cache gemfireCache)
          Sets the GemFire Cache backing this CacheManager.
 void setRegions(Set<com.gemstone.gemfire.cache.Region<?,?>> regions)
          Sets the Regions to use (alternative to injecting the GemFire Cache).
 
Methods inherited from class org.springframework.cache.support.AbstractCacheManager
addCache, afterPropertiesSet, decorateCache, getCacheNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GemfireCacheManager

public GemfireCacheManager()
Method Detail

loadCaches

protected Collection<Cache> loadCaches()
Loads the GemFire Cache Regions managed by this CacheManager.

Specified by:
loadCaches in class AbstractCacheManager
Returns:
a Collection of GemFire Cache Regions (caches) to be managed by this SDG CacheManager.
See Also:
Cache, RegionService.rootRegions()

getCache

public Cache getCache(String name)
Gets a Cache (GemFire Cache Region) by name.

Specified by:
getCache in interface CacheManager
Overrides:
getCache in class AbstractCacheManager
Parameters:
name - a String indicating the name of the Cache to get.
Returns:
a Cache with the given name.
See Also:
Cache

setCache

public void setCache(com.gemstone.gemfire.cache.Cache gemfireCache)
Sets the GemFire Cache backing this CacheManager.

Parameters:
gemfireCache - the GemFire Peer Cache instance.
See Also:
Cache

setRegions

public void setRegions(Set<com.gemstone.gemfire.cache.Region<?,?>> regions)
Sets the Regions to use (alternative to injecting the GemFire Cache).

Parameters:
regions - the Set of Regions (caches) managed by this CacheManager.
See Also:
Region