public abstract class LazyWiringDeclarableSupport extends WiringDeclarableSupport implements ApplicationListener<ContextRefreshedEvent>, DisposableBean
Declarable
interface that enables support for wiring Apache Geode components
with Spring bean dependencies defined in a Spring ApplicationContext
.Properties
,
Cache
,
CacheCallback
,
Declarable
,
BeanFactory
,
DisposableBean
,
ApplicationContext
,
ApplicationListener
,
ContextRefreshedEvent
,
SpringContextBootstrappingInitializer
,
WiringDeclarableSupport
TEMPLATE_BEAN_NAME_PROPERTY
Constructor and Description |
---|
LazyWiringDeclarableSupport()
Constructs a new instance of the
LazyWiringDeclarableSupport class registered with the
SpringContextBootstrappingInitializer as a Spring ApplicationListener . |
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 has GemFire 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 constructed,
configured and initialized by the Spring container. |
void |
destroy()
When this
Declarable object/bean gets destroyed by the Spring container, destroy() will
make sure this component gets unregistered from the SpringContextBootstrappingInitializer properly. |
protected void |
doPostInit(Properties parameters)
Performs any post configuration and initialization activities required by the application.
|
void |
initialize(org.apache.geode.cache.Cache cache,
Properties parameters)
Initialization method called by GemFire with the configured parameters once this
Declarable object
has been constructed by GemFire and the <initalizer> element is parsed
in GemFire's configuration meta-data during startup. |
protected boolean |
isInitialized()
Determines whether this
Declarable object has been properly configured and initialized
by the Spring container. |
protected boolean |
isNotInitialized()
Determines whether this
Declarable object has been properly configured and initialized
by the Spring container. |
protected Properties |
nullSafeGetParameters()
Null-safe operation to return the parameters passed to this
Declarable object when created by GemFire
from it's own configuration meta-data (e.g. |
void |
onApplicationEvent(ContextRefreshedEvent event)
Event handler method called when GemFire has created and initialized (refreshed)
the Spring
ApplicationContext using the SpringContextBootstrappingInitializer . |
protected void |
setParameters(Properties parameters)
Stores a reference to the
parameters passed to the Declarable.init(Properties) method. |
configureThis, configureThis, newBeanConfigurer, newBeanConfigurer
close, getBeanFactory, getBeanFactoryKey, locateBeanFactory, locateBeanFactory, setBeanFactoryKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forPayload
public LazyWiringDeclarableSupport()
LazyWiringDeclarableSupport
class registered with the
SpringContextBootstrappingInitializer
as a Spring ApplicationListener
.
This Declarable
object will receive notifications from the SpringContextBootstrappingInitializer
when the Spring context is created and initialized (refreshed). The notification is necessary in order for
this Declarable
object to be properly configured and initialized with any required,
Spring-defined dependencies.protected void assertInitialized()
Declarable
object has been properly configured and initialized by the Spring container
after has GemFire constructed this Declarable
object during startup.
This method is recommended to be called before any of this Declarable
object's CacheCallback
methods (e.g. CacheLoader.load(LoaderHelper)
are invoked in order to ensure that this Declarable
object was properly constructed, configured and initialized by the Spring container before hand.IllegalStateException
- if this Declarable
object was not been properly constructed, configured
and initialized by the Spring container.Declarable.init(java.util.Properties)
,
isInitialized()
protected void assertUninitialized()
Declarable
object 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 the Declarable.init(Properties)
method might be called multiple times by GemFire
before the Spring container constructs, configures, initializes and generally puts this component to use.IllegalStateException
- if the Declarable object has already been configured and initialized
by the Spring container.Declarable.init(java.util.Properties)
,
isNotInitialized()
protected boolean isInitialized()
Declarable
object has been properly configured and initialized
by the Spring container.Declarable
object has been properly configured
and initialized by the Spring container.doInit(BeanFactory, Properties)
,
assertInitialized()
protected boolean isNotInitialized()
Declarable
object has been properly configured and initialized
by the Spring container.Declarable
object has been properly configured
and initialized by the Spring container.doInit(BeanFactory, Properties)
,
isInitialized()
public final void initialize(@Nullable org.apache.geode.cache.Cache cache, @NonNull Properties parameters)
Declarable
object
has been constructed by GemFire and the <initalizer> element is parsed
in GemFire's configuration meta-data during startup.initialize
in interface org.apache.geode.cache.Declarable
initialize
in class WiringDeclarableSupport
parameters
- Properties
containing the configured parameters parsed from GemFire's
configuration meta-data (e.g. cache.xml) and passed to this Declarable
object.doInit(BeanFactory, Properties)
,
Properties
protected void doPostInit(@NonNull Properties parameters)
parameters
- Properties
containing the configured parameters parsed from GemFire's
configuration meta-data (e.g. cache.xml) and passed to this Declarable
object.doInit(BeanFactory, Properties)
,
Properties
@NonNull protected Properties nullSafeGetParameters()
Declarable
object when created by GemFire
from it's own configuration meta-data (e.g. cache.xml).Properties
containing the configured parameters parsed from GemFire's configuration meta-data
(e.g. cache.xml) and passed to this Declarable
object.Properties
protected void setParameters(@Nullable Properties parameters)
parameters
passed to the Declarable.init(Properties)
method.parameters
- Properties
containing the configured parameters parsed from GemFire's
configuration meta-data (e.g. cache.xml) and passed to this Declarable
object.Properties
public final void onApplicationEvent(@NonNull ContextRefreshedEvent event)
ApplicationContext
using the SpringContextBootstrappingInitializer
.onApplicationEvent
in interface ApplicationListener<ContextRefreshedEvent>
event
- ContextRefreshedEvent
published by the Spring ApplicationContext
after it is
successfully created and initialized by GemFire.ContextRefreshedEvent
,
doInit(BeanFactory, Properties)
,
nullSafeGetParameters()
public void destroy() throws Exception
Declarable
object/bean gets destroyed by the Spring container, destroy()
will
make sure this component gets unregistered from the SpringContextBootstrappingInitializer
properly.destroy
in interface DisposableBean
Exception
- if bean destruction is unsuccessful.#unregister(org.springframework.context.ApplicationListener)
,
setParameters(Properties)
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.