public abstract class RegionLookupFactoryBean<K,V> extends Object implements FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>, InitializingBean, BeanNameAware
Regions. 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()
Returns a reference to the parent
Region indicating this FactoryBean represents a GemFire cache
Sub-Region. |
protected com.gemstone.gemfire.cache.Region<K,V> |
getRegion()
Returns a reference to the GemFire
Region resolved by this Spring FactoryBean
during the lookup operation; maybe a new Region. |
boolean |
isSingleton() |
protected com.gemstone.gemfire.cache.Region<K,V> |
lookupFallback(com.gemstone.gemfire.cache.GemFireCache cache,
String regionName)
Deprecated.
call
lookupRegion(GemFireCache, String) instead. |
protected com.gemstone.gemfire.cache.Region<K,V> |
lookupRegion(com.gemstone.gemfire.cache.GemFireCache cache,
String regionName)
Method to perform a lookup when the named
Region does not exist. |
String |
resolveRegionName()
Resolves the name of the GemFire
Region. |
void |
setBeanName(String name)
Sets the name of the
Region based on the bean 'id' attribute. |
void |
setCache(com.gemstone.gemfire.cache.GemFireCache cache)
Sets a reference to the
GemFireCache 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 to indicated this FactoryBean represents a GemFire cache
Sub-Region. |
void |
setRegionName(String regionName)
Sets the name of the cache
Region. |
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanException@Deprecated protected com.gemstone.gemfire.cache.Region<K,V> lookupFallback(com.gemstone.gemfire.cache.GemFireCache cache, String regionName) throws Exception
lookupRegion(GemFireCache, String) instead.Exceptionprotected com.gemstone.gemfire.cache.Region<K,V> lookupRegion(com.gemstone.gemfire.cache.GemFireCache cache, String regionName) throws Exception
Region does not exist. By default, this implementation
throws an exception.cache - reference to the GemFire cache.regionName - name of the GemFire Region.Region in the GemFire cache with the given name.BeanInitializationException - if the lookup operation fails.ExceptionRegionpublic com.gemstone.gemfire.cache.Region<K,V> getObject() throws Exception
getObject in interface FactoryBean<com.gemstone.gemfire.cache.Region<K,V>>Exceptionpublic 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 String resolveRegionName()
Region.String indicating the name of the GemFire Region.Region.getName()public void setBeanName(String name)
Region based on the bean 'id' attribute. If no Region is found
with the given name, a new one will be created.setBeanName in interface BeanNameAwarename - name of this Region bean in the Spring ApplicationContext.BeanNameAware.setBeanName(String)public void setCache(com.gemstone.gemfire.cache.GemFireCache cache)
GemFireCache used to create the Region.cache - reference to the GemFireCache.CacheFactoryBean,
GemFireCachepublic void setLookupEnabled(Boolean lookupEnabled)
public Boolean getLookupEnabled()
public void setName(String name)
Region based on the bean 'name' attribute. If no Region is found
with the given name, a new one will be created. If no name is given, the value of the 'beanName' property
will be used.name - Region name.setBeanName(String)public void setParent(com.gemstone.gemfire.cache.Region<?,?> parent)
Region to indicated this FactoryBean represents a GemFire cache
Sub-Region.parent - reference to the parent Region.Regionprotected com.gemstone.gemfire.cache.Region<?,?> getParent()
Region indicating this FactoryBean represents a GemFire cache
Sub-Region.Region or null if this Region
is not a Sub-Region.Regionprotected com.gemstone.gemfire.cache.Region<K,V> getRegion()
Region resolved by this Spring FactoryBean
during the lookup operation; maybe a new Region.Region resolved during lookup.Regionpublic void setRegionName(String regionName)
Region. If no Region is found with the given name,
a new one will be created. If no name is given, the value of the 'name' property will be used.regionName - name of the Region.setName(String)Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.