public abstract class LazyWiringDeclarableSupport extends Object implements ApplicationListener<ContextRefreshedEvent>, com.gemstone.gemfire.cache.Declarable, DisposableBean
Properties
,
DisposableBean
,
ApplicationListener
,
ContextRefreshedEvent
,
DeclarableSupport
,
WiringDeclarableSupport
,
Declarable
Modifier and Type | Field and Description |
---|---|
protected static String |
BEAN_NAME_PARAMETER |
protected boolean |
initialized |
Constructor and Description |
---|
LazyWiringDeclarableSupport()
Constructs an instance of the LazyWiringDeclarableSupport class registered with the
SpringContextBootstrappingInitializer to receive notification when the Spring context is created and initialized
(refreshed) by GemFire in order for this Declarable component to be configured and properly initialized with any
required Spring bean dependencies.
|
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.
|
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.
|
void |
init(Properties parameters)
Initialization method called by GemFire with the 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.
|
void |
onApplicationEvent(ContextRefreshedEvent event)
Event handler method called when GemFire has created and initialized (refreshed) the Spring ApplicationContext
using the SpringContextBootstrappingInitializer Declarable class.
|
protected static final String BEAN_NAME_PARAMETER
protected volatile boolean initialized
public LazyWiringDeclarableSupport()
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 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(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.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 the Declarable object's init method has already been invoked.doInit(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.Properties)
,
Properties
protected boolean isInitialized()
assertInitialized()
,
doInit(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.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.IllegalStateException
- if the parameters have not been passed to this Declarable (i.e. GemFire has not
called this Declarable object's init method yet, which is probably a bug and violates the lifecycle contract
of Declarable GemFire objects).IllegalArgumentException
- if the ApplicationContext is not an instance of ConfigurableApplicationContext.doInit(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.Properties)
,
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)
,
ContextRefreshedEvent
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
- if bean destruction is unsuccessful.SpringContextBootstrappingInitializer.unregister(
org.springframework.context.ApplicationListener)