public abstract class LazyWiringDeclarableSupport extends Object implements ApplicationListener<ContextRefreshedEvent>, com.gemstone.gemfire.cache.Declarable, DisposableBean
Modifier and Type | Field and Description |
---|---|
protected static String |
BEAN_NAME_PARAMETER |
Constructor and Description |
---|
LazyWiringDeclarableSupport()
Constructs an instance of the LazyWiringDeclarableSupport class registered with the
SpringContextBootstrappingInitializer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertInitialized()
Asserts that this Declarable object has been properly configured and initialized by the Spring container
after GemFire has constructed this Declarable object during startup.
|
protected void |
assertUninitialized()
Asserts that this Declarable object has not yet been used, or activated prior to being fully configured
and initialized.
|
void |
destroy()
When this bean gets destroyed by the Spring container, make sure this component gets unregistered from the
SpringContextBootstrappingInitializer.
|
protected void |
doPostInit(Properties parameters)
Default no operation method performed post initialization of this Declarable GemFire component to be overridden
by subclasses for application specific extension and behavior.
|
protected String |
getFactoryKey()
Gets the key used to locate (lookup) the Spring BeanFactory.
|
void |
init(Properties parameters)
Initialization method called by GemFire with configured parameters once this Declarable object has been
constructed during GemFire startup using an <initalizer> element in GemFire's configuration meta-data.
|
protected boolean |
isInitialized()
Determines whether this Declarable object has been configured and initialized (i.e. the doInit method
has been called) by the Spring container.
|
protected boolean |
isNotInitialized()
Determines whether this Declarable object has been configured and initialized (i.e. the doInit method
has been called) by the Spring container.
|
protected BeanFactory |
locateBeanFactory(String factoryKey)
Locates an existing Spring BeanFactory.
|
protected Properties |
nullSafeGetParameters()
Null-safe operation to return the parameters passed to this Declarable object when created by GemFire from it's
configuration meta-data.
|
void |
onApplicationEvent(ContextRefreshedEvent event)
Event handler method called when GemFire has created and initialized (refreshed) the Spring ApplicationContext
using the SpringContextBootstrappingInitializer Declarable class.
|
void |
setFactoryKey(String factoryKey)
Set the key used to locate (lookup) the Spring BeanFactory.
|
protected static final String BEAN_NAME_PARAMETER
public LazyWiringDeclarableSupport()
public final void setFactoryKey(String factoryKey)
factoryKey
- the key used to locate the Spring BeanFactory.BeanFactory
,
GemfireBeanFactoryLocator
,
getFactoryKey()
protected String getFactoryKey()
BeanFactory
,
GemfireBeanFactoryLocator
,
setFactoryKey(String)
protected void assertInitialized()
IllegalStateException
- if the Declarable object has not been properly configured or initialized
by the Spring container.init(java.util.Properties)
,
isInitialized()
protected void assertUninitialized()
IllegalStateException
- if the Declarable object has already been configured and initialized
by the Spring container.init(java.util.Properties)
,
isInitialized()
protected void doPostInit(Properties parameters)
parameters
- Properties instance containing the parameters from GemFire's configuration file
(e.g. cache.xml) to configure and initialize this Declarable object.doInit(BeanFactory, Properties)
public final void init(Properties parameters)
init
in interface com.gemstone.gemfire.cache.Declarable
parameters
- the configured parameters passed from the GemFire configuration (e.g. cache.xml) to this
Declarable as a Properties instance.IllegalStateException
- if this Declarable object has already been configured/initialized
by the Spring container and is currently active.doInit(BeanFactory, Properties)
,
Properties
protected boolean isInitialized()
assertInitialized()
,
doInit(BeanFactory, Properties)
protected boolean isNotInitialized()
doInit(BeanFactory, Properties)
,
isInitialized()
protected BeanFactory locateBeanFactory(String factoryKey)
factoryKey
- the key used to locate (lookup) the Spring BeanFactory.IllegalStateException
- if the BeanFactory has already been released or closed.GemfireBeanFactoryLocator
,
BeanFactory
protected Properties nullSafeGetParameters()
Properties
public final void onApplicationEvent(ContextRefreshedEvent event)
onApplicationEvent
in interface ApplicationListener<ContextRefreshedEvent>
event
- the ContextRefreshedEvent published by the Spring ApplicationContext after it is successfully
created and initialized by GemFire.IllegalArgumentException
- if the ApplicationContext is not an instance of ConfigurableApplicationContext.doInit(BeanFactory, Properties)
,
nullSafeGetParameters()
,
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)
,
ContextRefreshedEvent
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
- if bean destruction is unsuccessful.#unregister(org.springframework.context.ApplicationListener)