Spring Data for VMware GemFire
Class LazyWiringDeclarableSupport
java.lang.Object
org.springframework.data.gemfire.support.DeclarableSupport
org.springframework.data.gemfire.support.WiringDeclarableSupport
org.springframework.data.gemfire.support.LazyWiringDeclarableSupport
- All Implemented Interfaces:
- EventListener,- org.apache.geode.cache.CacheCallback,- org.apache.geode.cache.Declarable,- org.springframework.beans.factory.DisposableBean,- org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public abstract class LazyWiringDeclarableSupport
extends WiringDeclarableSupport
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.beans.factory.DisposableBean
Implementation of Apache Geode's 
Declarable interface that enables support for wiring Apache Geode components
 with Spring bean dependencies defined in a Spring ApplicationContext.- Since:
- 1.3.4
- See Also:
- 
- Properties
- Cache
- CacheCallback
- Declarable
- BeanFactory
- DisposableBean
- ApplicationContext
- ApplicationListener
- ContextRefreshedEvent
- SpringContextBootstrappingInitializer
- WiringDeclarableSupport
 
- 
Field SummaryFields inherited from class org.springframework.data.gemfire.support.WiringDeclarableSupportTEMPLATE_BEAN_NAME_PROPERTY
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new instance of theLazyWiringDeclarableSupportclass registered with theSpringContextBootstrappingInitializeras a SpringApplicationListener.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAsserts that thisDeclarableobject has been properly configured and initialized by the Spring container after has GemFire constructed thisDeclarableobject during startup.protected voidAsserts that thisDeclarableobject has not yet been used, or activated prior to being fully constructed, configured and initialized by the Spring container.voiddestroy()When thisDeclarableobject/bean gets destroyed by the Spring container,destroy()will make sure this component gets unregistered from theSpringContextBootstrappingInitializerproperly.protected voiddoPostInit(Properties parameters) Performs any post configuration and initialization activities required by the application.final voidinitialize(org.apache.geode.cache.Cache cache, Properties parameters) Initialization method called by GemFire with the configured parameters once thisDeclarableobject has been constructed by GemFire and the <initalizer> element is parsed in GemFire's configuration meta-data during startup.protected booleanDetermines whether thisDeclarableobject has been properly configured and initialized by the Spring container.protected booleanDetermines whether thisDeclarableobject has been properly configured and initialized by the Spring container.protected PropertiesNull-safe operation to return the parameters passed to thisDeclarableobject when created by GemFire from it's own configuration meta-data (e.g.final voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) Event handler method called when GemFire has created and initialized (refreshed) the SpringApplicationContextusing theSpringContextBootstrappingInitializer.protected voidsetParameters(Properties parameters) Stores a reference to theparameterspassed to theDeclarable.init(Properties)method.Methods inherited from class org.springframework.data.gemfire.support.WiringDeclarableSupportconfigureThis, configureThis, newBeanConfigurer, newBeanConfigurerMethods inherited from class org.springframework.data.gemfire.support.DeclarableSupportclose, getBeanFactory, getBeanFactoryKey, locateBeanFactory, locateBeanFactory, setBeanFactoryKeyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.geode.cache.Declarableinit
- 
Constructor Details- 
LazyWiringDeclarableSupportpublic LazyWiringDeclarableSupport()Constructs a new instance of theLazyWiringDeclarableSupportclass registered with theSpringContextBootstrappingInitializeras a SpringApplicationListener. ThisDeclarableobject will receive notifications from theSpringContextBootstrappingInitializerwhen the Spring context is created and initialized (refreshed). The notification is necessary in order for thisDeclarableobject to be properly configured and initialized with any required, Spring-defined dependencies.
 
