<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:gfe="http://www.springframework.org/schema/geode"
	   xmlns:p="http://www.springframework.org/schema/p"
	   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/geode http://www.springframework.org/schema/geode/spring-geode.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
">

	<util:properties id="gemfireProperties">
		<prop key="name">TemplateClientRegionNamespaceTest</prop>
		<prop key="mcast-port">0</prop>
		<prop key="log-level">warning</prop>
	</util:properties>

	<gfe:pool id="ServerPool">
		<gfe:server host="localhost" port="40404"/>
	</gfe:pool>

	<gfe:client-cache properties-ref="gemfireProperties"/>

	<!-- Template Regions -->

	<gfe:region-template id="BaseRegionTemplate" cloning-enabled="true" concurrency-checks-enabled="false"
						 disk-synchronous="false" initial-capacity="51" key-constraint="java.lang.Long"
						 load-factor="0.85" persistent="false" statistics="true" value-constraint="java.lang.String">
		<gfe:cache-listener>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheListener" p:name="X"/>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheListener" p:name="Y"/>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheListener" p:name="Z"/>
		</gfe:cache-listener>
		<gfe:entry-ttl timeout="300" action="INVALIDATE"/>
		<gfe:entry-tti timeout="600" action="DESTROY"/>
	</gfe:region-template>

	<gfe:client-region-template id="ClientRegionTemplate" concurrency-level="4" pool-name="ServerPool" template="BaseRegionTemplate">
		<gfe:cache-loader>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheLoader" p:name="A"/>
		</gfe:cache-loader>
		<gfe:cache-writer>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheWriter" p:name="B"/>
		</gfe:cache-writer>
		<!--
		<gfe:key-interest durable="false" result-policy="KEYS_VALUES" receive-values="true">
			<bean class="java.lang.String">
				<constructor-arg value="ALL_KEYS"/>
			</bean>
		</gfe:key-interest>
		<gfe:regex-interest pattern=".*" receive-values="false"/>
		-->
		<gfe:eviction type="ENTRY_COUNT" threshold="1024" action="LOCAL_DESTROY"/>
	</gfe:client-region-template>

	<gfe:client-region id="TemplateBasedClientRegion" cloning-enabled="false" concurrency-level="16"
					   key-constraint="java.lang.Integer" value-constraint="java.lang.Object"
					   template="ClientRegionTemplate">
		<gfe:cache-listener>
			<bean class="org.springframework.data.gemfire.config.xml.TemplateClientRegionNamespaceTest$TestCacheListener" p:name="XYZ"/>
		</gfe:cache-listener>
		<gfe:eviction type="ENTRY_COUNT" threshold="1024" action="OVERFLOW_TO_DISK"/>
	</gfe:client-region>

</beans>
