org.springframework.data.gemfire
Class RegionLookupFactoryBean<K,V>

java.lang.Object
  extended by org.springframework.data.gemfire.RegionLookupFactoryBean<K,V>
All Implemented Interfaces:
BeanNameAware, FactoryBean<Region<K,V>>, InitializingBean
Direct Known Subclasses:
RegionFactoryBean

public class RegionLookupFactoryBean<K,V>
extends Object
implements FactoryBean<Region<K,V>>, InitializingBean, BeanNameAware

Simple FactoryBean for retrieving generic GemFire Regions. If the region doesn't exist, an exception is thrown. For declaring and configuring new regions, see RegionFactoryBean.

Author:
Costin Leau

Field Summary
protected  Log log
           
 
Constructor Summary
RegionLookupFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 Region<K,V> getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
protected  Region<K,V> lookupFallback(Cache cache, String regionName)
          Fall back method in case the named region does not exist.
 void setBeanName(String name)
           
 void setCache(Cache cache)
          Sets the cache used for creating the region.
 void setName(String name)
          Sets the name of the cache region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final Log log
Constructor Detail

RegionLookupFactoryBean

public RegionLookupFactoryBean()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

lookupFallback

protected Region<K,V> lookupFallback(Cache cache,
                                     String regionName)
                              throws Exception
Fall back method in case the named region does not exist. By default, this implementation throws an exception.

Parameters:
cache - GemFire cache
regionName - region name
Throws:
Exception

getObject

public Region<K,V> getObject()
                      throws Exception
Specified by:
getObject in interface FactoryBean<Region<K,V>>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<Region<K,V>>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<Region<K,V>>

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface BeanNameAware

setCache

public void setCache(Cache cache)
Sets the cache used for creating the region.

Parameters:
cache - the cache to set
See Also:
CacheFactoryBean

setName

public void setName(String name)
Sets the name of the cache region. If no cache is found under the given name, a new one will be created. If no name is given, the beanName will be used.

Parameters:
name - the region name
See Also:
Region.getFullPath(), setBeanName(String)


Copyright © 2010 SpringSource, a division of VMware. All Rights Reserved.