From 1467ec0668ec5fdf10cd31cf1ad9aa01ca03f08d Mon Sep 17 00:00:00 2001 From: David Turanski Date: Thu, 28 Jun 2012 13:32:05 -0400 Subject: [PATCH] Updated copyright, fixed support for transaction handlers, added initializers --- .../data/gemfire/CacheFactoryBean.java | 60 +- .../data/gemfire/DeclarableSupport.java | 25 +- .../data/gemfire/DiskStoreFactoryBean.java | 2 +- .../data/gemfire/GemfireAccessor.java | 2 +- .../gemfire/GemfireBeanFactoryLocator.java | 2 +- .../data/gemfire/GemfireCacheUtils.java | 2 +- .../data/gemfire/GemfireCallback.java | 2 +- .../gemfire/GemfireCancellationException.java | 2 +- .../data/gemfire/GemfireIndexException.java | 2 +- .../data/gemfire/GemfireQueryException.java | 2 +- .../data/gemfire/GemfireSystemException.java | 2 +- .../data/gemfire/GemfireTemplate.java | 2 +- .../GemfireTransactionCommitException.java | 2 +- .../gemfire/GemfireTransactionManager.java | 80 +- .../data/gemfire/IndexFactoryBean.java | 2 +- .../PartitionAttributesFactoryBean.java | 2 +- .../gemfire/RegionAttributesFactoryBean.java | 2 +- .../data/gemfire/RegionFactoryBean.java | 9 +- .../data/gemfire/RegionLookupFactoryBean.java | 2 +- .../data/gemfire/WiringDeclarableSupport.java | 2 +- .../client/ClientCacheFactoryBean.java | 2 +- .../data/gemfire/client/Interest.java | 2 +- .../data/gemfire/client/PoolConnection.java | 2 +- .../data/gemfire/client/PoolFactoryBean.java | 2 +- .../data/gemfire/client/RegexInterest.java | 2 +- .../data/gemfire/config/CacheParser.java | 33 +- .../gemfire/config/CacheServerParser.java | 2 +- .../gemfire/config/ClientCacheParser.java | 7 +- .../data/gemfire/config/DiskStoreParser.java | 1 + .../DiskWriteAttributesFactoryBean.java | 2 +- .../config/EvictionAttributesFactoryBean.java | 2 +- .../data/gemfire/config/EvictionType.java | 2 +- .../GemfireListenerContainerParser.java | 2 +- .../config/GemfireNamespaceHandler.java | 2 +- .../data/gemfire/config/IndexParser.java | 2 +- .../data/gemfire/config/ParsingUtils.java | 2 + .../config/PartitionedRegionParser.java | 2 - .../data/gemfire/config/PoolParser.java | 2 +- .../config/TransactionManagerParser.java | 3 +- .../listener/ContinuousQueryDefinition.java | 2 +- .../listener/ContinuousQueryListener.java | 2 +- .../ContinuousQueryListenerContainer.java | 2 +- ...mfireListenerExecutionFailedException.java | 2 +- .../ContinuousQueryListenerAdapter.java | 2 +- .../AsmInstantiatorGenerator.java | 2 +- .../gemfire/serialization/EnumSerializer.java | 2 +- .../InstantiatorFactoryBean.java | 2 +- .../serialization/InstantiatorGenerator.java | 2 +- .../serialization/WiringInstantiator.java | 2 +- .../server/CacheServerFactoryBean.java | 2 +- .../server/SubscriptionEvictionPolicy.java | 2 +- .../data/gemfire/support/GemfireCache.java | 2 +- .../gemfire/support/GemfireCacheManager.java | 2 +- .../gemfire/support/GemfireDaoSupport.java | 2 +- .../gemfire/config/spring-gemfire-1.2.xsd | 2939 ++++++++--------- .../data/gemfire/CacheIntegrationTest.java | 2 +- .../data/gemfire/DeclarableSupportTest.java | 2 +- .../data/gemfire/ForkUtil.java | 2 +- .../GemfireBeanFactoryLocatorTest.java | 2 +- .../data/gemfire/GemfireTemplateTest.java | 2 +- .../springframework/data/gemfire/Init.java | 2 +- .../data/gemfire/RecreatingContextTest.java | 2 +- .../data/gemfire/SimpleCacheListener.java | 2 +- .../data/gemfire/SimpleCacheLoader.java | 2 +- .../data/gemfire/SimpleCacheWriter.java | 2 +- .../data/gemfire/SimpleObjectSizer.java | 2 +- .../data/gemfire/SimplePartitionResolver.java | 2 +- .../data/gemfire/TestUtils.java | 2 +- .../data/gemfire/TxIntegrationTest.java | 2 +- .../data/gemfire/UserObject.java | 2 +- .../gemfire/client/RegionIntegrationTest.java | 2 +- .../gemfire/config/CacheInitializerTest.java | 94 + .../gemfire/config/CacheNamespaceTest.java | 2 +- .../config/CacheServerNamespaceTest.java | 2 +- ...DiskStoreAndEvictionRegionParsingTest.java | 2 +- .../gemfire/config/IndexNamespaceTest.java | 2 +- .../PartitionedRegionNamespaceTest.java | 2 +- .../gemfire/config/PoolNamespaceTest.java | 2 +- .../config/ReplicatedRegionNamespaceTest.java | 2 + .../gemfire/config/TxEventHandlersTest.java | 133 + .../config/TxManagerNamespaceTest.java | 2 +- .../data/gemfire/fork/CacheServerProcess.java | 2 +- .../data/gemfire/listener/GemfireMDP.java | 2 +- .../listener/ListenerContainerTests.java | 2 +- .../gemfire/listener/StubErrorHandler.java | 2 +- .../listener/ThrowableEventListener.java | 2 +- .../adapter/ContainerXmlSetupTest.java | 2 +- .../adapter/QueryListenerAdapterTest.java | 2 +- .../AsmInstantiatorFactoryTest.java | 2 +- .../serialization/WiringInstantiatorTest.java | 2 +- .../support/GemfireDaoSupportTests.java | 2 +- .../gemfire/config/cache-with-initializer.xml | 25 + .../data/gemfire/config/replicated-ns.xml | 2 + .../config/tx-listeners-and-writers.xml | 33 + 94 files changed, 1911 insertions(+), 1693 deletions(-) create mode 100644 src/test/java/org/springframework/data/gemfire/config/CacheInitializerTest.java create mode 100644 src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java create mode 100644 src/test/resources/org/springframework/data/gemfire/config/cache-with-initializer.xml create mode 100644 src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml diff --git a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java index d44e138c..e5366e0b 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-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -16,6 +16,7 @@ package org.springframework.data.gemfire; +import java.util.List; import java.util.Properties; import org.apache.commons.logging.Log; @@ -33,12 +34,17 @@ import org.springframework.dao.DataAccessException; import org.springframework.dao.support.PersistenceExceptionTranslator; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; +import org.springframework.util.CollectionUtils; import com.gemstone.gemfire.GemFireException; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheClosedException; import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.CacheTransactionManager; +import com.gemstone.gemfire.cache.Declarable; import com.gemstone.gemfire.cache.GemFireCache; +import com.gemstone.gemfire.cache.TransactionListener; +import com.gemstone.gemfire.cache.TransactionWriter; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; @@ -64,7 +70,6 @@ import com.gemstone.gemfire.pdx.PdxSerializer; */ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanClassLoaderAware, DisposableBean, InitializingBean, FactoryBean, PersistenceExceptionTranslator { - /** * Inner class to avoid a hard dependency on the GemFire 6.6 API. * @@ -120,6 +125,12 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl if (messageSyncInterval != null) { cacheImpl.setMessageSyncInterval(messageSyncInterval); } + + if (initializer != null) { + // Props are null because already configured in Spring + cacheImpl.setInitializer(initializer, null); + } + } } @@ -162,6 +173,12 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl protected Integer searchTimeout; + protected List transactionListeners; + + protected TransactionWriter transactionWriter; + + protected Declarable initializer; + @Override public void afterPropertiesSet() throws Exception { // initialize locator @@ -217,16 +234,41 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl if (cacheXml != null) { cache.loadCacheXml(cacheXml.getInputStream()); - if (log.isDebugEnabled()) + if (log.isDebugEnabled()) { log.debug("Initialized cache from " + cacheXml); + } } + registerTransactionListeners(); + registerTransactionWriter(); + } finally { th.setContextClassLoader(oldTCCL); } } + /** + * Register a transaction writer if declared + */ + protected void registerTransactionWriter() { + if (transactionWriter != null) { + cache.getCacheTransactionManager().setWriter(transactionWriter); + } + } + + /** + * Register all declared transaction listeners + */ + protected void registerTransactionListeners() { + if (!CollectionUtils.isEmpty(transactionListeners)) { + CacheTransactionManager txManager = cache.getCacheTransactionManager(); + for (TransactionListener transactionListener : transactionListeners) { + txManager.addListener(transactionListener); + } + } + } + /** * Sets the PDX properties for the given object. Note this is implementation * specific as it depends on the type of the factory passed in. @@ -429,4 +471,16 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl this.searchTimeout = searchTimeout; } + public void setTransactionListeners(List transactionListeners) { + this.transactionListeners = transactionListeners; + } + + public void setTransactionWriter(TransactionWriter transactionWriter) { + this.transactionWriter = transactionWriter; + } + + public void setInitializer(Declarable initializer) { + this.initializer = initializer; + } + } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java index 7fd60b62..e93ec3e7 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-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -25,18 +25,21 @@ import com.gemstone.gemfire.cache.CacheCallback; import com.gemstone.gemfire.cache.Declarable; /** - * Convenience class for Spring-aware GemFire Declarable components. - * Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. + * Convenience class for Spring-aware GemFire Declarable components. Provides a + * reference to the current Spring application context, e.g. for bean lookup or + * resource loading. * - * Note that in most cases, one can just declare the same components as Spring beans, through - * {@link RegionFactoryBean} which gives access to the full container capabilities and does not enforce the - * {@link Declarable} interface to be implemented. + * Note that in most cases, one can just declare the same components as Spring + * beans, through {@link RegionFactoryBean} which gives access to the full + * container capabilities and does not enforce the {@link Declarable} interface + * to be implemented. * * @author Costin Leau */ public abstract class DeclarableSupport implements CacheCallback, Declarable { private String factoryKey = null; + private BeanFactoryReference bfReference = null; public DeclarableSupport() { @@ -48,8 +51,9 @@ public abstract class DeclarableSupport implements CacheCallback, Declarable { * * {@inheritDoc} * - * @see #setFactoryKey(String) + * @see #setFactoryKey(String) */ + @Override public final void init(Properties props) { bfReference = new GemfireBeanFactoryLocator().useBeanFactory(factoryKey); initInstance(props); @@ -67,15 +71,16 @@ public abstract class DeclarableSupport implements CacheCallback, Declarable { return bfReference.getFactory(); } + @Override public void close() { bfReference.release(); bfReference = null; } /** - * Sets the key under which the enclosing beanFactory can be found. - * Needed only if multiple beanFactories are used with GemFire inside - * the same class loader / class space. + * Sets the key under which the enclosing beanFactory can be found. Needed + * only if multiple beanFactories are used with GemFire inside the same + * class loader / class space. * * @see GemfireBeanFactoryLocator * @param key diff --git a/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java index da37c01d..bf1236ad 100644 --- a/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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 fa847eb6..ebe738ab 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-2011 the original author or authors. + * Copyright 2010-2012 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 2b0eeca2..2f724f82 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-2011 the original author or authors. + * Copyright 2010-2012 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 cc444b80..e299f379 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-2011 the original author or authors. + * Copyright 2010-2012 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 f20f767e..a8c1a3d7 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-2011 the original author or authors. + * Copyright 2010-2012 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 44d1eebd..66975a08 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-2011 the original author or authors. + * Copyright 2010-2012 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 937e824b..50a07a84 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-2011 the original author or authors. + * Copyright 2010-2012 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 600d1dbc..b0a1c483 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-2011 the original author or authors. + * Copyright 2010-2012 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 5c7e5823..3611db75 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-2011 the original author or authors. + * Copyright 2010-2012 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 28c6a42b..7f9b0e71 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-2011 the original author or authors. + * Copyright 2010-2012 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/GemfireTransactionCommitException.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java index d1545cde..ddc5a470 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 d7c17f9f..d6207184 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-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -33,22 +33,26 @@ import com.gemstone.gemfire.cache.CacheTransactionManager; import com.gemstone.gemfire.cache.Region; /** - * Local transaction manager for GemFire Enterprise Fabric (GEF). Provides a {@link PlatformTransactionManager} - * implementation for a single GemFire {@link CacheTransactionManager}. + * Local transaction manager for GemFire Enterprise Fabric (GEF). Provides a + * {@link PlatformTransactionManager} implementation for a single GemFire + * {@link CacheTransactionManager}. * - * Binds one or multiple GemFire regions for the specified {@link Cache} to the thread, potentially allowing for one - * region per cache model. + * Binds one or multiple GemFire regions for the specified {@link Cache} to the + * thread, potentially allowing for one region per cache model. * *

- * This local strategy is an alternative to executing cache operations within JTA transactions. Its advantage is that - * is able to work in any environment, for example a stand-alone application or a test suite. It is not able to - * provide XA transactions, for example to share transactions with data access. + * This local strategy is an alternative to executing cache operations within + * JTA transactions. Its advantage is that is able to work in any environment, + * for example a stand-alone application or a test suite. It is not able + * to provide XA transactions, for example to share transactions with data + * access. * *

- * To prevent dirty reads, by default, the cache is configured to return copies rather then direct references for - * get operations. As a workaround, one could use explicitly deep copy objects before making changes + * To prevent dirty reads, by default, the cache is configured to return copies + * rather then direct references for get operations. As a + * workaround, one could use explicitly deep copy objects before making changes * to them to avoid unnecessary copying on every fetch. - * + * * @see com.gemstone.gemfire.cache.CacheTransactionManager * @see com.gemstone.gemfire.cache.Cache#setCopyOnRead(boolean) * @see com.gemstone.gemfire.cache.Region#get(Object) @@ -58,11 +62,13 @@ import com.gemstone.gemfire.cache.Region; * * @author Costin Leau */ -// TODO add lenient behavior if a transaction is already started on the current thread (what should happen then) +// TODO add lenient behavior if a transaction is already started on the current +// thread (what should happen then) public class GemfireTransactionManager extends AbstractPlatformTransactionManager implements InitializingBean, ResourceTransactionManager { private Cache cache; + private boolean copyOnRead = true; /** @@ -81,6 +87,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage afterPropertiesSet(); } + @Override public void afterPropertiesSet() { Assert.notNull(cache, "Cache property is required"); cache.setCopyOnRead(copyOnRead); @@ -94,6 +101,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage return txObject; } + @Override protected boolean isExistingTransaction(Object transaction) throws TransactionException { CacheTransactionObject txObject = (CacheTransactionObject) transaction; // Consider a pre-bound cache as transaction. @@ -126,29 +134,34 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage @Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { - //CacheTransactionObject txObject = (CacheTransactionObject) status.getTransaction(); + // CacheTransactionObject txObject = (CacheTransactionObject) + // status.getTransaction(); if (status.isDebug()) { logger.debug("Committing Gemfire local transaction on Cache [" + cache + "]"); } try { cache.getCacheTransactionManager().commit(); - } catch (IllegalStateException ex) { + } + catch (IllegalStateException ex) { throw new NoTransactionException( "No transaction associated with the current thread; are there multiple transaction managers ?", ex); - } catch (TransactionException ex) { + } + catch (TransactionException ex) { throw new GemfireTransactionCommitException("Unexpected failure on commit of Cache local transaction", ex); } } @Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { - //CacheTransactionObject txObject = (CacheTransactionObject) status.getTransaction(); + // CacheTransactionObject txObject = (CacheTransactionObject) + // status.getTransaction(); if (status.isDebug()) { logger.debug("Rolling back Cache local transaction for [" + cache + "]"); } try { cache.getCacheTransactionManager().rollback(); - } catch (IllegalStateException ex) { + } + catch (IllegalStateException ex) { throw new NoTransactionException( "No transaction associated with the current thread; are there multiple transaction managers ?", ex); } @@ -163,6 +176,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage txObject.getHolder().setRollbackOnly(); } + @Override protected void doCleanupAfterCompletion(Object transaction) { // Remove the cache holder from the thread. TransactionSynchronizationManager.unbindResource(cache); @@ -183,7 +197,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage } /** - * Sets the Cache that this instance manages local transactions for. + * Sets the Cache that this instance manages local transactions for. * * @param cache Gemfire cache */ @@ -191,12 +205,14 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage this.cache = cache; } + @Override public Object getResourceFactory() { return getCache(); } /** - * Sets the Gemfire {@link Region} (as an alternative in setting in the cache directly). + * Sets the Gemfire {@link Region} (as an alternative in setting in the + * cache directly). * * @param region Gemfire region */ @@ -206,22 +222,24 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage } /** - * Indicates whether the cache returns direct references or copies of the objects (default) it manages. - * While copies imply additional work for every fetch operation, direct references can cause dirty reads - * across concurrent threads in the same VM, whether or not transactions are used. - *

- * One could explicitly deep copy objects before making changes (for example by using {@link com.gemstone.gemfire.CopyHelper#copy(Object)} - * in which case this setting can be set to false. However, unless there is a measurable - * performance penalty, the recommendation is to keep this setting to true - * - * @param copyOnRead whether copies (default) rather then direct references will be returned on - * fetch operations + * Indicates whether the cache returns direct references or copies of the + * objects (default) it manages. While copies imply additional work for + * every fetch operation, direct references can cause dirty reads across + * concurrent threads in the same VM, whether or not transactions are used. + *

+ * One could explicitly deep copy objects before making changes (for example + * by using {@link com.gemstone.gemfire.CopyHelper#copy(Object)} in which + * case this setting can be set to false. However, unless there + * is a measurable performance penalty, the recommendation is to keep this + * setting to true + * + * @param copyOnRead whether copies (default) rather then direct references + * will be returned on fetch operations */ public void setCopyOnRead(boolean copyOnRead) { this.copyOnRead = copyOnRead; } - /** * Indicates whether copy on read is set or not on the transaction manager. * @@ -232,7 +250,6 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage return copyOnRead; } - /** * GemfireTM local transaction object. * @@ -254,7 +271,6 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage private boolean rollbackOnly = false; - public boolean isRollbackOnly() { return rollbackOnly; } diff --git a/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java b/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java index fb66051b..4b804a68 100644 --- a/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 f2826ea7..d294e47a 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-2011 the original author or authors. + * Copyright 2010-2012 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 27b1c194..cae9685a 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-2011 the original author or authors. + * Copyright 2010-2012 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 87e62529..d8958ab9 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java @@ -143,9 +143,10 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple regionFactory.setDiskStoreName(diskStoreName); } - Assert.state(!attributes.isLockGrantor() || scope.isGlobal(), - "Lock grantor only applies to a global scoped region"); - + if (attributes != null) { + Assert.state(!attributes.isLockGrantor() || scope.isGlobal(), + "Lock grantor only applies to a global scoped region"); + } // get underlying AttributesFactory postProcess(findAttrFactory(regionFactory)); @@ -155,7 +156,7 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple reg.loadSnapshot(snapshot.getInputStream()); } - if (attributes.isLockGrantor()) { + if (attributes != null && attributes.isLockGrantor()) { reg.becomeLockGrantor(); } diff --git a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java index 3333203c..86d0dc04 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-2011 the original author or authors. + * Copyright 2010-2012 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 fe64c4f4..f44233d6 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-2011 the original author or authors. + * Copyright 2010-2012 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/ClientCacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java index 6b0a180c..e9d5441d 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 0bce0a0f..1fb1a425 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-2011 the original author or authors. + * Copyright 2010-2012 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 7a72e0fe..15c6e971 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-2011 the original author or authors. + * Copyright 2010-2012 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 74c95361..4b296192 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-2011 the original author or authors. + * Copyright 2010-2012 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 ea14184f..d80afbc6 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-2011 the original author or authors. + * Copyright 2010-2012 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 1b22964d..4420d919 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java @@ -16,13 +16,18 @@ package org.springframework.data.gemfire.config; +import java.util.List; + 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.AbstractSingleBeanDefinitionParser; +import org.springframework.beans.factory.support.ManagedList; +import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.data.gemfire.CacheFactoryBean; +import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; /** @@ -30,8 +35,9 @@ import org.w3c.dom.Element; * * @author Costin Leau * @author Oliver Gierke + * @author David Turanski */ -class CacheParser extends AbstractSingleBeanDefinitionParser { +class CacheParser extends AbstractSimpleBeanDefinitionParser { @Override protected Class getBeanClass(Element element) { @@ -39,7 +45,7 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { } @Override - protected void doParse(Element element, BeanDefinitionBuilder builder) { + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, builder); ParsingUtils.setPropertyValue(element, builder, "cache-xml-location", "cacheXml"); @@ -55,6 +61,26 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { ParsingUtils.setPropertyValue(element, builder, "lock-lease", "lockLease"); ParsingUtils.setPropertyValue(element, builder, "message-sync-interval", "messageSyncInterval"); ParsingUtils.setPropertyValue(element, builder, "search-timeout", "searchTimeout"); + List txListeners = DomUtils.getChildElementsByTagName(element, "transaction-listener"); + if (!CollectionUtils.isEmpty(txListeners)) { + ManagedList transactionListeners = new ManagedList(); + for (Element txListener : txListeners) { + transactionListeners.add(ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, txListener, + builder)); + } + builder.addPropertyValue("transactionListeners", transactionListeners); + } + Element txWriter = DomUtils.getChildElementByTagName(element, "transaction-writer"); + if (txWriter != null) { + builder.addPropertyValue("transactionWriter", + ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, txWriter, builder)); + } + + Element initializer = DomUtils.getChildElementByTagName(element, "initializer"); + if (initializer != null) { + builder.addPropertyValue("initializer", + ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, initializer, builder)); + } } @Override @@ -66,4 +92,5 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { } return name; } + } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java index b2bcafdc..2f1231b3 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/ClientCacheParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java index 01683e71..bc35bd9e 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -17,6 +17,7 @@ package org.springframework.data.gemfire.config; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.ParserContext; import org.springframework.data.gemfire.client.ClientCacheFactoryBean; import org.w3c.dom.Element; @@ -33,8 +34,8 @@ class ClientCacheParser extends CacheParser { } @Override - protected void doParse(Element element, BeanDefinitionBuilder builder) { - super.doParse(element, builder); + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + super.doParse(element, parserContext, builder); ParsingUtils.setPropertyValue(element, builder, "pool-name", "poolName"); } diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java index 7444b28d..9feaf707 100644 --- a/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java @@ -29,6 +29,7 @@ import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; /** + * Parser for the <disk-store> definitions. * @author David Turanski * */ 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 493dc356..95b8c823 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-2011 the original author or authors. + * Copyright 2010-2012 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 415343dc..2469863b 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-2011 the original author or authors. + * Copyright 2010-2012 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 880bbf98..79d17efd 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-2011 the original author or authors. + * Copyright 2010-2012 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/GemfireListenerContainerParser.java b/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java index 1b58c77f..0139eeaf 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 ca69e83a..80ffcdfa 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-2011 the original author or authors. + * Copyright 2010-2012 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/IndexParser.java b/src/main/java/org/springframework/data/gemfire/config/IndexParser.java index b97f428c..77296e16 100644 --- a/src/main/java/org/springframework/data/gemfire/config/IndexParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/IndexParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 59e5eb5a..3b7b97a0 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java @@ -236,6 +236,8 @@ abstract class ParsingUtils { setPropertyValue(element, attrBuilder, "initial-capacity"); setPropertyValue(element, attrBuilder, "load-factor"); setPropertyValue(element, attrBuilder, "cloning-enabled"); + setPropertyValue(element, attrBuilder, "concurrency-level"); + setPropertyValue(element, attrBuilder, "multicast-enabled"); String indexUpdateType = element.getAttribute("index-update-type"); if (StringUtils.hasText(indexUpdateType)) { 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 9acbe69b..36a53cf1 100644 --- a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java @@ -65,8 +65,6 @@ class PartitionedRegionParser extends AbstractRegionParser { builder.addPropertyValue("dataPolicy", DataPolicy.PARTITION); } - ParsingUtils.parseScope(element, builder); - BeanDefinitionBuilder attrBuilder = subRegion ? builder : BeanDefinitionBuilder .genericBeanDefinition(RegionAttributesFactoryBean.class); 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 968dad4f..27c882dd 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-2011 the original author or authors. + * Copyright 2010-2012 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 b5cf6c65..7143ef44 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-2011 the original author or authors. + * Copyright 2010-2012the 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. @@ -32,6 +32,7 @@ import org.w3c.dom.Element; */ class TransactionManagerParser extends AbstractSingleBeanDefinitionParser { + @Override protected Class getBeanClass(Element element) { return GemfireTransactionManager.class; } diff --git a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java index d9fd0934..75daf0fd 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java +++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/ContinuousQueryListener.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java index c96581c5..23d75298 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java +++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/ContinuousQueryListenerContainer.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java index c4a4db4d..540ae713 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java +++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/GemfireListenerExecutionFailedException.java b/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java index 63540f6c..36e4cad4 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java +++ b/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/adapter/ContinuousQueryListenerAdapter.java b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java index 406ff2af..1c32a3eb 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java +++ b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 the original author or authors. + * Copyright 2011-2012-2012 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 3cd71ae5..4530ad92 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-2011 the original author or authors. + * Copyright 2010-2012 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 54f5f0f0..80b739ec 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-2011 the original author or authors. + * Copyright 2010-2012 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 83bbafce..5505f9c6 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-2011 the original author or authors. + * Copyright 2010-2012 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 4c05a9eb..df61fb71 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-2011 the original author or authors. + * Copyright 2010-2012 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/WiringInstantiator.java b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java index 33472f1b..57a93846 100644 --- a/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java +++ b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java index ea800a54..9a8ae8dc 100644 --- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/server/SubscriptionEvictionPolicy.java b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java index d7c1efda..b46a24ea 100644 --- a/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java +++ b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java index f6a1282c..390b308b 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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/support/GemfireCacheManager.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java index a94e9495..17fd981a 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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/support/GemfireDaoSupport.java b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java index 97a652d3..b287b768 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd index 85f4a2b6..20d5b2b9 100644 --- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd +++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd @@ -1,92 +1,112 @@ - - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - + + + + namespace and its 'properties' element. ]]> - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - - - - - + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - - + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - + + + + - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - + + + + - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The reference to a GemfireTemplate. Will default to 'gemfireTemplate'. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java index dd197edf..ab9da468 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-2011 the original author or authors. + * Copyright 2010-2012 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 618932e7..3997fd9c 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-2011 the original author or authors. + * Copyright 2010-2012 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/ForkUtil.java b/src/test/java/org/springframework/data/gemfire/ForkUtil.java index d00007a2..350d767e 100644 --- a/src/test/java/org/springframework/data/gemfire/ForkUtil.java +++ b/src/test/java/org/springframework/data/gemfire/ForkUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 9e319e07..8629bb35 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-2011 the original author or authors. + * Copyright 2010-2012 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/GemfireTemplateTest.java b/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java index 69f2665e..762e4a22 100644 --- a/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java +++ b/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/Init.java b/src/test/java/org/springframework/data/gemfire/Init.java index 7c873d6a..2d9c69ca 100644 --- a/src/test/java/org/springframework/data/gemfire/Init.java +++ b/src/test/java/org/springframework/data/gemfire/Init.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 f2282dc1..8ffd4a61 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-2011 the original author or authors. + * Copyright 2010-2012 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 76e6220d..c6c923d4 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-2011 the original author or authors. + * Copyright 2010-2012 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 40df9573..0e174d0a 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-2011 the original author or authors. + * Copyright 2010-2012 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 486af831..89642282 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-2011 the original author or authors. + * Copyright 2010-2012 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 d8c140e4..b1149704 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-2011 the original author or authors. + * Copyright 2010-2012 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 cf46a0c3..284a0dc8 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-2011 the original author or authors. + * Copyright 2010-2012 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 39e615b9..25dbbde5 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-2011 the original author or authors. + * Copyright 2010-2012 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 755eeae0..e6b8e3b6 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-2011 the original author or authors. + * Copyright 2010-2012 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 59311c60..8f84a309 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-2011 the original author or authors. + * Copyright 2010-2012 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 68e59c6e..97fb1adc 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-2011 the original author or authors. + * Copyright 2010-2012 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/CacheInitializerTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheInitializerTest.java new file mode 100644 index 00000000..307a8c56 --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/config/CacheInitializerTest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010-2012 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.assertNotNull; +import static org.junit.Assert.assertSame; + +import java.util.Properties; + +import javax.annotation.Resource; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.Declarable; + +/** + * @author David Turanski + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("cache-with-initializer.xml") +public class CacheInitializerTest { + @Autowired + TestInitializer cacheInitializer; + + @Resource(name = "gemfire-cache") + Cache cache; + + @Test + public void test() throws Exception { + assertNotNull(cache.getInitializer()); + assertSame(cacheInitializer, cache.getInitializer()); + // assertEquals("cacheInitializer", cacheInitializer.value); + + } + + public static class TestInitializer implements Declarable, BeanNameAware { + + private String name; + + public String value; + + private String first; + + private String last; + + @Override + public void setBeanName(String name) { + this.name = name; + } + + public String getFirst() { + return first; + } + + public void setFirst(String first) { + this.first = first; + } + + public String getLast() { + return last; + } + + public void setLast(String last) { + this.last = last; + } + + @Override + public void init(Properties props) { + this.value = this.name; + }; + } + +} 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 8b5b2ec5..c9194ced 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-2011 the original author or authors. + * Copyright 2010-2012 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/CacheServerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java index 023d5750..13b12113 100644 --- a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 cf262d2c..026cc4d9 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-2011 the original author or authors. + * Copyright 2010-2012 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/IndexNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java index ecd60028..012c92bd 100644 --- a/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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 d04d0527..237bb1ad 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-2011 the original author or authors. + * Copyright 2010-2012 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 f0719580..cd11c51a 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-2011 the original author or authors. + * Copyright 2010-2012 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 2d08792c..218f603a 100644 --- a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java +++ b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java @@ -95,6 +95,8 @@ public class ReplicatedRegionNamespaceTest { assertEquals(true, attrs.getEnableSubscriptionConflation()); assertEquals(0.50, attrs.getLoadFactor(), 0.001); assertEquals(false, attrs.getCloningEnabled()); + assertEquals(10, attrs.getConcurrencyLevel()); + assertEquals(true, attrs.getMulticastEnabled()); } @Test diff --git a/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java b/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java new file mode 100644 index 00000000..618c5cf1 --- /dev/null +++ b/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010-2012 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 javax.annotation.Resource; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.TransactionEvent; +import com.gemstone.gemfire.cache.TransactionListener; +import com.gemstone.gemfire.cache.TransactionWriter; +import com.gemstone.gemfire.cache.TransactionWriterException; + +/** + * @author David Turanski + * + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("tx-listeners-and-writers.xml") +public class TxEventHandlersTest { + @Autowired + TestListener txListener1; + + @Autowired + TestListener txListener2; + + @Autowired + TestWriter txWriter; + + @Resource(name = "gemfire-cache") + Cache cache; + + @Resource(name = "local") + Region local; + + @Test + public void test() throws Exception { + cache.getCacheTransactionManager().begin(); + local.put("hello", "world"); + cache.getCacheTransactionManager().commit(); + assertEquals("txListener1", txListener1.value); + assertEquals("txListener2", txListener2.value); + assertEquals("txWriter", txWriter.value); + + } + + public static class TestListener implements TransactionListener, BeanNameAware { + + private String name; + + public String value; + + public boolean closed; + + public boolean afterCommit; + + @Override + public void close() { + closed = true; + + } + + @Override + public void afterCommit(TransactionEvent arg0) { + afterCommit = true; + value = name; + } + + @Override + public void afterFailedCommit(TransactionEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void afterRollback(TransactionEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setBeanName(String name) { + this.name = name; + }; + } + + public static class TestWriter implements TransactionWriter, BeanNameAware { + + private String name; + + public String value; + + @Override + public void close() { + // TODO Auto-generated method stub + + } + + @Override + public void beforeCommit(TransactionEvent arg0) throws TransactionWriterException { + this.value = name; + + } + + @Override + public void setBeanName(String name) { + this.name = name; + }; + + } +} 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 f6d1e4a6..babb5c3f 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-2011 the original author or authors. + * Copyright 2010-2012 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/fork/CacheServerProcess.java b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java index 76ff596b..3f5bfbc7 100644 --- a/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java +++ b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/GemfireMDP.java b/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java index f64cec97..0dbf6372 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java +++ b/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/ListenerContainerTests.java b/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java index 5344de04..24969471 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java +++ b/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/StubErrorHandler.java b/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java index 7aad6baf..65bbe67c 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java +++ b/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/ThrowableEventListener.java b/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java index 19e8f405..3c4daf50 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java +++ b/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/adapter/ContainerXmlSetupTest.java b/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java index 8fee892d..e9743c4b 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java +++ b/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/listener/adapter/QueryListenerAdapterTest.java b/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java index a3126ce4..b5d5c964 100644 --- a/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java +++ b/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 the original author or authors. + * Copyright 2011-2012-2012 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 aac59925..0e7c80aa 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-2011 the original author or authors. + * Copyright 2010-2012 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 8d09482c..cf1ce7db 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-2011 the original author or authors. + * Copyright 2010-2012 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/support/GemfireDaoSupportTests.java b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java index 5b369dda..2a7b8537 100644 --- a/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java +++ b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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/resources/org/springframework/data/gemfire/config/cache-with-initializer.xml b/src/test/resources/org/springframework/data/gemfire/config/cache-with-initializer.xml new file mode 100644 index 00000000..142f129e --- /dev/null +++ b/src/test/resources/org/springframework/data/gemfire/config/cache-with-initializer.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml index 855beec5..e8c5ce65 100644 --- a/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml +++ b/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml @@ -36,6 +36,8 @@ enable-subscription-conflation="true" load-factor="0.5" cloning-enabled="false" + concurrency-level="10" + multicast-enabled="true" /> diff --git a/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml b/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml new file mode 100644 index 00000000..91a8d41c --- /dev/null +++ b/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file