- 
- 
Method Details- 
assertInitializedprotected void assertInitialized()Asserts that thisDeclarableobject has been properly configured and initialized by the Spring container after has GemFire constructed thisDeclarableobject during startup. This method is recommended to be called before any of thisDeclarableobject'sCacheCallbackmethods (e.g.CacheLoader.load(LoaderHelper)are invoked in order to ensure that thisDeclarableobject was properly constructed, configured and initialized by the Spring container before hand.- Throws:
- IllegalStateException- if this- Declarableobject was not been properly constructed, configured and initialized by the Spring container.
- See Also:
- 
- Declarable.init(Properties)
- isInitialized()
 
 
- 
assertUninitializedprotected void assertUninitialized()Asserts that thisDeclarableobject has not yet been used, or activated prior to being fully constructed, configured and initialized by the Spring container. It is possible, though rare, that theDeclarable.init(Properties)method might be called multiple times by GemFire before the Spring container constructs, configures, initializes and generally puts this component to use.- Throws:
- IllegalStateException- if the Declarable object has already been configured and initialized by the Spring container.
- See Also:
- 
- Declarable.init(Properties)
- isNotInitialized()
 
 
- 
isInitializedprotected boolean isInitialized()Determines whether thisDeclarableobject has been properly configured and initialized by the Spring container.- Returns:
- a boolean value indicating whether this Declarableobject has been properly configured and initialized by the Spring container.
- See Also:
- 
- doInit(BeanFactory, Properties)
- assertInitialized()
 
 
- 
isNotInitializedprotected boolean isNotInitialized()Determines whether thisDeclarableobject has been properly configured and initialized by the Spring container.- Returns:
- a boolean value indicating whether this Declarableobject has been properly configured and initialized by the Spring container.
- See Also:
- 
- doInit(BeanFactory, Properties)
- isInitialized()
 
 
- 
initializepublic final void initialize(@Nullable org.apache.geode.cache.Cache cache, @NonNull Properties parameters) Initialization method called by GemFire with the configured parameters once thisDeclarableobject has been constructed by GemFire and the <initalizer> element is parsed in GemFire's configuration meta-data during startup.- Specified by:
- initializein interface- org.apache.geode.cache.Declarable
- Overrides:
- initializein class- WiringDeclarableSupport
- Parameters:
- parameters-- Propertiescontaining the configured parameters parsed from GemFire's configuration meta-data (e.g. cache.xml) and passed to this- Declarableobject.
- See Also:
- 
- doInit(BeanFactory, Properties)
- Properties
 
 
- 
doPostInitPerforms any post configuration and initialization activities required by the application. By default, this method does nothing.- Parameters:
- parameters-- Propertiescontaining the configured parameters parsed from GemFire's configuration meta-data (e.g. cache.xml) and passed to this- Declarableobject.
- See Also:
- 
- doInit(BeanFactory, Properties)
- Properties
 
 
- 
nullSafeGetParametersNull-safe operation to return the parameters passed to thisDeclarableobject when created by GemFire from it's own configuration meta-data (e.g. cache.xml).- Returns:
- a Propertiescontaining the configured parameters parsed from GemFire's configuration meta-data (e.g. cache.xml) and passed to thisDeclarableobject.
- See Also:
 
- 
setParametersStores a reference to theparameterspassed to theDeclarable.init(Properties)method.- Parameters:
- parameters-- Propertiescontaining the configured parameters parsed from GemFire's configuration meta-data (e.g. cache.xml) and passed to this- Declarableobject.
- See Also:
 
- 
onApplicationEventpublic final void onApplicationEvent(@NonNull org.springframework.context.event.ContextRefreshedEvent event) Event handler method called when GemFire has created and initialized (refreshed) the SpringApplicationContextusing theSpringContextBootstrappingInitializer.- Specified by:
- onApplicationEventin interface- org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
- Parameters:
- event-- ContextRefreshedEventpublished by the Spring- ApplicationContextafter it is successfully created and initialized by GemFire.
- See Also:
- 
- ContextRefreshedEvent
- doInit(BeanFactory, Properties)
- nullSafeGetParameters()
 
 
- 
destroyWhen thisDeclarableobject/bean gets destroyed by the Spring container,destroy()will make sure this component gets unregistered from theSpringContextBootstrappingInitializerproperly.- Specified by:
- destroyin interface- org.springframework.beans.factory.DisposableBean
- Throws:
- Exception- if bean destruction is unsuccessful.
- See Also:
 
 
- 
