* Upgraded to GemFire 6.6.1

* Introduced PDX options for 'cache' and 'client-cache' elements
This commit is contained in:
Costin Leau
2011-11-10 19:32:57 +02:00
parent 62b8948efc
commit d1a2e52c1e
10 changed files with 102 additions and 21 deletions

View File

@@ -15,7 +15,7 @@
<classpathentry kind="lib" path="C:/Users/costin/.gradle/cache/antlr/antlr/jars/antlr-2.7.7.jar" exported="true"/>
<classpathentry sourcepath="C:/Users/costin/.gradle/cache/org.springframework/spring-aop/sources/spring-aop-3.1.0.RC1-sources.jar" kind="lib" path="C:/Users/costin/.gradle/cache/org.springframework/spring-aop/jars/spring-aop-3.1.0.RC1.jar" exported="true"/>
<classpathentry sourcepath="C:/Users/costin/.gradle/cache/log4j/log4j/sources/log4j-1.2.16-sources.jar" kind="lib" path="C:/Users/costin/.gradle/cache/log4j/log4j/bundles/log4j-1.2.16.jar" exported="true"/>
<classpathentry kind="lib" path="C:/Users/costin/.gradle/cache/com.gemstone.gemfire/gemfire/jars/gemfire-6.6.jar" exported="true"/>
<classpathentry kind="lib" path="C:/Users/costin/.gradle/cache/com.gemstone.gemfire/gemfire/jars/gemfire-6.6.1.jar" exported="true"/>
<classpathentry sourcepath="C:/Users/costin/.gradle/cache/org.hamcrest/hamcrest-core/sources/hamcrest-core-1.1-sources.jar" kind="lib" path="C:/Users/costin/.gradle/cache/org.hamcrest/hamcrest-core/jars/hamcrest-core-1.1.jar" exported="true"/>
<classpathentry sourcepath="C:/Users/costin/.gradle/cache/org.springframework/spring-core/sources/spring-core-3.1.0.RC1-sources.jar" kind="lib" path="C:/Users/costin/.gradle/cache/org.springframework/spring-core/jars/spring-core-3.1.0.RC1.jar" exported="true"/>
<classpathentry sourcepath="C:/Users/costin/.gradle/cache/org.objenesis/objenesis/sources/objenesis-1.0-sources.jar" kind="lib" path="C:/Users/costin/.gradle/cache/org.objenesis/objenesis/jars/objenesis-1.0.jar" exported="true"/>

View File

@@ -2,8 +2,12 @@ SPRING GEMFIRE INTEGRATION CHANGELOG
====================================
http://www.springsource.org/spring-gemfire
Changes in version 1.1.0.M4 (2011-mm-dd)
----------------------------------------
Changes in version 1.1.0.RC1 (2011-mm-dd)
-----------------------------------------
General
* Upgraded to GemFire 6.6.1
* Introduced PDX options for 'cache' and 'client-cache' elements
Changes in version 1.1.0.M3 (2011-09-25)

View File

@@ -6,7 +6,7 @@ slf4jVersion = 1.6.1
# Common libraries
springVersion = 3.1.0.RC1
gemfireVersion = 6.6
gemfireVersion = 6.6.1
# Testing
junitVersion = 4.8.1

View File

@@ -74,13 +74,22 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl
}
public void run() {
Assert.isAssignable(PdxSerializer.class, pdxSerializer.getClass(), "Invalid pdx serializer used");
factory.setPdxSerializer((PdxSerializer) pdxSerializer);
factory.setPdxDiskStore(pdxDiskStoreName);
factory.setPdxIgnoreUnreadFields(pdxIgnoreUnreadFields);
factory.setPdxPersistent(pdxPersistent);
factory.setPdxReadSerialized(pdxReadSerialized);
if (pdxSerializer != null) {
Assert.isAssignable(PdxSerializer.class, pdxSerializer.getClass(), "Invalid pdx serializer used");
factory.setPdxSerializer((PdxSerializer) pdxSerializer);
}
if (pdxDiskStoreName != null) {
factory.setPdxDiskStore(pdxDiskStoreName);
}
if (pdxIgnoreUnreadFields != null) {
factory.setPdxIgnoreUnreadFields(pdxIgnoreUnreadFields);
}
if (pdxPersistent != null) {
factory.setPdxPersistent(pdxPersistent);
}
if (pdxReadSerialized != null) {
factory.setPdxReadSerialized(pdxReadSerialized);
}
}
}

View File

