SGF-416 - Avoid eager creation of a GemFire DistributedSystem in the PoolFactoryBean by creating a ClientCache first.

This commit is contained in:
John Blum
2016-03-09 18:43:06 -08:00
parent b052f0ac8d
commit 127b62e722
75 changed files with 5797 additions and 1934 deletions

View File

@@ -4,8 +4,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
default-lazy-init="true">
<!-- all beans are lazy to allow the same config to be used between multiple tests -->
<!-- as there can be only one cache per VM -->
<bean class="org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor"/>
<bean id="default-cache" class="org.springframework.data.gemfire.CacheFactoryBean">
<property name="properties">
<props>

View File

@@ -18,7 +18,7 @@
<context:property-placeholder properties-ref="client.properties"/>
<util:properties id="gemfireProperties">
<prop key="log-level">config</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache properties-ref="gemfireProperties" pool-name="locatorPool"/>

View File

@@ -11,13 +11,13 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<util:properties id="client.properties">
<util:properties id="clientProperties">
<prop key="gemfire.cache.client.server.hosts-and-ports">localhost[23579],localhost[23654]</prop>
<prop key="gemfire.cache.client.server.host.3">localhost</prop>
<prop key="gemfire.cache.client.server.port.3">24448</prop>
</util:properties>
<context:property-placeholder properties-ref="client.properties"/>
<context:property-placeholder properties-ref="clientProperties"/>
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>

View File

@@ -14,18 +14,18 @@
">
<util:properties id="client.properties">
<prop key="client.server.host">localhost</prop>
<prop key="client.server.port">42082</prop>
<prop key="gemfire.client.server.host">localhost</prop>
<prop key="gemfire.client.server.port">42084</prop>
</util:properties>
<context:property-placeholder properties-ref="client.properties"/>
<gfe-data:datasource min-connections="1" max-connections="1">
<gfe-data:server host="${client.server.host}" port="${client.server.port}"/>
<gfe-data:server host="${gemfire.client.server.host}" port="${gemfire.client.server.port}"/>
</gfe-data:datasource>
<gfe:client-region id="LocalRegion" shortcut="LOCAL"/>
<gfe:client-region id="ClientOnlyRegion" shortcut="LOCAL"/>
<gfe:client-region id="ServerRegion" shortcut="CACHING_PROXY"/>
<gfe:client-region id="ClientServerRegion" shortcut="CACHING_PROXY"/>
</beans>

View File

@@ -11,12 +11,12 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<util:properties id="server.properties">
<prop key="gemfire.server.host">localhost</prop>
<prop key="gemfire.server.port">42082</prop>
<util:properties id="serverProperties">
<prop key="gemfire.cache.server.host">localhost</prop>
<prop key="gemfire.cache.server.port">42084</prop>
</util:properties>
<context:property-placeholder properties-ref="server.properties"/>
<context:property-placeholder properties-ref="serverProperties"/>
<util:properties id="gemfireProperties">
<prop key="name">GemFireDataSourceIntegrationTestServer</prop>
@@ -26,11 +26,11 @@
<gfe:cache properties-ref="gemfireProperties"/>
<gfe:cache-server auto-startup="true" bind-address="${gemfire.server.host}" port="${gemfire.server.port}"
max-connections="1"/>
<gfe:cache-server bind-address="${gemfire.cache.server.host}" port="${gemfire.cache.server.port}"
auto-startup="true" max-connections="1"/>
<gfe:replicated-region id="ServerRegion" persistent="false"/>
<gfe:replicated-region id="ClientServerRegion" persistent="false"/>
<gfe:partitioned-region id="ExclusiveServerRegion" persistent="false"/>
<gfe:partitioned-region id="ServerOnlyRegion" persistent="false"/>
</beans>

View File

@@ -11,17 +11,18 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<bean class="org.springframework.data.gemfire.client.PoolUsingLocatorsAndServersPropertyPlaceholdersTest.TestBeanFactoryPostProcessor"/>
<util:properties id="client.properties">
<prop key="gemfire.cache.client.locators.hosts-and-ports">backspace,jambox[11235],skullbox[12480]</prop>
<util:properties id="clientProperties">
<prop key="gemfire.cache.client.locator.1.host">pluto</prop>
<prop key="gemfire.cache.client.locator.1.port">20668</prop>
<prop key="gemfire.cache.client.locators.hosts-and-ports">backspace,jambox[11235],skullbox[12480]</prop>
<prop key="gemfire.cache.client.server.1.host">saturn</prop>
<prop key="gemfire.cache.client.server.1.port">41414</prop>
<prop key="gemfire.cache.client.servers.hosts-and-ports">boombox[1234],jambox,toolbox[81$81%]*</prop>
</util:properties>
<context:property-placeholder properties-ref="client.properties"/>
<context:property-placeholder properties-ref="clientProperties"/>
<bean class="org.springframework.data.gemfire.client.PoolUsingLocatorsAndServersPropertyPlaceholdersTest.TestBeanFactoryPostProcessor"/>
<gfe:pool id="locatorPool" locators="${gemfire.cache.client.locators.hosts-and-ports}">
<gfe:locator host="${gemfire.cache.client.locator.1.host}" port="${gemfire.cache.client.locator.1.port}"/>
@@ -33,4 +34,6 @@
<gfe:server host="neptune" port="42424"/>
</gfe:pool>
<gfe:pool id="anotherServerPool" servers="${gemfire.cache.client.servers.hosts-and-ports}"/>
</beans>

View File

