Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Complete
-
Affects Version/s: 1.4.4 (Dijkstra SR4), 1.5 GA (Evans)
-
Fix Version/s: 1.4.5 (Dijkstra SR5), 1.5.1 (Evans SR1), 1.6 M1 (Fowler)
-
Environment:Spring + GemFire using cache.xml
Description
Spring Data GemFire's SpringContextBootstrappingInitializer is used by a user to bootstrap a Spring ApplicationContext inside a GemFire JVM process (e.g. GemFire Server) on start.
The user provides a small snippet of cache.xml like so...
<?xml version="1.0"?> <!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 7.0//EN" "http://www.gemstone.com/dtd/cache7_0.dtd"> <cache> <initializer> <class-name>org.springframework.data.gemfire.support.SpringContextBootstrappingInitializer</class-name> <parameter name="contextConfigLocations"> <string> classpath:path/to/spring/application/context.xml </string> </parameter> </initializer> </cache>
And then proceeds to use Gfsh to launch the GemFire Server and bootstrap the Spring ApplicationContext...
gfsh>start server --name=X ... --cache-xml-file=cache.xml
This will enable a Spring ApplicationContext to be started in a GemFire Server process. The benefit of using the SpringContextBootstrappingInitializer is that the GemFire Server can be configured mostly with Spring config (minus the Cache instance). In addition, an GemFire defined components (e.g. CacheListener, CacheLoader, etc) declared in cache.xml can be lazily wired with Spring beans.
There are situations, through rare, where the SpringContextBootstrappingInitializer's (GemFire Delcarables) init(:Properties) method maybe called more than once.
This improvement is meant to handle this case.