From 7376a44ae0e66d0df1cb33929294cace766fe5e6 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 12:11:59 +0300 Subject: [PATCH 01/23] + upgrade to GemFire 6.5.1.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 860f2bc4..b7a74b74 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ limitations under the License. com.gemstone.gemfire gemfire - 6.5.1.2 + 6.5.1.4 compile From bde36ecd2851823a137eac739b5fa218518ddbcc Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 17:48:48 +0300 Subject: [PATCH 02/23] + removed cache support (scheduled for the 1.1.x branch only) --- .../data/gemfire/support/GemfireCache.java | 180 ------------------ .../gemfire/support/GemfireCacheManager.java | 81 -------- .../data/gemfire/support/package-info.java | 10 - .../support/AbstractNativeCacheTest.java | 155 --------------- .../gemfire/support/GemfireCacheTest.java | 57 ------ 5 files changed, 483 deletions(-) delete mode 100644 src/main/java/org/springframework/data/gemfire/support/GemfireCache.java delete mode 100644 src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java delete mode 100644 src/main/java/org/springframework/data/gemfire/support/package-info.java delete mode 100644 src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java delete mode 100644 src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java deleted file mode 100644 index b2b4d627..00000000 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright 2010-2011 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.gemfire.support; - -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.Lock; - -import org.springframework.cache.support.AbstractDelegatingCache; - -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.GemFireCache; -import com.gemstone.gemfire.cache.Region; - -/** - * Spring Framework {@link Cache} implementation using a GemFire {@link Region} underneath. - * Supports both Gemfire 6.5 and 6.0. - * - * @author Costin Leau - */ -public class GemfireCache extends AbstractDelegatingCache { - - private static class NoOpLock implements Lock { - - public void lock() { - } - - public void lockInterruptibly() throws InterruptedException { - } - - public Condition newCondition() { - return null; - } - - public boolean tryLock() { - return false; - } - - public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { - return false; - } - - public void unlock() { - } - }; - - private static final Lock NO_OP_LOCK = new NoOpLock(); - - private static final boolean hasConcurrentMap = ConcurrentMap.class.isAssignableFrom(Region.class); - private final Region region; - private final boolean canUseLock; - private final boolean canUseConcurrentMap; - - /** - * Creates a {@link GemFireCache} instance. - * - * @param region backing GemFire region - */ - public GemfireCache(Region region) { - super(region); - this.region = region; - this.canUseLock = region.getAttributes().getScope().isGlobal(); - DataPolicy dataPolicy = region.getAttributes().getDataPolicy(); - this.canUseConcurrentMap = (hasConcurrentMap && (!dataPolicy.isNormal() && !dataPolicy.isEmpty())); - } - - public String getName() { - return region.getName(); - } - - public Region getNativeCache() { - return region; - } - - public V putIfAbsent(K key, V value) { - if (canUseConcurrentMap) { - return region.putIfAbsent(key, value); - } - - // fall back to pre 6.5 API - Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); - try { - lock.lock(); - if (!region.containsKey(key)) { - return region.put(key, value); - } - else { - return region.get(key); - } - } finally { - lock.unlock(); - } - } - - @SuppressWarnings("unchecked") - public boolean remove(Object key, Object value) { - if (canUseConcurrentMap) { - return region.remove(key, value); - } - - // fall back to pre 6.5 API - if (region.containsKey(key)) { - Lock lock = (canUseLock ? region.getDistributedLock((K) key) : NO_OP_LOCK); - try { - lock.lock(); - - if (region.get(key).equals(value)) { - region.remove(key); - return true; - } - } finally { - lock.unlock(); - } - } - return false; - } - - public boolean replace(K key, V oldValue, V newValue) { - if (canUseConcurrentMap) { - return region.replace(key, oldValue, newValue); - } - - if (region.containsKey(key)) { - // fall back to pre 6.5 API - Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); - - try { - lock.lock(); - - if (region.get(key).equals(oldValue)) { - region.put(key, newValue); - return true; - } - else { - return false; - } - } finally { - lock.unlock(); - } - } - return false; - } - - public V replace(K key, V value) { - if (canUseConcurrentMap) { - return region.replace(key, value); - } - - // fall back to pre 6.5 API - Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); - - try { - lock.lock(); - - if (region.containsKey(key)) { - return region.put(key, value); - } - else { - return null; - } - } finally { - lock.unlock(); - } - } -} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java deleted file mode 100644 index 4aae64ca..00000000 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010-2011 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.gemfire.support; - -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.springframework.cache.Cache; -import org.springframework.cache.CacheManager; -import org.springframework.cache.support.AbstractCacheManager; -import org.springframework.util.Assert; - -import com.gemstone.gemfire.cache.Region; - -/** - * Spring Framework {@link CacheManager} backed by a Gemfire {@link com.gemstone.gemfire.cache.Cache}. Automatically - * discovers the created caches (or {@link Region}s in Gemfire terminology). - * - * @author Costin Leau - */ -@SuppressWarnings("unchecked") -public class GemfireCacheManager extends AbstractCacheManager { - - private com.gemstone.gemfire.cache.Cache gemfireCache; - - - @Override - protected Collection> loadCaches() { - Assert.notNull(gemfireCache, "a backing GemFire cache is required"); - Assert.isTrue(!gemfireCache.isClosed(), "the GemFire cache is closed; an open instance is required"); - - Set> regions = gemfireCache.rootRegions(); - Collection> caches = new LinkedHashSet>(regions.size()); - - for (Region region : regions) { - caches.add(new GemfireCache(region)); - } - - return caches; - } - - public Cache getCache(String name) { - Cache cache = super.getCache(name); - if (cache == null) { - // check the gemfire cache again - // in case the cache was added at runtime - - Region reg = gemfireCache.getRegion(name); - if (reg != null) { - cache = new GemfireCache(reg); - getCacheMap().put(name, cache); - } - } - - return cache; - } - - /** - * Sets the GemFire Cache backing this {@link CacheManager}. - * - * @param gemfireCache - */ - public void setCache(com.gemstone.gemfire.cache.Cache gemfireCache) { - this.gemfireCache = gemfireCache; - } -} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/package-info.java b/src/main/java/org/springframework/data/gemfire/support/package-info.java deleted file mode 100644 index 61b59613..00000000 --- a/src/main/java/org/springframework/data/gemfire/support/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ - -/** - * - * Support package for Spring Gemfire integration. - * - *

Provides Spring 3.1 caching support (Cache and CacheManager implementations on top of Gemfire APIs). - * - */ -package org.springframework.data.gemfire.support; - diff --git a/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java b/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java deleted file mode 100644 index d8f863d6..00000000 --- a/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.gemfire.support; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; - -import org.junit.Before; -import org.junit.Test; -import org.springframework.cache.Cache; - -/** - * Test for native cache implementations. - * - * @author Costin Leau - */ -public abstract class AbstractNativeCacheTest { - - private T nativeCache; - private Cache cache; - protected final static String CACHE_NAME = "testCache"; - - @Before - public void setUp() throws Exception { - nativeCache = createNativeCache(); - cache = createCache(nativeCache); - cache.clear(); - } - - - protected abstract T createNativeCache() throws Exception; - - protected abstract Cache createCache(T nativeCache); - - - @Test - public void testCacheName() throws Exception { - assertEquals(CACHE_NAME, cache.getName()); - } - - @Test - public void testNativeCache() throws Exception { - assertSame(nativeCache, cache.getNativeCache()); - } - - @Test - public void testCachePut() throws Exception { - - Object key = "enescu"; - Object value = "george"; - - assertNull(cache.get(key)); - cache.put(key, value); - assertEquals(value, cache.get(key)); - } - - @Test - public void testCacheRemove() throws Exception { - Object key = "enescu"; - Object value = "george"; - - assertNull(cache.get(key)); - cache.put(key, value); - assertEquals(value, cache.remove(key)); - assertNull(cache.get(key)); - } - - @Test - public void testCacheClear() throws Exception { - assertNull(cache.get("enescu")); - cache.put("enescu", "george"); - assertNull(cache.get("vlaicu")); - cache.put("vlaicu", "aurel"); - cache.clear(); - assertNull(cache.get("vlaicu")); - assertNull(cache.get("enescu")); - } - - // concurrent map tests - @Test - public void testPutIfAbsent() throws Exception { - Object key = "enescu"; - Object value1 = "george"; - Object value2 = "geo"; - - assertNull(cache.get("enescu")); - cache.put(key, value1); - cache.putIfAbsent(key, value2); - assertEquals(value1, cache.get(key)); - } - - @Test - public void testConcurrentRemove() throws Exception { - Object key = "enescu"; - Object value1 = "george"; - Object value2 = "geo"; - - assertNull(cache.get("enescu")); - cache.put(key, value1); - // no remove - cache.remove(key, value2); - assertEquals(value1, cache.get(key)); - // one remove - cache.remove(key, value1); - assertNull(cache.get("enescu")); - } - - @Test - public void testConcurrentReplace() throws Exception { - Object key = "enescu"; - Object value1 = "george"; - Object value2 = "geo"; - - assertNull(cache.get("enescu")); - cache.put(key, value1); - cache.replace(key, value2); - assertEquals(value2, cache.get(key)); - cache.remove(key); - cache.replace(key, value1); - assertNull(cache.get("enescu")); - } - - @Test - public void testConcurrentReplaceIfEqual() throws Exception { - Object key = "enescu"; - Object value1 = "george"; - Object value2 = "geo"; - - assertNull(cache.get("enescu")); - cache.put(key, value1); - assertEquals(value1, cache.get(key)); - // no replace - cache.replace(key, value2, value1); - assertEquals(value1, cache.get(key)); - cache.replace(key, value1, value2); - assertEquals(value2, cache.get(key)); - cache.replace(key, value2, value1); - assertEquals(value1, cache.get(key)); - } -} \ No newline at end of file diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java b/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java deleted file mode 100644 index 1180348a..00000000 --- a/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.gemfire.support; - -import java.util.Properties; - -import org.springframework.cache.Cache; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.distributed.DistributedSystem; - -/** - * @author Costin Leau - */ -public class GemfireCacheTest extends AbstractNativeCacheTest> { - - @Override - protected Cache createCache(Region nativeCache) { - return new GemfireCache(nativeCache); - } - - @Override - protected Region createNativeCache() throws Exception { - com.gemstone.gemfire.cache.Cache instance = null; - try { - instance = CacheFactory.getAnyInstance(); - } catch (Exception ex) { - } - - if (instance == null) { - DistributedSystem ds = DistributedSystem.connect(new Properties()); - instance = CacheFactory.create(ds); - } - Region reg = instance.getRegion(CACHE_NAME); - if (reg == null) { - reg = instance.createRegion(CACHE_NAME, new AttributesFactory().create()); - } - - return reg; - } -} From 724e7d9060ad6a2d913c2d702df224496ea70247 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 17:49:54 +0300 Subject: [PATCH 03/23] + downgrade Spring dependency back to 3.0.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7a74b74..3dad56ee 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ limitations under the License. - 3.1.0.M1 + 3.0.5.RELEASE 4.7 From b53dfbe91e8feb4d1378d227ac3c56303e1460ec Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 18:03:39 +0300 Subject: [PATCH 04/23] + upgrade copyright header --- .../java/org/springframework/data/gemfire/CacheFactoryBean.java | 2 +- .../org/springframework/data/gemfire/DeclarableSupport.java | 2 +- .../java/org/springframework/data/gemfire/GemfireAccessor.java | 2 +- .../springframework/data/gemfire/GemfireBeanFactoryLocator.java | 2 +- .../org/springframework/data/gemfire/GemfireCacheUtils.java | 2 +- .../java/org/springframework/data/gemfire/GemfireCallback.java | 2 +- .../data/gemfire/GemfireCancellationException.java | 2 +- .../org/springframework/data/gemfire/GemfireIndexException.java | 2 +- .../org/springframework/data/gemfire/GemfireQueryException.java | 2 +- .../springframework/data/gemfire/GemfireSystemException.java | 2 +- .../java/org/springframework/data/gemfire/GemfireTemplate.java | 2 +- .../springframework/data/gemfire/GemfireTransactionManager.java | 2 +- .../data/gemfire/PartitionAttributesFactoryBean.java | 2 +- .../data/gemfire/RegionAttributesFactoryBean.java | 2 +- .../org/springframework/data/gemfire/RegionFactoryBean.java | 2 +- .../springframework/data/gemfire/RegionLookupFactoryBean.java | 2 +- .../springframework/data/gemfire/WiringDeclarableSupport.java | 2 +- .../data/gemfire/client/ClientRegionFactoryBean.java | 2 +- .../java/org/springframework/data/gemfire/client/Interest.java | 2 +- .../org/springframework/data/gemfire/client/PoolConnection.java | 2 +- .../springframework/data/gemfire/client/PoolFactoryBean.java | 2 +- .../org/springframework/data/gemfire/client/RegexInterest.java | 2 +- .../org/springframework/data/gemfire/config/CacheParser.java | 2 +- .../springframework/data/gemfire/config/ClientRegionParser.java | 2 +- .../data/gemfire/config/DiskWriteAttributesFactoryBean.java | 2 +- .../data/gemfire/config/EvictionAttributesFactoryBean.java | 2 +- .../org/springframework/data/gemfire/config/EvictionType.java | 2 +- .../data/gemfire/config/GemfireNamespaceHandler.java | 2 +- .../springframework/data/gemfire/config/LookupRegionParser.java | 2 +- .../org/springframework/data/gemfire/config/ParsingUtils.java | 2 +- .../data/gemfire/config/PartitionedRegionParser.java | 2 +- .../org/springframework/data/gemfire/config/PoolParser.java | 2 +- .../data/gemfire/config/ReplicatedRegionParser.java | 2 +- .../data/gemfire/config/TransactionManagerParser.java | 2 +- .../data/gemfire/serialization/AsmInstantiatorGenerator.java | 2 +- .../data/gemfire/serialization/EnumSerializer.java | 2 +- .../data/gemfire/serialization/InstantiatorFactoryBean.java | 2 +- .../data/gemfire/serialization/InstantiatorGenerator.java | 2 +- .../org/springframework/data/gemfire/CacheIntegrationTest.java | 2 +- .../org/springframework/data/gemfire/DeclarableSupportTest.java | 2 +- .../data/gemfire/GemfireBeanFactoryLocatorTest.java | 2 +- .../org/springframework/data/gemfire/RecreatingContextTest.java | 2 +- .../org/springframework/data/gemfire/SimpleCacheListener.java | 2 +- .../org/springframework/data/gemfire/SimpleCacheLoader.java | 2 +- .../org/springframework/data/gemfire/SimpleCacheWriter.java | 2 +- .../org/springframework/data/gemfire/SimpleObjectSizer.java | 2 +- .../springframework/data/gemfire/SimplePartitionResolver.java | 2 +- src/test/java/org/springframework/data/gemfire/TestUtils.java | 2 +- .../org/springframework/data/gemfire/TxIntegrationTest.java | 2 +- src/test/java/org/springframework/data/gemfire/UserObject.java | 2 +- .../data/gemfire/client/RegionIntegrationTest.java | 2 +- .../springframework/data/gemfire/config/CacheNamespaceTest.java | 2 +- .../data/gemfire/config/ClientRegionNamespaceTest.java | 2 +- .../gemfire/config/DiskStoreAndEvictionRegionParsingTest.java | 2 +- .../data/gemfire/config/PartitionedRegionNamespaceTest.java | 2 +- .../springframework/data/gemfire/config/PoolNamespaceTest.java | 2 +- .../data/gemfire/config/ReplicatedRegionNamespaceTest.java | 2 +- .../data/gemfire/config/TxManagerNamespaceTest.java | 2 +- .../data/gemfire/serialization/AsmInstantiatorFactoryTest.java | 2 +- .../data/gemfire/serialization/WiringInstantiatorTest.java | 2 +- 60 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java index c1ec3ac3..8e805dd2 100644 --- a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java index 7d63e977..7fd60b62 100644 --- a/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java index dbccc62c..fa847eb6 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java index ffb138b0..0e62916a 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java index 55686fef..cc444b80 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java index 5b8877cc..f20f767e 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java b/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java index b807240b..44d1eebd 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java b/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java index d691c9da..937e824b 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java b/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java index 9927397a..0df09a04 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java b/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java index d735cab3..5c7e5823 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java index 5aabafb0..e44b4467 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java index 5606dd4a..c77df22a 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java index 84ef0d13..f2826ea7 100644 --- a/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java index cbb5b584..23febbc9 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java index 59cc6cbe..dcfebb18 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java index 1fc9ec2f..85a05c53 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java index 0087eed8..fe64c4f4 100644 --- a/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java index c7601782..4a33599e 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/client/Interest.java b/src/main/java/org/springframework/data/gemfire/client/Interest.java index 56f021bc..57f74087 100644 --- a/src/main/java/org/springframework/data/gemfire/client/Interest.java +++ b/src/main/java/org/springframework/data/gemfire/client/Interest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java b/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java index daeffea4..7a72e0fe 100644 --- a/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java +++ b/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java index ba429cf4..9bab6b96 100644 --- a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java b/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java index a26c524f..ea14184f 100644 --- a/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java +++ b/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java index 8b4b1439..343fafc8 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java index c6b31ef8..e0a39fa2 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java index 016d38ff..32ada080 100644 --- a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java index ebdb1801..415343dc 100644 --- a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/EvictionType.java b/src/main/java/org/springframework/data/gemfire/config/EvictionType.java index fe935025..880bbf98 100644 --- a/src/main/java/org/springframework/data/gemfire/config/EvictionType.java +++ b/src/main/java/org/springframework/data/gemfire/config/EvictionType.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java index e2a1dcd5..bd2f1045 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java index d58b8606..8c4c925e 100644 --- a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java index e7b2fcd9..38bc6be6 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java index 39567fc5..42645e9e 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/PoolParser.java b/src/main/java/org/springframework/data/gemfire/config/PoolParser.java index 6b2483bf..968dad4f 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PoolParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/PoolParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java index 8caea003..9a319fa6 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java b/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java index 6fef52c3..b5cf6c65 100644 --- a/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java b/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java index 6cfca3f5..3cd71ae5 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java b/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java index fdb6fb0f..54f5f0f0 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java index e8830295..0b90c7dc 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java index e7e57547..4c05a9eb 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java index 14441d78..d2bfc72b 100644 --- a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java index 9eaba86d..618932e7 100644 --- a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java +++ b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java index ae02e198..9e319e07 100644 --- a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java +++ b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java index c578a925..f2282dc1 100644 --- a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java +++ b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java index 3a90bc04..76e6220d 100644 --- a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java +++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java index 2dfb5634..40df9573 100644 --- a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java +++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java index 4b3ae8e5..486af831 100644 --- a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java +++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java index 6f8b97d7..d8c140e4 100644 --- a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java +++ b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java index 740dc209..cf46a0c3 100644 --- a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java +++ b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/TestUtils.java b/src/test/java/org/springframework/data/gemfire/TestUtils.java index 1eced00e..39e615b9 100644 --- a/src/test/java/org/springframework/data/gemfire/TestUtils.java +++ b/src/test/java/org/springframework/data/gemfire/TestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java index 21385ef4..755eeae0 100644 --- a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/UserObject.java b/src/test/java/org/springframework/data/gemfire/UserObject.java index 46f50246..59311c60 100644 --- a/src/test/java/org/springframework/data/gemfire/UserObject.java +++ b/src/test/java/org/springframework/data/gemfire/UserObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java index 7ef7921f..3c56e761 100644 --- a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java index 08768d69..675392ff 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java index 307c3fd6..2b8ca351 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java index 4700a40b..6f9b2b72 100644 --- a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java index d8059894..3b95a617 100644 --- a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java index 64d53739..e042b488 100644 --- a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java index c8aa6794..56eaf569 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java index 8e752f4f..f6d1e4a6 100644 --- a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java index d0693e84..aac59925 100644 --- a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java +++ b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java index 36008fa2..8d09482c 100644 --- a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java +++ b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 the original author or authors. + * Copyright 2010-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 688789e4860b6db2c980af57c6b7db32d03b61a9 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 18:08:18 +0300 Subject: [PATCH 05/23] Revert "+ removed cache support (scheduled for the 1.1.x branch only)" This reverts commit bde36ecd2851823a137eac739b5fa218518ddbcc. --- .../data/gemfire/support/GemfireCache.java | 180 ++++++++++++++++++ .../gemfire/support/GemfireCacheManager.java | 81 ++++++++ .../data/gemfire/support/package-info.java | 10 + .../support/AbstractNativeCacheTest.java | 155 +++++++++++++++ .../gemfire/support/GemfireCacheTest.java | 57 ++++++ 5 files changed, 483 insertions(+) create mode 100644 src/main/java/org/springframework/data/gemfire/support/GemfireCache.java create mode 100644 src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java create mode 100644 src/main/java/org/springframework/data/gemfire/support/package-info.java create mode 100644 src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java create mode 100644 src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java new file mode 100644 index 00000000..b2b4d627 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java @@ -0,0 +1,180 @@ +/* + * Copyright 2010-2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.support; + +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; + +import org.springframework.cache.support.AbstractDelegatingCache; + +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.GemFireCache; +import com.gemstone.gemfire.cache.Region; + +/** + * Spring Framework {@link Cache} implementation using a GemFire {@link Region} underneath. + * Supports both Gemfire 6.5 and 6.0. + * + * @author Costin Leau + */ +public class GemfireCache extends AbstractDelegatingCache { + + private static class NoOpLock implements Lock { + + public void lock() { + } + + public void lockInterruptibly() throws InterruptedException { + } + + public Condition newCondition() { + return null; + } + + public boolean tryLock() { + return false; + } + + public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { + return false; + } + + public void unlock() { + } + }; + + private static final Lock NO_OP_LOCK = new NoOpLock(); + + private static final boolean hasConcurrentMap = ConcurrentMap.class.isAssignableFrom(Region.class); + private final Region region; + private final boolean canUseLock; + private final boolean canUseConcurrentMap; + + /** + * Creates a {@link GemFireCache} instance. + * + * @param region backing GemFire region + */ + public GemfireCache(Region region) { + super(region); + this.region = region; + this.canUseLock = region.getAttributes().getScope().isGlobal(); + DataPolicy dataPolicy = region.getAttributes().getDataPolicy(); + this.canUseConcurrentMap = (hasConcurrentMap && (!dataPolicy.isNormal() && !dataPolicy.isEmpty())); + } + + public String getName() { + return region.getName(); + } + + public Region getNativeCache() { + return region; + } + + public V putIfAbsent(K key, V value) { + if (canUseConcurrentMap) { + return region.putIfAbsent(key, value); + } + + // fall back to pre 6.5 API + Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); + try { + lock.lock(); + if (!region.containsKey(key)) { + return region.put(key, value); + } + else { + return region.get(key); + } + } finally { + lock.unlock(); + } + } + + @SuppressWarnings("unchecked") + public boolean remove(Object key, Object value) { + if (canUseConcurrentMap) { + return region.remove(key, value); + } + + // fall back to pre 6.5 API + if (region.containsKey(key)) { + Lock lock = (canUseLock ? region.getDistributedLock((K) key) : NO_OP_LOCK); + try { + lock.lock(); + + if (region.get(key).equals(value)) { + region.remove(key); + return true; + } + } finally { + lock.unlock(); + } + } + return false; + } + + public boolean replace(K key, V oldValue, V newValue) { + if (canUseConcurrentMap) { + return region.replace(key, oldValue, newValue); + } + + if (region.containsKey(key)) { + // fall back to pre 6.5 API + Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); + + try { + lock.lock(); + + if (region.get(key).equals(oldValue)) { + region.put(key, newValue); + return true; + } + else { + return false; + } + } finally { + lock.unlock(); + } + } + return false; + } + + public V replace(K key, V value) { + if (canUseConcurrentMap) { + return region.replace(key, value); + } + + // fall back to pre 6.5 API + Lock lock = (canUseLock ? region.getDistributedLock(key) : NO_OP_LOCK); + + try { + lock.lock(); + + if (region.containsKey(key)) { + return region.put(key, value); + } + else { + return null; + } + } finally { + lock.unlock(); + } + } +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java new file mode 100644 index 00000000..4aae64ca --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010-2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.support; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.cache.support.AbstractCacheManager; +import org.springframework.util.Assert; + +import com.gemstone.gemfire.cache.Region; + +/** + * Spring Framework {@link CacheManager} backed by a Gemfire {@link com.gemstone.gemfire.cache.Cache}. Automatically + * discovers the created caches (or {@link Region}s in Gemfire terminology). + * + * @author Costin Leau + */ +@SuppressWarnings("unchecked") +public class GemfireCacheManager extends AbstractCacheManager { + + private com.gemstone.gemfire.cache.Cache gemfireCache; + + + @Override + protected Collection> loadCaches() { + Assert.notNull(gemfireCache, "a backing GemFire cache is required"); + Assert.isTrue(!gemfireCache.isClosed(), "the GemFire cache is closed; an open instance is required"); + + Set> regions = gemfireCache.rootRegions(); + Collection> caches = new LinkedHashSet>(regions.size()); + + for (Region region : regions) { + caches.add(new GemfireCache(region)); + } + + return caches; + } + + public Cache getCache(String name) { + Cache cache = super.getCache(name); + if (cache == null) { + // check the gemfire cache again + // in case the cache was added at runtime + + Region reg = gemfireCache.getRegion(name); + if (reg != null) { + cache = new GemfireCache(reg); + getCacheMap().put(name, cache); + } + } + + return cache; + } + + /** + * Sets the GemFire Cache backing this {@link CacheManager}. + * + * @param gemfireCache + */ + public void setCache(com.gemstone.gemfire.cache.Cache gemfireCache) { + this.gemfireCache = gemfireCache; + } +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/package-info.java b/src/main/java/org/springframework/data/gemfire/support/package-info.java new file mode 100644 index 00000000..61b59613 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/support/package-info.java @@ -0,0 +1,10 @@ + +/** + * + * Support package for Spring Gemfire integration. + * + *

Provides Spring 3.1 caching support (Cache and CacheManager implementations on top of Gemfire APIs). + * + */ +package org.springframework.data.gemfire.support; + diff --git a/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java b/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java new file mode 100644 index 00000000..d8f863d6 --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/support/AbstractNativeCacheTest.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.support; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.cache.Cache; + +/** + * Test for native cache implementations. + * + * @author Costin Leau + */ +public abstract class AbstractNativeCacheTest { + + private T nativeCache; + private Cache cache; + protected final static String CACHE_NAME = "testCache"; + + @Before + public void setUp() throws Exception { + nativeCache = createNativeCache(); + cache = createCache(nativeCache); + cache.clear(); + } + + + protected abstract T createNativeCache() throws Exception; + + protected abstract Cache createCache(T nativeCache); + + + @Test + public void testCacheName() throws Exception { + assertEquals(CACHE_NAME, cache.getName()); + } + + @Test + public void testNativeCache() throws Exception { + assertSame(nativeCache, cache.getNativeCache()); + } + + @Test + public void testCachePut() throws Exception { + + Object key = "enescu"; + Object value = "george"; + + assertNull(cache.get(key)); + cache.put(key, value); + assertEquals(value, cache.get(key)); + } + + @Test + public void testCacheRemove() throws Exception { + Object key = "enescu"; + Object value = "george"; + + assertNull(cache.get(key)); + cache.put(key, value); + assertEquals(value, cache.remove(key)); + assertNull(cache.get(key)); + } + + @Test + public void testCacheClear() throws Exception { + assertNull(cache.get("enescu")); + cache.put("enescu", "george"); + assertNull(cache.get("vlaicu")); + cache.put("vlaicu", "aurel"); + cache.clear(); + assertNull(cache.get("vlaicu")); + assertNull(cache.get("enescu")); + } + + // concurrent map tests + @Test + public void testPutIfAbsent() throws Exception { + Object key = "enescu"; + Object value1 = "george"; + Object value2 = "geo"; + + assertNull(cache.get("enescu")); + cache.put(key, value1); + cache.putIfAbsent(key, value2); + assertEquals(value1, cache.get(key)); + } + + @Test + public void testConcurrentRemove() throws Exception { + Object key = "enescu"; + Object value1 = "george"; + Object value2 = "geo"; + + assertNull(cache.get("enescu")); + cache.put(key, value1); + // no remove + cache.remove(key, value2); + assertEquals(value1, cache.get(key)); + // one remove + cache.remove(key, value1); + assertNull(cache.get("enescu")); + } + + @Test + public void testConcurrentReplace() throws Exception { + Object key = "enescu"; + Object value1 = "george"; + Object value2 = "geo"; + + assertNull(cache.get("enescu")); + cache.put(key, value1); + cache.replace(key, value2); + assertEquals(value2, cache.get(key)); + cache.remove(key); + cache.replace(key, value1); + assertNull(cache.get("enescu")); + } + + @Test + public void testConcurrentReplaceIfEqual() throws Exception { + Object key = "enescu"; + Object value1 = "george"; + Object value2 = "geo"; + + assertNull(cache.get("enescu")); + cache.put(key, value1); + assertEquals(value1, cache.get(key)); + // no replace + cache.replace(key, value2, value1); + assertEquals(value1, cache.get(key)); + cache.replace(key, value1, value2); + assertEquals(value2, cache.get(key)); + cache.replace(key, value2, value1); + assertEquals(value1, cache.get(key)); + } +} \ No newline at end of file diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java b/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java new file mode 100644 index 00000000..1180348a --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/support/GemfireCacheTest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.support; + +import java.util.Properties; + +import org.springframework.cache.Cache; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.distributed.DistributedSystem; + +/** + * @author Costin Leau + */ +public class GemfireCacheTest extends AbstractNativeCacheTest> { + + @Override + protected Cache createCache(Region nativeCache) { + return new GemfireCache(nativeCache); + } + + @Override + protected Region createNativeCache() throws Exception { + com.gemstone.gemfire.cache.Cache instance = null; + try { + instance = CacheFactory.getAnyInstance(); + } catch (Exception ex) { + } + + if (instance == null) { + DistributedSystem ds = DistributedSystem.connect(new Properties()); + instance = CacheFactory.create(ds); + } + Region reg = instance.getRegion(CACHE_NAME); + if (reg == null) { + reg = instance.createRegion(CACHE_NAME, new AttributesFactory().create()); + } + + return reg; + } +} From 5ad8a98fd5533c7d71a875f2594609522c12cf16 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 30 Mar 2011 18:09:08 +0300 Subject: [PATCH 06/23] Revert "+ downgrade Spring dependency back to 3.0.5" This reverts commit 724e7d9060ad6a2d913c2d702df224496ea70247. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3dad56ee..b7a74b74 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ limitations under the License. - 3.0.5.RELEASE + 3.1.0.M1 4.7 From c334d9142be677de2e45ee2754d4a86e2d7149fa Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 20 Apr 2011 20:01:07 +0300 Subject: [PATCH 07/23] SGF-41 + added statistics attribute for all write regions into SGF namespace --- .../data/gemfire/config/ClientRegionParser.java | 2 ++ .../data/gemfire/config/ParsingUtils.java | 5 +++++ .../data/gemfire/config/PartitionedRegionParser.java | 1 + .../data/gemfire/config/ReplicatedRegionParser.java | 2 ++ .../data/gemfire/config/spring-gemfire-1.0.xsd | 10 +++++++++- .../gemfire/config/PartitionedRegionNamespaceTest.java | 2 ++ .../data/gemfire/config/partitioned-ns.xml | 2 +- 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java index e0a39fa2..22affcea 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java @@ -89,6 +89,8 @@ class ClientRegionParser extends AliasReplacingBeanDefinitionParser { // client attributes BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class); + ParsingUtils.parseStatistics(element, attrBuilder); + boolean overwriteDataPolicy = false; overwriteDataPolicy |= ParsingUtils.parseEviction(parserContext, element, attrBuilder); diff --git a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java index 38bc6be6..de338990 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java @@ -217,4 +217,9 @@ abstract class ParsingUtils { attrBuilder.addPropertyValue("evictionAttributes", evictionDefBuilder.getBeanDefinition()); return true; } + + + static void parseStatistics(Element element, BeanDefinitionBuilder attrBuilder) { + setPropertyValue(element, attrBuilder, "statistics", "statisticsEnabled"); + } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java index 42645e9e..b4f2bc16 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java @@ -78,6 +78,7 @@ class PartitionedRegionParser extends AliasReplacingBeanDefinitionParser { ParsingUtils.parseEviction(parserContext, element, attrBuilder); ParsingUtils.parseDiskStorage(element, attrBuilder); + ParsingUtils.parseStatistics(element, attrBuilder); // partition attributes BeanDefinitionBuilder parAttrBuilder = BeanDefinitionBuilder.genericBeanDefinition(PartitionAttributesFactoryBean.class); diff --git a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java index 9a319fa6..b79852d4 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java @@ -64,6 +64,8 @@ class ReplicatedRegionParser extends AliasReplacingBeanDefinitionParser { // add attributes BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class); + ParsingUtils.parseStatistics(element, attrBuilder); + attr = element.getAttribute("publisher"); if (StringUtils.hasText(attr)) { attrBuilder.addPropertyValue("publisher", Boolean.valueOf(attr)); diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd index 9a92af95..ed534103 100644 --- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd +++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd @@ -6,7 +6,7 @@ targetNamespace="http://www.springframework.org/schema/gemfire" elementFormDefault="qualified" attributeFormDefault="unqualified" - version="1.0"> + version="1.0.1"> @@ -228,6 +228,14 @@ Note: destroy and close are mutually exclusive. Enabling one will automatically ]]> + + + + + diff --git a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java index 3b95a617..15b6624b 100644 --- a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java @@ -61,6 +61,8 @@ public class PartitionedRegionNamespaceTest { assertEquals("redundant", TestUtils.readField("name", fb)); RegionAttributes attrs = TestUtils.readField("attributes", fb); + assertTrue(attrs.getStatisticsEnabled()); + PartitionAttributes pAttr = attrs.getPartitionAttributes(); assertEquals(1, pAttr.getRedundantCopies()); diff --git a/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml index 67a251f4..c2a2a803 100644 --- a/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml +++ b/src/test/resources/org/springframework/data/gemfire/config/partitioned-ns.xml @@ -12,7 +12,7 @@ - + From 923ba1086ed7cfc550d61fd57da4f5c6f66a3e78 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 20 Apr 2011 20:20:06 +0300 Subject: [PATCH 08/23] + add dedicated transaction commit exception (to differentiate between generic tx system exception and optmistic locking ones) --- .../GemfireTransactionCommitException.java | 43 +++++++++++++++++++ .../gemfire/GemfireTransactionManager.java | 4 +- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java new file mode 100644 index 00000000..d9c1f0ef --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java @@ -0,0 +1,43 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire; + +import com.gemstone.gemfire.cache.TransactionException; + +/** + * Gemfire-specific subclass of {@link org.springframework.transaction.TransactionException}, indicating a transaction failure at commit time. + * + * @author Costin Leau + */ +public class GemfireTransactionCommitException extends TransactionException { + + public GemfireTransactionCommitException() { + super(); + } + + public GemfireTransactionCommitException(String message, Throwable cause) { + super(message, cause); + } + + public GemfireTransactionCommitException(String message) { + super(message); + } + + public GemfireTransactionCommitException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java index c77df22a..8a0f2d45 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java @@ -22,7 +22,6 @@ import org.springframework.transaction.NoTransactionException; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionException; -import org.springframework.transaction.TransactionSystemException; import org.springframework.transaction.support.AbstractPlatformTransactionManager; import org.springframework.transaction.support.DefaultTransactionStatus; import org.springframework.transaction.support.ResourceTransactionManager; @@ -138,8 +137,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage throw new NoTransactionException( "No transaction associated with the current thread; are there multiple transaction managers ?", ex); } catch (CommitConflictException ex) { - // TODO: can this be replaced with HeuristicCompletionException ? - throw new TransactionSystemException("Unexpected failure on commit of Cache local transaction", ex); + throw new GemfireTransactionCommitException("Unexpected failure on commit of Cache local transaction", ex); } } From 70d7f6845d7a42b255b7f76b67ab291d335dd803 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 20 Apr 2011 20:43:44 +0300 Subject: [PATCH 09/23] SGF-42 + add GemfireDaoSupport class --- .../gemfire/support/GemfireDaoSupport.java | 87 +++++++++++++++++++ .../data/gemfire/support/package-info.java | 9 ++ .../support/GemfireDaoSupportTests.java | 56 ++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java create mode 100644 src/main/java/org/springframework/data/gemfire/support/package-info.java create mode 100644 src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java new file mode 100644 index 00000000..e45b5c0b --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java @@ -0,0 +1,87 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.support; + +import org.springframework.dao.support.DaoSupport; +import org.springframework.data.gemfire.GemfireTemplate; +import org.springframework.util.Assert; + +import com.gemstone.gemfire.cache.Region; + +/** + * Convenient super class for GemFire data access objects. Intended for + * GemfireTemplate usage. + * + *

Requires an EntityManagerFactory or EntityManager to be set, + * providing a JpaTemplate based on it to subclasses. Can alternatively + * be initialized directly via a JpaTemplate, to reuse the latter's + * settings such as the EntityManagerFactory, JpaDialect, flush mode, etc. + * + *

This class will create its own GemfireTemplate if an EntityManagerFactory + * or EntityManager reference is passed in. A custom JpaTemplate instance + * can be used through overriding createJpaTemplate. + * + * @author Costin Leau + */ +public class GemfireDaoSupport extends DaoSupport { + + private GemfireTemplate gemfireTemplate; + + /** + * Sets the GemFire Region to be used by this DAO. + * Will automatically create a GemfireTemplate for the given Region. + * + * @param region + */ + public void setRegion(Region region) { + this.gemfireTemplate = createGemfireTemplate(region); + } + + /** + * Creates a GemfireTemplate for the given Region. + *

Can be overridden in subclasses to provide a GemfireTemplate instance + * with different configuration, or a custom GemfireTemplate subclass. + * @param region the GemFire Region to create a GemfireTemplate for + * @return the new GemfireTemplate instance + * @see #setRegion + */ + protected GemfireTemplate createGemfireTemplate(Region region) { + return new GemfireTemplate(region); + } + + /** + * Set the GemfireTemplate for this DAO explicitly, + * as an alternative to specifying a GemFire {@link Region}. + * @see #setRegion + */ + public final void setGemfireTemplate(GemfireTemplate gemfireTemplate) { + this.gemfireTemplate = gemfireTemplate; + } + + /** + * Return the GemfireTemplate for this DAO, pre-initialized + * with the Region or set explicitly. + */ + public final GemfireTemplate getGemfireTemplate() { + return gemfireTemplate; + } + + @Override + protected final void checkDaoConfig() { + Assert.notNull(gemfireTemplate, "region or gemfireTemplate is required"); + } +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/package-info.java b/src/main/java/org/springframework/data/gemfire/support/package-info.java new file mode 100644 index 00000000..e8a2b621 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/support/package-info.java @@ -0,0 +1,9 @@ + +/** + * + * Classes supporting the org.springframework.data.gemfire package. + * Contains a DAO base class for GemfireTemplate usage. + * + */ +package org.springframework.data.gemfire.support; + diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java new file mode 100644 index 00000000..5b369dda --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java @@ -0,0 +1,56 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.gemfire.support; + +import java.util.ArrayList; +import java.util.List; + +import junit.framework.TestCase; + +import org.springframework.data.gemfire.GemfireTemplate; + +/** + * @author Costin Leau + * + */ +public class GemfireDaoSupportTests extends TestCase { + + public void testGemfireDaoSupportWithTemplate() throws Exception { + GemfireTemplate template = new GemfireTemplate(); + final List test = new ArrayList(); + GemfireDaoSupport dao = new GemfireDaoSupport() { + protected void initDao() { + test.add("test"); + } + }; + dao.setGemfireTemplate(template); + dao.afterPropertiesSet(); + assertNotNull("template not created", dao.getGemfireTemplate()); + assertEquals("incorrect template", template, dao.getGemfireTemplate()); + assertEquals("initDao not called", test.size(), 1); + } + + public void testInvalidDaoTemplate() throws Exception { + GemfireDaoSupport dao = new GemfireDaoSupport() { + }; + try { + dao.afterPropertiesSet(); + fail("expected exception"); + } catch (IllegalArgumentException iae) { + // okay + } + } +} \ No newline at end of file From 26062e5e02225ad3d3f9fb1e8ab10e649c5417fc Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Thu, 21 Apr 2011 20:58:27 +0300 Subject: [PATCH 10/23] SGF-44 + loosen constraints in the schema to allow the PPC to be plugged in on all fields --- .../gemfire/config/spring-gemfire-1.0.xsd | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd index ed534103..2a69a302 100644 --- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd +++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd @@ -74,7 +74,7 @@ The name of the bean defining the GemFire cache (by default 'gemfire-cache'). ]]> - + - + - + - + - + - + - + - + - + - + - + - + - + - + --> - + - + - + - + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + From bfca3dd6618974412be0bc83a27c9a2deb13978e Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 26 Apr 2011 10:32:20 +0300 Subject: [PATCH 11/23] + update changelog for 1.0.1 release --- docs/src/main/resources/changelog.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/src/main/resources/changelog.txt b/docs/src/main/resources/changelog.txt index ba844545..c483776e 100644 --- a/docs/src/main/resources/changelog.txt +++ b/docs/src/main/resources/changelog.txt @@ -2,15 +2,29 @@ SPRING GEMFIRE INTEGRATION CHANGELOG ==================================== http://www.springsource.org/spring-gemfire -Changes in version 1.0.1 (2011-mm-dd) +Changes in version 1.0.1 (2011-04-26) ------------------------------------- General -* Upgraded to GemFire 6.5.1.2 +* Upgraded to GemFire 6.5.1.4 * Fix networking issue with the sample on some Linux distributions (Ubuntu) +* Loosen type constraints in the schema to allow placeholders +* Added 'statistics' attribute to all write regions Package org.springframework.data.gemfire * Introduced auto-close (configurable) on RegionFactoryBean +Package org.springframework.data.gemfire.config +* Fixed bug causing region names to be used as aliases for region beans + +Package org.springframework.data.gemfire.client +* Improved dependency initialization between cache and pools + +Package org.springframework.data.gemfire.serialization +* Improved cache-wide registration of custom instantiators + +Package org.springframework.data.gemfire.support +* Introduced GemfireDaoSupport + Changes in version 1.0.0 (2011-02-02) ------------------------------------- From 700ebb65b4d643e1b6e26e22436dc4ca2ff8268c Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 26 Apr 2011 10:51:41 +0300 Subject: [PATCH 12/23] + fix javadoc inconsistencies --- .../serialization/InstantiatorFactoryBean.java | 2 +- .../data/gemfire/support/GemfireDaoSupport.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java index 0b90c7dc..83bbafce 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java @@ -123,7 +123,7 @@ public class InstantiatorFactoryBean implements BeanClassLoaderAware, FactoryBea * Sets the distribution of the region of this {@link Instantiator} during the container startup. * Default is false, meaning the registration will not be distributed to other clients. * - * @see #register(Instantiator, boolean) + * @see Instantiator#register(Instantiator, boolean) * @param distribute whether the registration is distributable or not */ public void setDistribute(boolean distribute) { diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java index e45b5c0b..97a652d3 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java @@ -26,14 +26,12 @@ import com.gemstone.gemfire.cache.Region; * Convenient super class for GemFire data access objects. Intended for * GemfireTemplate usage. * - *

Requires an EntityManagerFactory or EntityManager to be set, - * providing a JpaTemplate based on it to subclasses. Can alternatively - * be initialized directly via a JpaTemplate, to reuse the latter's - * settings such as the EntityManagerFactory, JpaDialect, flush mode, etc. + *

Requires a Region to be set, providing a GemfireTemplate based on it to subclasses. + * Can alternatively be initialized directly via a GemfireTemplate, to reuse the latter's + * settings. * - *

This class will create its own GemfireTemplate if an EntityManagerFactory - * or EntityManager reference is passed in. A custom JpaTemplate instance - * can be used through overriding createJpaTemplate. + *

This class will create its own GemfireTemplate if an Region reference is passed in. + * A custom GemfireTemplate instance can be used through overriding createGemfireTemplate. * * @author Costin Leau */ From d9b6ac18b86e6230230d9f904a9eaa29110dfefb Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 26 Apr 2011 10:51:55 +0300 Subject: [PATCH 13/23] + add proper version to poms --- docs/pom.xml | 2 +- pom.xml | 4 ++-- samples/hello-world/pom.xml | 4 ++-- samples/pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index eefa6b01..1a2ac4c4 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.1.BUILD-SNAPSHOT + 1.0.1.RELEASE Spring GemFire Documentation diff --git a/pom.xml b/pom.xml index 3dad56ee..72d9f12d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.1.BUILD-SNAPSHOT + 1.0.1.RELEASE Spring GemFire Project Spring GemFire Integration for Java @@ -280,7 +280,7 @@ limitations under the License. protected 1.5 - http://java.sun.com/j2se/1.6.0/docs/api/ + http://download.oracle.com/javase/6/docs/api/ http://static.springsource.org/spring/docs/3.0.x/javadoc-api/ diff --git a/samples/hello-world/pom.xml b/samples/hello-world/pom.xml index c9ec2bbd..7a94a3dd 100644 --- a/samples/hello-world/pom.xml +++ b/samples/hello-world/pom.xml @@ -4,13 +4,13 @@ samples org.springframework.data.gemfire.samples - 1.0.1.BUILD-SNAPSHOT + 1.0.1.RELEASE ../ 4.0.0 org.springframework.data.gemfire.samples hello-world - 1.0.1.BUILD-SNAPSHOT + 1.0.1.RELEASE Spring GemFire - Hello World Sample A simple Hello World example illustrating the basic steps in configuring GemFire with Spring diff --git a/samples/pom.xml b/samples/pom.xml index e43501df..4c153132 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire.samples samples - 1.0.1.BUILD-SNAPSHOT + 1.0.1.RELEASE Spring GemFire Samples pom http://www.springframework.org/spring-gemfire From e21be7576136da3e44448d054e10feb8712ad80b Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 26 Apr 2011 11:26:09 +0300 Subject: [PATCH 14/23] + bump version --- docs/pom.xml | 2 +- pom.xml | 2 +- samples/hello-world/pom.xml | 4 ++-- samples/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 1a2ac4c4..c12506a6 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.1.RELEASE + 1.0.2.BUILD-SNAPSHOT Spring GemFire Documentation diff --git a/pom.xml b/pom.xml index 72d9f12d..402ca1ee 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.1.RELEASE + 1.0.2.BUILD-SNAPSHOT Spring GemFire Project Spring GemFire Integration for Java diff --git a/samples/hello-world/pom.xml b/samples/hello-world/pom.xml index 7a94a3dd..e098fbef 100644 --- a/samples/hello-world/pom.xml +++ b/samples/hello-world/pom.xml @@ -4,13 +4,13 @@ samples org.springframework.data.gemfire.samples - 1.0.1.RELEASE + 1.0.2.BUILD-SNAPSHOT ../ 4.0.0 org.springframework.data.gemfire.samples hello-world - 1.0.1.RELEASE + 1.0.2.BUILD-SNAPSHOT Spring GemFire - Hello World Sample A simple Hello World example illustrating the basic steps in configuring GemFire with Spring diff --git a/samples/pom.xml b/samples/pom.xml index 4c153132..ce5efb30 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire.samples samples - 1.0.1.RELEASE + 1.0.2.BUILD-SNAPSHOT Spring GemFire Samples pom http://www.springframework.org/spring-gemfire From ba9089b37f7b35d333bf3148c3a6d58b2dcc17ca Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Mon, 9 May 2011 11:57:47 -0700 Subject: [PATCH 15/23] SGF-50 + start working on the CacheServer support --- .../server/CacheServerFactoryBean.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java new file mode 100644 index 00000000..958585a1 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -0,0 +1,50 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.gemfire.server; + +import org.springframework.beans.factory.DisposableBean; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; + +import com.gemstone.gemfire.cache.server.CacheServer; + +/** + * @author Costin Leau + */ +public class CacheServerFactoryBean implements FactoryBean, + InitializingBean, DisposableBean { + + private CacheServer cacheServer; + + public CacheServer getObject(){ + return cacheServer; + } + + public Class getObjectType() { + return ((this.cacheServer != null) ? cacheServer.getClass() : CacheServer.class); + } + + public boolean isSingleton() { + return true; + } + + public void afterPropertiesSet() { + } + + public void destroy() { + } + +} \ No newline at end of file From 45a5f30348c621f798da049fbef55dfb6d6f9e6b Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Mon, 9 May 2011 14:44:18 -0700 Subject: [PATCH 16/23] + adding main logic to CacheServer still need to add support for eviction policies and overflow support --- .../server/CacheServerFactoryBean.java | 155 +++++++++++++++++- 1 file changed, 151 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java index 958585a1..814b5c88 100644 --- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -15,21 +15,49 @@ */ package org.springframework.data.gemfire.server; +import java.io.IOException; +import java.util.Collections; +import java.util.Set; + +import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.SmartLifecycle; +import org.springframework.util.Assert; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.InterestRegistrationListener; import com.gemstone.gemfire.cache.server.CacheServer; +import com.gemstone.gemfire.cache.server.ServerLoadProbe; /** * @author Costin Leau */ public class CacheServerFactoryBean implements FactoryBean, - InitializingBean, DisposableBean { + InitializingBean, DisposableBean, SmartLifecycle { + private boolean autoStartup = true; + + private int port = CacheServer.DEFAULT_PORT; + private int maxConnections = CacheServer.DEFAULT_MAX_CONNECTIONS; + private int maxThreads = CacheServer.DEFAULT_MAX_THREADS; + private boolean notifyBySubscription = CacheServer.DEFAULT_NOTIFY_BY_SUBSCRIPTION; + private int socketBufferSize = CacheServer.DEFAULT_SOCKET_BUFFER_SIZE; + private int maxTimeBetweenPings = CacheServer.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS; + private int maxMessageCount = CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT; + private int messageTimeToLive = CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE; + private String[] serverGroups = CacheServer.DEFAULT_GROUPS; + private ServerLoadProbe serverLoadProbe = CacheServer.DEFAULT_LOAD_PROBE; + private long loadPollInterval = CacheServer.DEFAULT_LOAD_POLL_INTERVAL; + private String bindAddress = CacheServer.DEFAULT_BIND_ADDRESS; + private String hostNameForClients = CacheServer.DEFAULT_HOSTNAME_FOR_CLIENTS; + private Set listeners = Collections.emptySet(); + + private Cache cache; private CacheServer cacheServer; - public CacheServer getObject(){ + public CacheServer getObject() { return cacheServer; } @@ -42,9 +70,128 @@ public class CacheServerFactoryBean implements FactoryBean, } public void afterPropertiesSet() { - } + Assert.notNull(cache, "cache is required"); + + cacheServer = cache.addCacheServer(); + cacheServer.setBindAddress(bindAddress); + cacheServer.setGroups(serverGroups); + cacheServer.setHostnameForClients(hostNameForClients); + cacheServer.setLoadPollInterval(loadPollInterval); + cacheServer.setLoadProbe(serverLoadProbe); + cacheServer.setMaxConnections(maxConnections); + cacheServer.setMaximumMessageCount(maxMessageCount); + cacheServer.setMaximumTimeBetweenPings(maxTimeBetweenPings); + cacheServer.setMaxThreads(maxThreads); + cacheServer.setMessageTimeToLive(messageTimeToLive); + cacheServer.setNotifyBySubscription(notifyBySubscription); + cacheServer.setPort(port); + cacheServer.setSocketBufferSize(socketBufferSize); - public void destroy() { + for (InterestRegistrationListener listener : listeners) { + cacheServer.registerInterestRegistrationListener(listener); + } + + start(); } + public void destroy() { + stop(); + cacheServer = null; + } + + public boolean isAutoStartup() { + return autoStartup; + } + + public void stop(Runnable callback) { + stop(); + callback.run(); + } + + public int getPhase() { + // start the latest + return Integer.MAX_VALUE; + } + + public boolean isRunning() { + return (cacheServer != null ? cacheServer.isRunning() : false); + } + + public void start() { + try { + cacheServer.start(); + } catch (IOException ex) { + throw new BeanInitializationException("Cannot start cache server", ex); + } + } + + public void stop() { + if (cacheServer != null){ + cacheServer.stop(); + } + } + + public void setAutoStartup(boolean autoStartup) { + this.autoStartup = autoStartup; + } + + public void setPort(int port) { + this.port = port; + } + + public void setMaxConnections(int maxConnections) { + this.maxConnections = maxConnections; + } + + public void setMaxThreads(int maxThreads) { + this.maxThreads = maxThreads; + } + + public void setNotifyBySubscription(boolean notifyBySubscription) { + this.notifyBySubscription = notifyBySubscription; + } + + public void setSocketBufferSize(int socketBufferSize) { + this.socketBufferSize = socketBufferSize; + } + + public void setMaxTimeBetweenPings(int maxTimeBetweenPings) { + this.maxTimeBetweenPings = maxTimeBetweenPings; + } + + public void setMaxMessageCount(int maxMessageCount) { + this.maxMessageCount = maxMessageCount; + } + + public void setMessageTimeToLive(int messageTimeToLive) { + this.messageTimeToLive = messageTimeToLive; + } + + public void setServerGroups(String[] serverGroups) { + this.serverGroups = serverGroups; + } + + public void setServerLoadProbe(ServerLoadProbe serverLoadProbe) { + this.serverLoadProbe = serverLoadProbe; + } + + public void setLoadPollInterval(long loadPollInterval) { + this.loadPollInterval = loadPollInterval; + } + + public void setBindAddress(String bindAddress) { + this.bindAddress = bindAddress; + } + + public void setHostNameForClients(String hostNameForClients) { + this.hostNameForClients = hostNameForClients; + } + + public void setListeners(Set listeners) { + this.listeners = listeners; + } + + public void setCache(Cache cache) { + this.cache = cache; + } } \ No newline at end of file From d0fcdf8219933ff1c66a6191bbcc14c4557ee47f Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Mon, 9 May 2011 15:07:16 -0700 Subject: [PATCH 17/23] SGF-50 + add some basic javadoc --- .../data/gemfire/server/CacheServerFactoryBean.java | 2 ++ .../springframework/data/gemfire/server/package-info.java | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 src/main/java/org/springframework/data/gemfire/server/package-info.java diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java index 814b5c88..2d590fe0 100644 --- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -32,6 +32,8 @@ import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache.server.ServerLoadProbe; /** + * FactoryBean for easy creation and configuration of GemFire {@link CacheServer} instances. + * * @author Costin Leau */ public class CacheServerFactoryBean implements FactoryBean, diff --git a/src/main/java/org/springframework/data/gemfire/server/package-info.java b/src/main/java/org/springframework/data/gemfire/server/package-info.java new file mode 100644 index 00000000..457f4f8a --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/server/package-info.java @@ -0,0 +1,5 @@ +/** + * Support package for GemFire {@link com.gemstone.gemfire.cache.server.CacheServer}. + * + */ +package org.springframework.data.gemfire.server; \ No newline at end of file From 25db19c191df1ebc362869be9cc800889cf11113 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Mon, 16 May 2011 20:08:22 +0300 Subject: [PATCH 18/23] SGF-50 + add subscription support + add namespace support + integration tests --- .../data/gemfire/config/CacheParser.java | 1 + .../gemfire/config/CacheServerParser.java | 86 ++ .../config/GemfireNamespaceHandler.java | 1 + .../server/CacheServerFactoryBean.java | 49 +- .../server/SubscriptionEvictionPolicy.java | 28 + src/main/resources/META-INF/spring.schemas | 3 +- .../gemfire/config/spring-gemfire-1.1.xsd | 906 ++++++++++++++++++ .../config/CacheServerNamespaceTest.java | 47 + .../data/gemfire/config/server-ns.xml | 29 + src/test/resources/port.properties | 3 +- 10 files changed, 1142 insertions(+), 11 deletions(-) create mode 100644 src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java create mode 100644 src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java create mode 100644 src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd create mode 100644 src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java create mode 100644 src/test/resources/org/springframework/data/gemfire/config/server-ns.xml diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java index 343fafc8..7a35cbf6 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java @@ -32,6 +32,7 @@ import org.w3c.dom.Element; */ class CacheParser extends AbstractSingleBeanDefinitionParser { + @Override protected Class getBeanClass(Element element) { return CacheFactoryBean.class; } diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java new file mode 100644 index 00000000..b2bcafdc --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java @@ -0,0 +1,86 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.config; + +import org.springframework.beans.factory.BeanDefinitionStoreException; +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.data.gemfire.server.CacheServerFactoryBean; +import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; +import org.w3c.dom.Attr; +import org.w3c.dom.Element; + +/** + * Namespace parser for "cache-server" element. + * + * @author Costin Leau + */ +class CacheServerParser extends AbstractSimpleBeanDefinitionParser { + + @Override + protected Class getBeanClass(Element element) { + return CacheServerFactoryBean.class; + } + + @Override + protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) + throws BeanDefinitionStoreException { + String name = super.resolveId(element, definition, parserContext); + if (!StringUtils.hasText(name)) { + name = "gemfire-server"; + } + return name; + } + + @Override + protected boolean isEligibleAttribute(Attr attribute, ParserContext parserContext) { + return super.isEligibleAttribute(attribute, parserContext) && !"groups".equals(attribute.getName()) + && !"cache-ref".equals(attribute.getName()); + } + + @Override + protected void postProcess(BeanDefinitionBuilder builder, Element element) { + + String attr = element.getAttribute("cache-ref"); + // add cache reference (fallback to default if nothing is specified) + builder.addPropertyReference("cache", (StringUtils.hasText(attr) ? attr : "gemfire-cache")); + + attr = element.getAttribute("groups"); + if (StringUtils.hasText(attr)) { + builder.addPropertyValue("serverGroups", StringUtils.commaDelimitedListToStringArray(attr)); + } + + parseSubscription(builder, element); + } + + private void parseSubscription(BeanDefinitionBuilder builder, Element element) { + Element subConfig = DomUtils.getChildElementByTagName(element, "subscription-config"); + if (subConfig == null) { + return; + } + + ParsingUtils.setPropertyValue(subConfig, builder, "capacity", "subscriptionCapacity"); + ParsingUtils.setPropertyValue(subConfig, builder, "disk-store", "subscriptionDiskStore"); + String attr = element.getAttribute("eviction-type"); + if (StringUtils.hasText(attr)) { + builder.addPropertyValue("subscriptionEvictionPolicy", attr.toUpperCase()); + } + } +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java index bd2f1045..1d4101dd 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java @@ -32,6 +32,7 @@ class GemfireNamespaceHandler extends NamespaceHandlerSupport { registerBeanDefinitionParser("partitioned-region", new PartitionedRegionParser()); registerBeanDefinitionParser("client-region", new ClientRegionParser()); registerBeanDefinitionParser("pool", new PoolParser()); + registerBeanDefinitionParser("cache-server", new CacheServerParser()); registerBeanDefinitionParser("transaction-manager", new TransactionManagerParser()); } diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java index 2d590fe0..8c0db0f7 100644 --- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -24,11 +24,13 @@ import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.SmartLifecycle; +import org.springframework.core.io.Resource; import org.springframework.util.Assert; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.InterestRegistrationListener; import com.gemstone.gemfire.cache.server.CacheServer; +import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig; import com.gemstone.gemfire.cache.server.ServerLoadProbe; /** @@ -36,8 +38,8 @@ import com.gemstone.gemfire.cache.server.ServerLoadProbe; * * @author Costin Leau */ -public class CacheServerFactoryBean implements FactoryBean, - InitializingBean, DisposableBean, SmartLifecycle { +public class CacheServerFactoryBean implements FactoryBean, InitializingBean, DisposableBean, + SmartLifecycle { private boolean autoStartup = true; @@ -55,10 +57,15 @@ public class CacheServerFactoryBean implements FactoryBean, private String bindAddress = CacheServer.DEFAULT_BIND_ADDRESS; private String hostNameForClients = CacheServer.DEFAULT_HOSTNAME_FOR_CLIENTS; private Set listeners = Collections.emptySet(); - + + private SubscriptionEvictionPolicy evictionPolicy = SubscriptionEvictionPolicy.valueOf(ClientSubscriptionConfig.DEFAULT_EVICTION_POLICY.toUpperCase()); + private int subscriptionCapacity = ClientSubscriptionConfig.DEFAULT_CAPACITY; + private Resource subscriptionDiskStore; + private Cache cache; private CacheServer cacheServer; + public CacheServer getObject() { return cacheServer; } @@ -71,9 +78,9 @@ public class CacheServerFactoryBean implements FactoryBean, return true; } - public void afterPropertiesSet() { + public void afterPropertiesSet() throws IOException { Assert.notNull(cache, "cache is required"); - + cacheServer = cache.addCacheServer(); cacheServer.setBindAddress(bindAddress); cacheServer.setGroups(serverGroups); @@ -88,11 +95,17 @@ public class CacheServerFactoryBean implements FactoryBean, cacheServer.setNotifyBySubscription(notifyBySubscription); cacheServer.setPort(port); cacheServer.setSocketBufferSize(socketBufferSize); - + for (InterestRegistrationListener listener : listeners) { cacheServer.registerInterestRegistrationListener(listener); - } - + } + + // client config + ClientSubscriptionConfig config = cacheServer.getClientSubscriptionConfig(); + config.setCapacity(subscriptionCapacity); + config.setEvictionPolicy(evictionPolicy.name().toLowerCase()); + config.setDiskStoreName(subscriptionDiskStore.getFile().getCanonicalPath()); + start(); } @@ -128,7 +141,7 @@ public class CacheServerFactoryBean implements FactoryBean, } public void stop() { - if (cacheServer != null){ + if (cacheServer != null) { cacheServer.stop(); } } @@ -196,4 +209,22 @@ public class CacheServerFactoryBean implements FactoryBean, public void setCache(Cache cache) { this.cache = cache; } + + /** + * @param evictionPolicy the evictionPolicy to set + */ + public void setSubscriptionEvictionPolicy(SubscriptionEvictionPolicy evictionPolicy) { + this.evictionPolicy = evictionPolicy; + } + + /** + * @param subscriptionCapacity the subscriptionCapacity to set + */ + public void setSubscriptionCapacity(int subscriptionCapacity) { + this.subscriptionCapacity = subscriptionCapacity; + } + + public void setSubscriptionDiskStore(Resource resource) { + this.subscriptionDiskStore = resource; + } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java new file mode 100644 index 00000000..d7c1efda --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java @@ -0,0 +1,28 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.server; + +import com.gemstone.gemfire.cache.server.CacheServer; + +/** + * Enumeration of the various client subscription policies for {@link CacheServer}. + * + * @author Costin Leau + */ +public enum SubscriptionEvictionPolicy { + NONE, MEM, ENTRY +} diff --git a/src/main/resources/META-INF/spring.schemas b/src/main/resources/META-INF/spring.schemas index 25b420e3..2bb1ca58 100644 --- a/src/main/resources/META-INF/spring.schemas +++ b/src/main/resources/META-INF/spring.schemas @@ -1,2 +1,3 @@ http\://www.springframework.org/schema/gemfire/spring-gemfire-1.0.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd -http\://www.springframework.org/schema/gemfire/spring-gemfire.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.0.xsd \ No newline at end of file +http\://www.springframework.org/schema/gemfire/spring-gemfire-1.1.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd +http\://www.springframework.org/schema/gemfire/spring-gemfire.xsd=org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd \ No newline at end of file diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd new file mode 100644 index 00000000..184e391d --- /dev/null +++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd @@ -0,0 +1,906 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + namespace and its 'properties' element. + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java new file mode 100644 index 00000000..1148c3d0 --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.data.gemfire.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.springframework.data.gemfire.RecreatingContextTest; + +import com.gemstone.gemfire.cache.server.CacheServer; + +/** + * + * @author Costin Leau + */ +public class CacheServerNamespaceTest extends RecreatingContextTest { + + @Override + protected String location() { + return "org/springframework/data/gemfire/config/server-ns.xml"; + } + + @Test + public void testBasicCacheServer() throws Exception { + CacheServer cacheServer = ctx.getBean("advanced-config", CacheServer.class); + assertTrue(cacheServer.isRunning()); + assertEquals(1, cacheServer.getGroups().length); + assertEquals("test-server", cacheServer.getGroups()[0]); + assertEquals(22, cacheServer.getMaxConnections()); + + } +} diff --git a/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml new file mode 100644 index 00000000..a03427d6 --- /dev/null +++ b/src/test/resources/org/springframework/data/gemfire/config/server-ns.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/port.properties b/src/test/resources/port.properties index 66e8f405..00ec631d 100644 --- a/src/test/resources/port.properties +++ b/src/test/resources/port.properties @@ -1,2 +1,3 @@ gfe.port=40403 -gfe.port.4=40404 \ No newline at end of file +gfe.port.4=40404 +gfe.port.6=40406 \ No newline at end of file From 420900e482359b3d64723b64318444bdecf34a62 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 17 May 2011 17:10:17 +0300 Subject: [PATCH 19/23] + update main pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2501a6a6..af5038cf 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.2.BUILD-SNAPSHOT + 1.1.0.BUILD-SNAPSHOT Spring GemFire Project Spring GemFire Integration for Java From fff04a87776fe7ccd2de9c3da06b9f307f274368 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Thu, 2 Jun 2011 16:09:54 +0300 Subject: [PATCH 20/23] + specify old version of maven plugin to make the build work --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index af5038cf..0cdfad47 100644 --- a/pom.xml +++ b/pom.xml @@ -224,6 +224,7 @@ limitations under the License. org.apache.maven.plugins maven-surefire-plugin + 2.7.2 always From e261ecf6bde6672fe6197e8e013cacf2a26dc085 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 6 Jul 2011 11:50:55 +0300 Subject: [PATCH 21/23] SGF-56 + add flag to disable bean-factory-locator --- pom.xml | 3 +- .../data/gemfire/CacheFactoryBean.java | 30 +++++++++++++++---- .../gemfire/GemfireBeanFactoryLocator.java | 10 ++++--- .../gemfire/config/spring-gemfire-1.1.xsd | 9 ++++++ .../data/gemfire/CacheIntegrationTest.java | 3 +- .../gemfire/config/CacheNamespaceTest.java | 15 ++++++++++ .../data/gemfire/config/cache-ns.xml | 2 ++ 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 0cdfad47..49f7695d 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ limitations under the License. org.apache.maven.plugins maven-surefire-plugin - 2.4.3 + 2.7.2 org.apache.maven.plugins @@ -224,7 +224,6 @@ limitations under the License. org.apache.maven.plugins maven-surefire-plugin - 2.7.2 always diff --git a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java index 8e805dd2..6137c649 100644 --- a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java @@ -62,17 +62,21 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl private Properties properties; private DistributedSystem system; private ClassLoader beanClassLoader; - private GemfireBeanFactoryLocator factoryLocator = new GemfireBeanFactoryLocator(); + private GemfireBeanFactoryLocator factoryLocator; private BeanFactory beanFactory; private String beanName; + private boolean useBeanFactoryLocator = true; + public void afterPropertiesSet() throws Exception { // initialize locator - factoryLocator.setBeanFactory(beanFactory); - factoryLocator.setBeanName(beanName); - factoryLocator.afterPropertiesSet(); - + if (useBeanFactoryLocator) { + factoryLocator = new GemfireBeanFactoryLocator(); + factoryLocator.setBeanFactory(beanFactory); + factoryLocator.setBeanName(beanName); + factoryLocator.afterPropertiesSet(); + } Properties cfgProps = mergeProperties(); system = DistributedSystem.connect(cfgProps); @@ -128,7 +132,10 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } system = null; - factoryLocator.destroy(); + if (factoryLocator != null) { + factoryLocator.destroy(); + factoryLocator = null; + } } public DataAccessException translateExceptionIfPossible(RuntimeException ex) { @@ -187,4 +194,15 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl public void setCacheXml(Resource cacheXml) { this.cacheXml = cacheXml; } + + /** + * Indicates whether a bean factory locator is enabled (default) for this cache definition or not. The locator stores + * the enclosing bean factory reference to allow auto-wiring of Spring beans into GemFire managed classes. Usually disabled + * when the same cache is used in multiple application context/bean factories inside the same VM. + * + * @param usage true if the bean factory locator is used underneath or not + */ + public void setUseBeanFactoryLocator(boolean usage) { + this.useBeanFactoryLocator = usage; + } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java index 0e62916a..2b0eeca2 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java @@ -112,7 +112,8 @@ public class GemfireBeanFactoryLocator implements BeanFactoryLocator, BeanFactor if (log.isDebugEnabled()) log.debug("adding key=" + name + " w/ reference=" + beanFactory); - if (beanFactories.containsKey(name) || beanFactories.putIfAbsent(name, beanFactory) != null) { + if (beanFactories.containsKey(name) && !beanFactory.equals(beanFactories.get(name)) + || beanFactories.putIfAbsent(name, beanFactory) != null) { throw new IllegalArgumentException("a beanFactoryReference already exists for key " + factoryName); } } @@ -120,10 +121,11 @@ public class GemfireBeanFactoryLocator implements BeanFactoryLocator, BeanFactor } public void destroy() { - for (String name : names) { - beanFactories.remove(name); + if (names != null) { + for (String name : names) { + beanFactories.remove(name); + } } - if (beanFactory == defaultFactory) { synchronized (GemfireBeanFactoryLocator.class) { defaultFactory = null; diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd index 184e391d..eb43844f 100644 --- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd +++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd @@ -51,6 +51,15 @@ consider using a dedicated utility such as the namespace and its 'prop ]]> + + + + + diff --git a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java index d2bfc72b..f01ada81 100644 --- a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java @@ -61,4 +61,5 @@ public class CacheIntegrationTest extends RecreatingContextTest{ public void testCacheWithXml() throws Exception { Cache cache = ctx.getBean("cache-with-xml", Cache.class); } -} + +} \ No newline at end of file diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java index 675392ff..16287627 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java @@ -17,12 +17,14 @@ package org.springframework.data.gemfire.config; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.core.io.Resource; import org.springframework.data.gemfire.CacheFactoryBean; +import org.springframework.data.gemfire.GemfireBeanFactoryLocator; import org.springframework.data.gemfire.RecreatingContextTest; import org.springframework.data.gemfire.TestUtils; @@ -61,4 +63,17 @@ public class CacheNamespaceTest extends RecreatingContextTest { assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb)); } + @Test(expected = IllegalArgumentException.class) + public void testNoBeanFactory() throws Exception { + assertTrue(ctx.containsBean("no-bl")); + CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&no-bl"); + GemfireBeanFactoryLocator locator = new GemfireBeanFactoryLocator(); + try { + assertNotNull(locator.useBeanFactory("cache-with-name")); + locator.useBeanFactory("no-bl"); + } finally { + locator.destroy(); + } + } + } \ No newline at end of file diff --git a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml index c3e03f48..e80adb57 100644 --- a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml +++ b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml @@ -21,4 +21,6 @@ false + + \ No newline at end of file From b7c73a8a236e0b9e8dad6e2f4422072e87b58899 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Fri, 8 Jul 2011 16:47:33 +0300 Subject: [PATCH 22/23] SGF-58 Add initial support for GemFire 6.6 --- docs/src/main/resources/changelog.txt | 13 +++ pom.xml | 2 +- .../data/gemfire/CacheFactoryBean.java | 107 +++++++++++++++--- .../data/gemfire/basic-cache.xml | 3 + 4 files changed, 109 insertions(+), 16 deletions(-) diff --git a/docs/src/main/resources/changelog.txt b/docs/src/main/resources/changelog.txt index c483776e..1aa8fc77 100644 --- a/docs/src/main/resources/changelog.txt +++ b/docs/src/main/resources/changelog.txt @@ -2,6 +2,19 @@ SPRING GEMFIRE INTEGRATION CHANGELOG ==================================== http://www.springsource.org/spring-gemfire + +Changes in version 1.0.1 (2011-07-dd) +------------------------------------- + +General +* Added support for GemFire 6.6 +* Dropped support for GemFire 6.0, GemFire 6.5 or higher required +* Introduced support for CacheServer + +Package org.springframework.data.gemfire +* Introduced cache option for disabling bean factory locator; useful for multi cache definitions, in the same VM + + Changes in version 1.0.1 (2011-04-26) ------------------------------------- General diff --git a/pom.xml b/pom.xml index 49f7695d..03a4a8cb 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ limitations under the License. com.gemstone.gemfire gemfire - 6.5.1.4 + 6.6.RC compile diff --git a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java index 6137c649..ee0751cd 100644 --- a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java @@ -31,6 +31,8 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.dao.DataAccessException; import org.springframework.dao.support.PersistenceExceptionTranslator; +import org.springframework.util.Assert; +import org.springframework.util.ClassUtils; import com.gemstone.gemfire.GemFireException; import com.gemstone.gemfire.cache.Cache; @@ -38,6 +40,8 @@ import com.gemstone.gemfire.cache.CacheClosedException; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.pdx.PdxSerializable; +import com.gemstone.gemfire.pdx.PdxSerializer; /** * Factory used for configuring a Gemfire Cache manager. Allows either retrieval of an existing, opened cache @@ -55,19 +59,41 @@ import com.gemstone.gemfire.distributed.DistributedSystem; public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanClassLoaderAware, DisposableBean, InitializingBean, FactoryBean, PersistenceExceptionTranslator { + private class PdxOptions implements Runnable { + + private CacheFactory factory; + + PdxOptions(CacheFactory factory) { + this.factory = factory; + } + + 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); + } + } + private static final Log log = LogFactory.getLog(CacheFactoryBean.class); private Cache cache; private Resource cacheXml; private Properties properties; - private DistributedSystem system; private ClassLoader beanClassLoader; private GemfireBeanFactoryLocator factoryLocator; private BeanFactory beanFactory; private String beanName; private boolean useBeanFactoryLocator = true; - + // PDX options + private Object pdxSerializer; + private Boolean pdxPersistent; + private Boolean pdxReadSerialized; + private Boolean pdxIgnoreUnreadFields; + private String pdxDiskStoreName; public void afterPropertiesSet() throws Exception { // initialize locator @@ -78,11 +104,7 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl factoryLocator.afterPropertiesSet(); } Properties cfgProps = mergeProperties(); - system = DistributedSystem.connect(cfgProps); - - DistributedMember member = system.getDistributedMember(); - log.info("Connected to Distributed System [" + system.getName() + "=" + member.getId() + "@" + member.getHost() - + "]"); + CacheFactory factory = new CacheFactory(cfgProps); // use the bean class loader to load Declarable classes Thread th = Thread.currentThread(); @@ -93,14 +115,28 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl // first look for open caches String msg = null; try { - cache = CacheFactory.getInstance(system); + cache = CacheFactory.getAnyInstance(); msg = "Retrieved existing"; } catch (CacheClosedException ex) { + // GemFire 6.6 specific options + if (pdxSerializer != null || pdxPersistent != null || pdxReadSerialized != null + || pdxIgnoreUnreadFields != null || pdxDiskStoreName != null) { + Assert.isTrue(ClassUtils.isPresent("com.gemstone.gemfire.pdx.PdxSerializer", beanClassLoader), + "Cannot set PDX options since GemFire 6.6 not detected"); + new PdxOptions(factory).run(); + } + // fall back to cache creation - cache = CacheFactory.create(system); + cache = factory.create(); msg = "Created"; } + DistributedSystem system = cache.getDistributedSystem(); + DistributedMember member = system.getDistributedMember(); + log.info("Connected to Distributed System [" + system.getName() + "=" + member.getId() + "@" + + member.getHost() + "]"); + + log.info(msg + " GemFire v." + CacheFactory.getVersion() + " Cache [" + cache.getName() + "]"); // load/init cache.xml @@ -124,13 +160,8 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl if (cache != null && !cache.isClosed()) { cache.close(); } - cache = null; - if (system != null && system.isConnected()) { - DistributedSystem.releaseThreadsSockets(); - system.disconnect(); - } - system = null; + cache = null; if (factoryLocator != null) { factoryLocator.destroy(); @@ -205,4 +236,50 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl public void setUseBeanFactoryLocator(boolean usage) { this.useBeanFactoryLocator = usage; } + + /** + * Sets the {@link PdxSerializable} for this cache. Applicable on GemFire 6.6 or higher. + * The argument is of type object for compatibility with GemFire 6.5. + * + * @param serializer pdx serializer configured for this cache. + */ + public void setPdxSerializer(Object serializer) { + this.pdxSerializer = serializer; + } + + /** + * Sets the object preference to PdxInstance type. Applicable on GemFire 6.6 or higher. + * + * @param pdxPersistent the pdxPersistent to set + */ + public void setPdxPersistent(Boolean pdxPersistent) { + this.pdxPersistent = pdxPersistent; + } + + /** + * Controls whether the type metadata for PDX objects is persisted to disk. Applicable on GemFire 6.6 or higher. + * + * @param pdxReadSerialized the pdxReadSerialized to set + */ + public void setPdxReadSerialized(Boolean pdxReadSerialized) { + this.pdxReadSerialized = pdxReadSerialized; + } + + /** + * Controls whether pdx ignores fields that were unread during deserialization. Applicable on GemFire 6.6 or higher. + * + * @param pdxIgnoreUnreadFields the pdxIgnoreUnreadFields to set + */ + public void setPdxIgnoreUnreadFields(Boolean pdxIgnoreUnreadFields) { + this.pdxIgnoreUnreadFields = pdxIgnoreUnreadFields; + } + + /** + * Set the disk store that is used for PDX meta data. Applicable on GemFire 6.6 or higher. + * + * @param pdxDiskStoreName the pdxDiskStoreName to set + */ + public void setPdxDiskStoreName(String pdxDiskStoreName) { + this.pdxDiskStoreName = pdxDiskStoreName; + } } \ No newline at end of file diff --git a/src/test/resources/org/springframework/data/gemfire/basic-cache.xml b/src/test/resources/org/springframework/data/gemfire/basic-cache.xml index dad99470..b25bd4f5 100644 --- a/src/test/resources/org/springframework/data/gemfire/basic-cache.xml +++ b/src/test/resources/org/springframework/data/gemfire/basic-cache.xml @@ -35,5 +35,8 @@ + + + From 65d72e6dae69264566186809c559fa4fb2064db0 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Fri, 8 Jul 2011 16:58:05 +0300 Subject: [PATCH 23/23] + fix old version in samples pom --- docs/pom.xml | 2 +- samples/hello-world/pom.xml | 4 ++-- samples/pom.xml | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index c12506a6..a9769774 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire spring-gemfire - 1.0.2.BUILD-SNAPSHOT + 1.1.0.BUILD-SNAPSHOT Spring GemFire Documentation diff --git a/samples/hello-world/pom.xml b/samples/hello-world/pom.xml index e098fbef..3468ff0f 100644 --- a/samples/hello-world/pom.xml +++ b/samples/hello-world/pom.xml @@ -4,13 +4,13 @@ samples org.springframework.data.gemfire.samples - 1.0.2.BUILD-SNAPSHOT + 1.1.0.BUILD-SNAPSHOT ../ 4.0.0 org.springframework.data.gemfire.samples hello-world - 1.0.2.BUILD-SNAPSHOT + 1.1.0.BUILD-SNAPSHOT Spring GemFire - Hello World Sample A simple Hello World example illustrating the basic steps in configuring GemFire with Spring diff --git a/samples/pom.xml b/samples/pom.xml index ce5efb30..cded87e4 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.data.gemfire.samples samples - 1.0.2.BUILD-SNAPSHOT + 1.1.0.BUILD-SNAPSHOT Spring GemFire Samples pom http://www.springframework.org/spring-gemfire @@ -63,7 +63,14 @@ ${junit.version} test - +