public abstract class RegionLookupFactoryBean<K,V> extends Object implements FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>, InitializingBean, BeanNameAware
Region
s. If lookups are not enabled or the Region
does not exist, an exception is thrown. For declaring and configuring new Regions, see RegionFactoryBean
.BeanNameAware
,
FactoryBean
,
InitializingBean
,
Region
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
RegionLookupFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Boolean |
getLookupEnabled() |
com.gemstone.gemfire.cache.Region<K,V> |
getObject() |
Class<?> |
getObjectType() |
protected com.gemstone.gemfire.cache.Region<?,?> |
getParent()
Gets a reference to the parent Region if this FactoryBean represents a GemFire Cache Sub-Region.
|
protected com.gemstone.gemfire.cache.Region<K,V> |
getRegion()
Gets the reference to the GemFire Region obtained by this Spring FactoryBean during the lookup operation.
|
boolean |
isSingleton() |
protected com.gemstone.gemfire.cache.Region<K,V> |
lookupFallback(com.gemstone.gemfire.cache.GemFireCache cache,
String regionName)
Fallback method in case the named Region does not exist.
|
void |
setBeanName(String name)
Sets the name of the Cache Region based on the bean 'id' attribute.
|
void |
setCache(com.gemstone.gemfire.cache.GemFireCache cache)
Sets a reference to the Cache used to create the Region.
|
void |
setLookupEnabled(Boolean lookupEnabled) |
void |
setName(String name)
Sets the name of the Cache Region based on the bean 'name' attribute.
|
void |
setParent(com.gemstone.gemfire.cache.Region<?,?> parent)
Sets a reference to the parent Region if this FactoryBean represents a GemFire Cache Sub-Region.
|
void |
setRegionName(String regionName)
Sets the name of the Cache Region as expected by GemFire.
|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
protected com.gemstone.gemfire.cache.Region<K,V> lookupFallback(com.gemstone.gemfire.cache.GemFireCache cache, String regionName) throws Exception
cache
- a reference to the GemFire Cache.regionName
- the name of the GemFire Cache Region.Exception
- if the lookup operation fails.public com.gemstone.gemfire.cache.Region<K,V> getObject() throws Exception
getObject
in interface FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>
Exception
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>
public boolean isSingleton()
isSingleton
in interface FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
name
- the name of this bean (Region) in the application context (bean factory).BeanNameAware.setBeanName(String)
public void setCache(com.gemstone.gemfire.cache.GemFireCache cache)
cache
- a reference to the Cache.CacheFactoryBean
,
GemFireCache
public void setName(String name)
name
- the region namesetBeanName(String)
,
Region.getFullPath()
public void setParent(com.gemstone.gemfire.cache.Region<?,?> parent)
parent
- a reference to the parent Region if this Region is a Sub-Region.Region
protected com.gemstone.gemfire.cache.Region<?,?> getParent()
Region
protected com.gemstone.gemfire.cache.Region<K,V> getRegion()
Region
public void setRegionName(String regionName)
regionName
- a String indicating the name of the Region in GemFire.setName(String)
,
Region.getName()
public void setLookupEnabled(Boolean lookupEnabled)
public Boolean getLookupEnabled()