<?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:util="http://www.springframework.org/schema/util"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="
        http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/geode https://www.springframework.org/schema/geode/spring-geode.xsd
        http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
  ">

	<util:properties id="expirationProperties">
		<prop key="gemfire.region.entry.expiration.timeout">60</prop>
		<prop key="gemfire.region.entry.expiration.action.string">LOCAL_INVALIDATE</prop>
		<prop key="gemfire.region.entry.expiration.action.gemfire.type">#{T(org.apache.geode.cache.ExpirationAction).INVALIDATE}</prop>
		<prop key="gemfire.region.entry.expiration.action.spring.type">#{T(org.springframework.data.gemfire.expiration.ExpirationActionType).DESTROY}</prop>
	</util:properties>

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

	<util:properties id="gemfireProperties">
		<prop key="name">AnnotationBasedExpirationConfigurationIntegrationTest</prop>
		<prop key="log-level">error</prop>
	</util:properties>

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

	<bean id="defaultExpirationAttributes" class="org.apache.geode.cache.ExpirationAttributes">
		<constructor-arg value="600"/>
		<constructor-arg value="#{T(org.apache.geode.cache.ExpirationAction).DESTROY}"/>
	</bean>

	<bean id="genericExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"/>

	<bean id="ttiExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
		  factory-method="forIdleTimeout"/>

	<bean id="ttlExpiration" class="org.springframework.data.gemfire.expiration.AnnotationBasedExpiration"
		  factory-method="forTimeToLive">
		<constructor-arg ref="defaultExpirationAttributes"/>
	</bean>

	<gfe:partitioned-region id="Example" persistent="false">
		<gfe:custom-entry-ttl ref="ttlExpiration"/>
		<gfe:custom-entry-tti ref="ttiExpiration"/>
	</gfe:partitioned-region>

</beans>