@@ -13,7 +13,8 @@
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache properties-ref="gemfireProperties" close="false"/>
<gfe:client-region id="r1" shortcut="LOCAL" ignore-if-exists="true"/>
<gfe:client-cache properties-ref="gemfireProperties" close="false"/>
<gfe:client-region id="Example" shortcut="LOCAL" ignore-if-exists="true"/>
</beans>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<util:properties id="gemfireProperties">
<prop key="name">ClientReadyForEventsTest</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool id="gemfire-pool" subscription-enabled="false">
<gfe:locator host="localhost" port="40403"/>
</gfe:pool>
<gfe:client-cache properties-ref="gemfireProperties" ready-for-events="true"/>
<gfe:client-region id="simple"/>
</beans>

View File

@@ -10,15 +10,11 @@
">
<util:properties id="gemfireProperties">
<prop key="name">ClientCacheTests</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool>
<gfe:locator host="localhost" port="1234"/>
</gfe:pool>
<gfe:client-cache properties-ref="gemfireProperties"/>
<gfe:client-region data-policy="NORMAL" name="ChallengeQuestions" id="challengeQuestionsRegion"/>
<gfe:client-region id="challengeQuestionsRegion" name="ChallengeQuestions" shortcut="LOCAL"/>
</beans>

View File

@@ -17,10 +17,6 @@
<gfe:client-cache properties-ref="gemfireProperties"/>
<gfe:pool>
<gfe:server host="localhost" port="54321"/>
</gfe:pool>
<bean id="localCacheLoader" class="org.springframework.data.gemfire.client.ClientRegionWithCacheLoaderWriterTest$LocalAppDataCacheLoader"/>
<bean id="localCacheWriter" class="org.springframework.data.gemfire.client.ClientRegionWithCacheLoaderWriterTest$LocalAppDataCacheWriter"/>

View File

@@ -12,15 +12,9 @@
<bean class="org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor"/>
<util:properties id="gemfireProperties">
<prop key="name">ClientCacheNamespaceTest</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool id="serverPool">
<gfe:server host="localhost" port="1234"/>
</gfe:pool>
<bean id="reflectionPdxSerializer" class="com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer"/>
<gfe:client-cache cache-xml-location="empty-client-cache.xml" properties-ref="gemfireProperties"

View File

@@ -12,16 +12,15 @@
">
<util:properties id="clientCacheConfigurationSettings">
<prop key="name">cq-client</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache use-bean-factory-locator="false" properties-ref="clientCacheConfigurationSettings" pool-name="clientPool"/>
<gfe:pool id="clientPool" subscription-enabled="true">
<gfe:server host="localhost" port="40404"/>
</gfe:pool>
<gfe:client-cache use-bean-factory-locator="false" properties-ref="clientCacheConfigurationSettings" pool-name="clientPool"/>
<bean id="testErrorHandler" class="org.springframework.data.gemfire.listener.StubErrorHandler"/>
<bean id="testQueryListener" class="org.springframework.data.gemfire.listener.GemfireMDP"/>

View File

@@ -21,16 +21,12 @@
<context:property-placeholder properties-ref="placeholderProperties"/>
<bean class="org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor"/>
<util:properties id="gemfireProperties">
<prop key="name">ClientRegionNamespaceTest</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool id="gemfire-pool" subscription-enabled="false">
<gfe:locator host="localhost" port="40403"/>
</gfe:pool>
<gfe:client-cache properties-ref="gemfireProperties"/>
<gfe:client-region id="simple" name="SimpleRegion"/>

View File

@@ -14,8 +14,6 @@
<context:property-placeholder location="classpath:port.properties"/>
<util:properties id="gemfireProperties">
<prop key="name">PoolNamespaceConfig</prop>
<prop key="mcast-port">0</prop>
<prop key="log-level">warning</prop>
</util:properties>

View File

@@ -12,7 +12,7 @@
">
<util:properties id="gemfireProperties">
<prop key="log-level">config</prop>
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool id="serverPool">

View File

@@ -1,19 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:gfe-data="http://www.springframework.org/schema/data/gemfire"
xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/gemfire http://www.springframework.org/schema/data/gemfire/spring-data-gemfire.xsd">
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<gfe:client-cache use-bean-factory-locator="false" pool-name="gemfirePool"/>
<gfe:client-region id="r1" pool-name="gemfirePool" />
<gfe:pool id="gemfirePool" >
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache properties-ref="gemfireProperties"/>
<gfe:pool>
<gfe:server host="localhost" port="12345"/>
</gfe:pool>
<gfe:client-region id="r1"/>
</beans>

View File

@@ -1,17 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
">
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:pool id="serverBasedPool">
<gfe:server host="localhost" port="15243"/>
</gfe:pool>
<gfe:client-cache pool-name="serverBasedPool"/>
<gfe:client-cache properties-ref="gemfireProperties" pool-name="serverBasedPool"/>
<gfe:client-region id="test-region" pool-name="serverBasedPool" shortcut="PROXY"/>

View File

@@ -11,13 +11,11 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">
<util:properties id="props">
<prop key="name">cq-client</prop>
<prop key="mcast-port">0</prop>
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache use-bean-factory-locator="false"/>
<gfe:client-cache properties-ref="gemfireProperties" use-bean-factory-locator="false"/>
<gfe:pool id="client" subscription-enabled="true">
<gfe:server host="localhost" port="40404"/>

View File

@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
">
<util:properties id="gemfireProperties">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:client-cache properties-ref="gemfireProperties"/>
<gfe:client-region id="Example"/>
<gfe:client-cache />
<gfe:pool>
<gfe:server host="localhost" port="40404"/>
</gfe:pool>
<gfe:client-region id="r1"/>
<bean class="org.springframework.data.gemfire.support.GemfireCacheManager">
<property name="cache" ref="gemfireCache"/>
</bean>
</beans>
</beans>