<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:context="http://www.springframework.org/schema/context"
	   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/context http://www.springframework.org/schema/context/spring-context.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">PartitionedNamespaceConfig</prop>
		<prop key="mcast-port">0</prop>
		<prop key="log-level">warning</prop>
		<prop key="off-heap-memory-size">64m</prop>
	</util:properties>

	<util:properties id="props">
		<prop key="copies">1</prop>
		<prop key="off-heap">true</prop>
		<prop key="totalBuckets">4</prop>
	</util:properties>

	<context:property-placeholder properties-ref="props"/>

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

	<gfe:partitioned-region id="simple"/>

	<gfe:partitioned-region id="options" name="redundant" copies="${copies}" off-heap="${off-heap}" statistics="true"
							total-buckets="${totalBuckets}" close="true" destroy="false">
		<gfe:partition-resolver>
			<bean class="org.springframework.data.gemfire.SimplePartitionResolver"/>
		</gfe:partition-resolver>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="complex" local-max-memory="20">
		<gfe:cache-listener>
			<ref bean="c-listener"/>
			<bean class="org.springframework.data.gemfire.SimpleCacheListener"/>
		</gfe:cache-listener>
		<gfe:cache-loader ref="c-loader"/>
		<gfe:cache-writer ref="c-writer"/>
		<gfe:partition-listener>
			<bean class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest.TestPartitionListener"/>
		</gfe:partition-listener>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="compressed" persistent="false">
		<gfe:compressor>
			<bean class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest$TestCompressor" p:name="testCompressor"/>
		</gfe:compressor>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="fixed">
		<gfe:fixed-partition partition-name="p1" primary="true" num-buckets="3"/>
		<gfe:fixed-partition partition-name="p2"/>
		<gfe:fixed-partition partition-name="p3" primary="true"/>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="listeners" persistent="false">
		<gfe:partition-listener>
			<bean class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest$TestPartitionListener" p:name="X"/>
			<bean class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest$TestPartitionListener" p:name="Y"/>
			<bean class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest$TestPartitionListener" p:name="Z"/>
			<ref bean="p-listener"/>
		</gfe:partition-listener>
	</gfe:partitioned-region>

	<gfe:partitioned-region id="listenerRef" persistent="false">
		<gfe:partition-listener ref="p-listener"/>
	</gfe:partitioned-region>

	<bean id="c-listener" class="org.springframework.data.gemfire.SimpleCacheListener"/>
	<bean id="p-listener" class="org.springframework.data.gemfire.config.xml.PartitionedRegionNamespaceTest$TestPartitionListener" p:name="ABC"/>
	<bean id="c-loader" class="org.springframework.data.gemfire.SimpleCacheLoader"/>
	<bean id="c-writer" class="org.springframework.data.gemfire.SimpleCacheWriter"/>

</beans>
