From 0712e532c5cf4e7bd7a9c4fba6029113f318d78f Mon Sep 17 00:00:00 2001 From: costin Date: Fri, 30 Jul 2010 15:43:02 +0300 Subject: [PATCH] + added docs on attribute configs --- docs/src/docbkx/reference/bootstrap.xml | 98 +++++++++++++++---------- 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/docs/src/docbkx/reference/bootstrap.xml b/docs/src/docbkx/reference/bootstrap.xml index 61b399ca..f54f6c1f 100644 --- a/docs/src/docbkx/reference/bootstrap.xml +++ b/docs/src/docbkx/reference/bootstrap.xml @@ -70,16 +70,16 @@ <?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:util="http://www.springframework.org/schema/util" - 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"> - - <bean id="cache-with-props" class="org.springframework.data.gemfire.CacheFactoryBean"> - <property name="properties"> - <util:properties location="classpath:/deployment/env.properties"/> - </property> - </bean> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + 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"> + + <bean id="cache-with-props" class="org.springframework.data.gemfire.CacheFactoryBean"> + <property name="properties"> + <util:properties location="classpath:/deployment/env.properties"/> + </property> + </bean> </beans> It is worth pointing out again, that the cache settings apply only @@ -110,10 +110,10 @@ basic using a nested cache declaration: <bean id="basic" class="org.springframework.data.gemfire.RegionFactoryBean"> - <property name="cache"> - <bean class="org.springframework.data.gemfire.CacheFactoryBean"/> - </property> - <property name="name" value="basic"/> + <property name="cache"> + <bean class="org.springframework.data.gemfire.CacheFactoryBean"/> + </property> + <property name="name" value="basic"/> </bean> Since the region bean definition name is usually the same with that @@ -125,13 +125,13 @@ <?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:p="http://www.springframework.org/schema/p" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:p="http://www.springframework.org/schema/p" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + <!-- shared cache across regions --> <bean id="cache" class="org.springframework.data.gemfire.CacheFactoryBean"/> - + <!-- region named 'basic' --> <bean id="basic" class="org.springframework.data.gemfire.RegionFactoryBean" p:cache-ref="cache"/> @@ -147,18 +147,18 @@ <bean id="cacheLogger" class="org.some.pkg.CacheLogger"/> <bean id="customized-region" class="org.springframework.data.gemfire.RegionFactoryBean" p:cache-ref="cache"> - <property name="cacheListeners"> - <array> - <ref name="cacheLogger"/> - <bean class="org.some.other.pkg.SysoutLogger"/> - </array> - </property> - <property name="cacheLoader"><bean class="org.some.pkg.CacheLoad"/></property> - <property name="cacheWriter"><bean class="org.some.pkg.CacheWrite"/></property> + <property name="cacheListeners"> + <array> + <ref name="cacheLogger"/> + <bean class="org.some.other.pkg.SysoutLogger"/> + </array> + </property> + <property name="cacheLoader"><bean class="org.some.pkg.CacheLoad"/></property> + <property name="cacheWriter"><bean class="org.some.pkg.CacheWrite"/></property> </bean> - + <bean id="local-region" class="org.springframework.data.gemfire.RegionFactoryBean" p:cache-ref="cache"> - <property name="cacheListeners" ref="cacheLogger"/> + <property name="cacheListeners" ref="cacheLogger"/> </bean>
@@ -175,15 +175,37 @@ org.springframework.data.gemfire package: <bean id="interested-client" class="org.springframework.data.gemfire.ClientRegionFactoryBean" p:cache-ref="cache" p:name="client-region"> - <property name="interests"> - <array> - <!-- key-based interest --> - <bean class="org.springframework.data.gemfire.Interest" p:key="Vlaicu" p:policy="NONE"/> - <!-- regex-based interest --> - <bean class="org.springframework.data.gemfire.RegexInterest" p:key=".*" p:policy="KEYS" p:durable="true"/> - </array> - </property> + <property name="interests"> + <array> + <!-- key-based interest --> + <bean class="org.springframework.data.gemfire.Interest" p:key="Vlaicu" p:policy="NONE"/> + <!-- regex-based interest --> + <bean class="org.springframework.data.gemfire.RegexInterest" p:key=".*" p:policy="KEYS" p:durable="true"/> + </array> + </property> </bean>
+ +
+ Advanced configuration through a <interfacename>Region</interfacename>'s <emphasis>attributes</emphasis> + + Users that need fine control over a region, can configure it in Spring by using the attributes property. To ease declarative configuration in Spring, + SGI provides two FactoryBeans for creating RegionAttributes and PartitionAttributes, + namely RegionAttributesFactory and PartitionAttributesFactory. See below an example of configuring a partitioned region through Spring + XML: + + + + + + + + + +]]> + + + By using the attribute factories above, one can reduce the size of the cache.xml or even eliminate it all together. +
- + \ No newline at end of file