@@ -53,13 +53,22 @@ public class ClientCacheFactoryBean extends CacheFactoryBean {
}
public void run() {
Assert.isAssignable(PdxSerializer.class, pdxSerializer.getClass(), "Invalid pdx serializer used");
factory.setPdxSerializer((PdxSerializer) pdxSerializer);
factory.setPdxDiskStore(pdxDiskStoreName);
factory.setPdxIgnoreUnreadFields(pdxIgnoreUnreadFields);
factory.setPdxPersistent(pdxPersistent);
factory.setPdxReadSerialized(pdxReadSerialized);
if (pdxSerializer != null) {
Assert.isAssignable(PdxSerializer.class, pdxSerializer.getClass(), "Invalid pdx serializer used");
factory.setPdxSerializer((PdxSerializer) pdxSerializer);
}
if (pdxDiskStoreName != null) {
factory.setPdxDiskStore(pdxDiskStoreName);
}
if (pdxIgnoreUnreadFields != null) {
factory.setPdxIgnoreUnreadFields(pdxIgnoreUnreadFields);
}
if (pdxPersistent != null) {
factory.setPdxPersistent(pdxPersistent);
}
if (pdxReadSerialized != null) {
factory.setPdxReadSerialized(pdxReadSerialized);
}
}
}

View File

@@ -43,6 +43,11 @@ class CacheParser extends AbstractSingleBeanDefinitionParser {
ParsingUtils.setPropertyValue(element, builder, "cache-xml-location", "cacheXml");
ParsingUtils.setPropertyReference(element, builder, "properties-ref", "properties");
ParsingUtils.setPropertyValue(element, builder, "pdx-serializer", "pdxSerializer");
ParsingUtils.setPropertyValue(element, builder, "pdx-disk-store", "pdxDiskStore");
ParsingUtils.setPropertyValue(element, builder, "pdx-persistent", "pdxPersistent");
ParsingUtils.setPropertyValue(element, builder, "pdx-read-serialized", "pdxReadSerialized");
ParsingUtils.setPropertyValue(element, builder, "pdx-ignore-unread-fields", "pdxIgnoreUnreadFields");
}
@Override

View File

@@ -50,6 +50,57 @@ when the same cache is used in multiple application context/bean factories insid
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="pdx-serializer" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the PDX serializer for the cache. If this serializer is set, it will be consulted to see if it can serialize any
domain classes which are added to the cache in portable data exchange format.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="pdx-disk-store" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the name of the disk store to use for PDX meta data. When serializing objects in the PDX format,
the type definitions are persisted to disk. This setting controls which disk store is used for that persistence.
If not set, the metadata will go in the default disk store.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="pdx-persistent" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Control whether the type metadata for PDX objects is persisted to disk. The default for this setting is true.
If you are using a WAN gateway, or persistent regions, you should leave this set to true.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="pdx-read-serialized" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the object preference to PdxInstance type. When a cached object that was serialized as a PDX is read from the cache
a PdxInstance will be returned instead of the actual domain class. The PdxInstance is an interface that provides run time
access to the fields of a PDX without deserializing the entire PDX. The PdxInstance implementation is a light weight wrapper
that simply refers to the raw bytes of the PDX that are kept in the cache. Using this method applications can choose to
access PdxInstance instead of Java object.
Note that a PdxInstance is only returned if a serialized PDX is found in the cache. If the cache contains a deserialized PDX,
then a domain class instance is returned instead of a PdxInstance.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="pdx-ignore-unread-fields" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Controls whether pdx ignores fields that were unread during deserialization. The default is to preserve unread fields be
including their data during serialization. But if you configure the cache to ignore unread fields then their data will be
lost during serialization.
You should only set this attribute to true if you know this member will only be reading cache data. In this use case you
do not need to pay the cost of preserving the unread fields since you will never be reserializing pdx data.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:element name="cache" type="cacheType">

View File

@@ -30,7 +30,7 @@ import com.gemstone.gemfire.cache.Cache;
*
* @author Costin Leau
*/
public class CacheIntegrationTest extends RecreatingContextTest{
public class CacheIntegrationTest extends RecreatingContextTest {
@Override
protected String location() {
@@ -61,5 +61,4 @@ public class CacheIntegrationTest extends RecreatingContextTest{
public void testCacheWithXml() throws Exception {
Cache cache = ctx.getBean("cache-with-xml", Cache.class);
}
}

View File

@@ -62,6 +62,10 @@ public class CacheNamespaceTest extends RecreatingContextTest {
Resource res = TestUtils.readField("cacheXml", cfb);
assertEquals("gemfire-cache.xml", res.getFilename());
assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb));
assertEquals(Boolean.FALSE, TestUtils.readField("pdxIgnoreUnreadFields", cfb));
assertEquals(Boolean.TRUE, TestUtils.readField("pdxPersistent", cfb));
}
@Test(expected = IllegalArgumentException.class)

View File

@@ -16,7 +16,7 @@
<gfe:cache id="cache-with-name"/>
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:gemfire-cache.xml" properties-ref="props"/>
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:gemfire-cache.xml" properties-ref="props" pdx-ignore-unread-fields="false" pdx-persistent="true"/>
<util:properties id="props">
<prop key="disable-tcp">false</prop>