public class GemFireCacheTypeAwareRegionFactoryBean<K,V> extends Object implements org.springframework.beans.factory.FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>, org.springframework.beans.factory.InitializingBean
FactoryBean used to construct, configure
and initialize the GemFire cache Region used to store and manage Session state.FactoryBean,
InitializingBean,
GenericRegionFactoryBean,
ClientRegionFactoryBean,
GemFireHttpSessionConfiguration,
GemFireCache,
InterestResultPolicy,
Region,
RegionAttributes,
RegionShortcut,
ClientRegionShortcut| Modifier and Type | Field and Description |
|---|---|
protected static com.gemstone.gemfire.cache.client.ClientRegionShortcut |
DEFAULT_CLIENT_REGION_SHORTCUT |
protected static com.gemstone.gemfire.cache.RegionShortcut |
DEFAULT_SERVER_REGION_SHORTCUT |
protected static String |
DEFAULT_SPRING_SESSION_GEMFIRE_REGION_NAME |
| Constructor and Description |
|---|
GemFireCacheTypeAwareRegionFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Post-construction initialization callback to create, configure and initialize the GemFire cache
Region
used to store, replicate (distribute) and manage Session state. |
protected com.gemstone.gemfire.cache.client.ClientRegionShortcut |
getClientRegionShortcut()
Returns the
Region data policy used by the GemFire cache client to manage Session state. |
protected com.gemstone.gemfire.cache.GemFireCache |
getGemfireCache()
Returns a reference to the GemFire cache used to construct the appropriate
Region. |
com.gemstone.gemfire.cache.Region<K,V> |
getObject()
Returns a reference to the constructed GemFire cache
Region used to store and manage Session state. |
Class<?> |
getObjectType()
Returns the specific type of GemFire cache
Region this factory creates when initialized
or Region.class when uninitialized. |
protected com.gemstone.gemfire.cache.RegionAttributes<K,V> |
getRegionAttributes()
Returns the GemFire
RegionAttributes used to configure the GemFire cache Region used to
store and manage Session state. |
protected String |
getRegionName()
Returns the configured name of the GemFire cache
Region use to store and manage Session state. |
protected com.gemstone.gemfire.cache.RegionShortcut |
getServerRegionShortcut()
Returns the
Region data policy used by the GemFire peer cache to manage Session state. |
boolean |
isSingleton()
Returns true indicating the GemFire cache
Region created by this factory is the sole instance. |
protected com.gemstone.gemfire.cache.Region<K,V> |
newClientRegion(com.gemstone.gemfire.cache.GemFireCache gemfireCache)
Constructs a GemFire cache
Region using the client-server GemFire topology to store
and manage Session state in a GemFire server cluster accessible from a GemFire cache client. |
protected com.gemstone.gemfire.cache.Region<K,V> |
newServerRegion(com.gemstone.gemfire.cache.GemFireCache gemfireCache)
Constructs a GemFire cache
Region using a peer-to-peer (p2p) GemFire topology to store
and manage Session state in a GemFire server cluster accessible from a GemFire cache client. |
protected org.springframework.data.gemfire.client.Interest<K>[] |
registerInterests(boolean register)
Decides whether interests will be registered for all keys.
|
void |
setClientRegionShortcut(com.gemstone.gemfire.cache.client.ClientRegionShortcut clientRegionShortcut)
Sets the
Region data policy used by the GemFire cache client to manage Session state. |
void |
setGemfireCache(com.gemstone.gemfire.cache.GemFireCache gemfireCache)
Sets a reference to the GemFire cache used to construct the appropriate
Region. |
void |
setRegionAttributes(com.gemstone.gemfire.cache.RegionAttributes<K,V> regionAttributes)
Sets the GemFire
RegionAttributes used to configure the GemFire cache Region used to
store and manage Session state. |
void |
setRegionName(String regionName)
Sets the name of the GemFire cache
Region use to store and manage Session state. |
void |
setServerRegionShortcut(com.gemstone.gemfire.cache.RegionShortcut serverRegionShortcut)
Sets the
Region data policy used by the GemFire peer cache to manage Session state. |
protected static final com.gemstone.gemfire.cache.client.ClientRegionShortcut DEFAULT_CLIENT_REGION_SHORTCUT
protected static final com.gemstone.gemfire.cache.RegionShortcut DEFAULT_SERVER_REGION_SHORTCUT
protected static final String DEFAULT_SPRING_SESSION_GEMFIRE_REGION_NAME
public GemFireCacheTypeAwareRegionFactoryBean()
public void afterPropertiesSet()
throws Exception
Region
used to store, replicate (distribute) and manage Session state. This method intelligently handles
both client-server and peer-to-peer (p2p) GemFire supported distributed system topologies.afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanException - if the initialization of the GemFire cache Region fails.GemFireUtils.isClient(GemFireCache),
getGemfireCache(),
newClientRegion(GemFireCache),
newServerRegion(GemFireCache)protected com.gemstone.gemfire.cache.Region<K,V> newServerRegion(com.gemstone.gemfire.cache.GemFireCache gemfireCache) throws Exception
Region using a peer-to-peer (p2p) GemFire topology to store
and manage Session state in a GemFire server cluster accessible from a GemFire cache client.gemfireCache - a reference to the GemFire Cache.Region to store and manage Session state.Exception - if the instantiation, configuration and initialization
of the GemFire cache Region fails.GenericRegionFactoryBean,
GemFireCache,
Region,
getRegionAttributes(),
getRegionName(),
getServerRegionShortcut()protected com.gemstone.gemfire.cache.Region<K,V> newClientRegion(com.gemstone.gemfire.cache.GemFireCache gemfireCache) throws Exception
Region using the client-server GemFire topology to store
and manage Session state in a GemFire server cluster accessible from a GemFire cache client.gemfireCache - a reference to the GemFire Cache.Region to store and manage Session state.Exception - if the instantiation, configuration and initialization
of the GemFire cache Region fails.ClientRegionFactoryBean,
GemFireCache,
Region,
getClientRegionShortcut(),
getRegionAttributes(),
getRegionName(),
registerInterests(boolean)protected org.springframework.data.gemfire.client.Interest<K>[] registerInterests(boolean register)
register - a boolean value indicating whether interests should be registered.Interestpublic com.gemstone.gemfire.cache.Region<K,V> getObject() throws Exception
Region used to store and manage Session state.public Class<?> getObjectType()
Region this factory creates when initialized
or Region.class when uninitialized.public boolean isSingleton()
Region created by this factory is the sole instance.public void setClientRegionShortcut(com.gemstone.gemfire.cache.client.ClientRegionShortcut clientRegionShortcut)
Region data policy used by the GemFire cache client to manage Session state.clientRegionShortcut - a ClientRegionShortcut to specify the client Region
data management policy.ClientRegionShortcutprotected com.gemstone.gemfire.cache.client.ClientRegionShortcut getClientRegionShortcut()
Region data policy used by the GemFire cache client to manage Session state. Defaults to
ClientRegionShortcut.PROXY.ClientRegionShortcut specifying the client Region data management policy.GemFireHttpSessionConfiguration.DEFAULT_CLIENT_REGION_SHORTCUT,
ClientRegionShortcutpublic void setGemfireCache(com.gemstone.gemfire.cache.GemFireCache gemfireCache)
Region.gemfireCache - a reference to the GemFire cache.IllegalArgumentException - if the GemFireCache reference is null.protected com.gemstone.gemfire.cache.GemFireCache getGemfireCache()
Region.IllegalStateException - if the GemFireCache reference is null.public void setRegionAttributes(com.gemstone.gemfire.cache.RegionAttributes<K,V> regionAttributes)
RegionAttributes used to configure the GemFire cache Region used to
store and manage Session state.regionAttributes - the GemFire RegionAttributes used to configure the GemFire cache Region.RegionAttributesprotected com.gemstone.gemfire.cache.RegionAttributes<K,V> getRegionAttributes()
RegionAttributes used to configure the GemFire cache Region used to
store and manage Session state.RegionAttributes used to configure the GemFire cache Region.RegionAttributespublic void setRegionName(String regionName)
Region use to store and manage Session state.regionName - a String specifying the name of the GemFire cache Region.protected String getRegionName()
Region use to store and manage Session state.
Defaults to "ClusteredSpringSessions"Region.Region.getName()public void setServerRegionShortcut(com.gemstone.gemfire.cache.RegionShortcut serverRegionShortcut)
Region data policy used by the GemFire peer cache to manage Session state.serverRegionShortcut - a RegionShortcut to specify the peer Region data management policy.RegionShortcutprotected com.gemstone.gemfire.cache.RegionShortcut getServerRegionShortcut()
Region data policy used by the GemFire peer cache to manage Session state. Defaults to
RegionShortcut.PARTITION.RegionShortcut specifying the peer Region data management policy.RegionShortcut