[jbosscache-commits] JBoss Cache SVN: r6127 - in core/trunk/src: main/java/org/jboss/cache/config and 21 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jun 30 12:44:47 EDT 2008


Author: mircea.markus
Date: 2008-06-30 12:44:47 -0400 (Mon, 30 Jun 2008)
New Revision: 6127

Added:
   core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java
   core/trunk/src/test/resources/configs/
   core/trunk/src/test/resources/configs/buddy-replication-cache.xml
   core/trunk/src/test/resources/configs/clonable-config.xml
   core/trunk/src/test/resources/configs/conf2x/
   core/trunk/src/test/resources/configs/conf2x/buddy-replication-cache.xml
   core/trunk/src/test/resources/configs/conf2x/cacheloader-enabled-cache.xml
   core/trunk/src/test/resources/configs/conf2x/clonable-config.xml
   core/trunk/src/test/resources/configs/conf2x/default-test-config2x.xml
   core/trunk/src/test/resources/configs/conf2x/eviction-enabled-cache.xml
   core/trunk/src/test/resources/configs/conf2x/local-cache.xml
   core/trunk/src/test/resources/configs/conf2x/multiplexer-enabled-cache.xml
   core/trunk/src/test/resources/configs/conf2x/optimistically-locked-cache.xml
   core/trunk/src/test/resources/configs/conf2x/policyPerRegion-eviction.xml
   core/trunk/src/test/resources/configs/conf2x/total-replication-cache.xml
   core/trunk/src/test/resources/configs/local-lru-eviction.xml
   core/trunk/src/test/resources/configs/local-passivation.xml
   core/trunk/src/test/resources/configs/local-tx.xml
   core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
   core/trunk/src/test/resources/configs/mux.xml
   core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
   core/trunk/src/test/resources/configs/replSync.xml
   core/trunk/src/test/resources/configs/string-property-replaced.xml
   core/trunk/src/test/resources/jbc2-registry-configs.xml
   core/trunk/src/test/resources/unit-test-cache-service.xml
Removed:
   core/trunk/src/main/resources/cache-config.xml
   core/trunk/src/test/resources/META-INF/
Modified:
   core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
   core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java
   core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
   core/trunk/src/main/java/org/jboss/cache/eviction/LRUConfiguration.java
   core/trunk/src/main/release/build.xml
   core/trunk/src/main/resources/config2to3.xslt
   core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java
   core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
   core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java
   core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
   core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
   core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java
   core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTest.java
   core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java
   core/trunk/src/test/java/org/jboss/cache/config/StringPropertyReplacementTest.java
   core/trunk/src/test/java/org/jboss/cache/config/parsing/JGroupsStackParserTest.java
   core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
   core/trunk/src/test/java/org/jboss/cache/eviction/EvictionConfigurationTest.java
   core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java
   core/trunk/src/test/java/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java
   core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java
   core/trunk/src/test/java/org/jboss/cache/factories/UnitTestCacheConfigurationFactory.java
   core/trunk/src/test/java/org/jboss/cache/integration/hibernate/UpdateTimestampsCachingTest.java
   core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
   core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java
   core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java
   core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
   core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java
   core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java
   core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
Log:
all test configuration files were migrated to the new configuration format

Modified: core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/DefaultCacheFactory.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -9,6 +9,7 @@
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.ConfigurationException;
 import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.factories.ComponentFactory;
 import org.jboss.cache.factories.ComponentRegistry;
 import org.jboss.cache.invocation.CacheInvocationDelegate;
@@ -62,7 +63,7 @@
 
    public Cache<K, V> createCache(String configFileName, boolean start) throws ConfigurationException
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
+      XmlConfigurationParser parser = new XmlConfigurationParser();
       Configuration c = parser.parseFile(configFileName);
       return createCache(c, start);
    }
@@ -141,14 +142,14 @@
 
    public Cache<K, V> createCache(InputStream is) throws ConfigurationException
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
+      XmlConfigurationParser parser = new XmlConfigurationParser();
       Configuration c = parser.parseStream(is);
       return createCache(c);
    }
 
    public Cache<K, V> createCache(InputStream is, boolean start) throws ConfigurationException
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
+      XmlConfigurationParser parser = new XmlConfigurationParser();
       Configuration c = parser.parseStream(is);
       return createCache(c, start);
    }

Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -668,15 +668,6 @@
       return lockParentForChildInsertRemove;
    }
 
-   /**
-    * This is a deprecated configuration option.  While it will be supported for the 2.x series for backward compatibility,
-    * expect to see it disappear in 3.x.
-    * <p/>
-    * With {@link #isUseLazyDeserialization()}, which is enabled by default, custom class loaders are handled implicitly.
-    * See the user guide for details on how this is handled.
-    * <p/>
-    */
-   @Deprecated
    public boolean isUseRegionBasedMarshalling()
    {
       return useRegionBasedMarshalling;

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/ConfigFilesConvertor.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -78,11 +78,16 @@
             resource = getClass().getClassLoader().getResource(fileName);
             if (resource == null)
                throw new IllegalArgumentException("File " + fileName + " does not exist on disk or on class path");
+            System.out.println("Using xsl file: " + resource);
+         } else
+         {
+            System.out.println("Using xsl file: " + resource);
          }
          return ccl.getResourceAsStream(fileName);
       }
       else
       {
+         System.out.println("Using xls file: " + xsltConvertorFile.getAbsolutePath());
          return new FileInputStream(xsltConvertorFile);
       }
    }

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -39,8 +39,11 @@
          processAttributes(buffer, tag);
          buffer.append(':');
       }
-      // Remove the trailing ':'
-      buffer.setLength(buffer.length() - 1);
+      if (buffer.length() > 0)
+      {
+          //Remove the trailing ':'
+         buffer.setLength(buffer.length() - 1);
+      }
       return buffer.toString();
    }
 

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -22,6 +22,7 @@
 
 /**
  * todo mmarkus comment classes
+ *
  * @author Mircea.Markus at jboss.com
  * @since 3.0
  */
@@ -38,6 +39,7 @@
     * the classpath.  If not found, it will search for the file on the file system instead, treating the name as an
     * absolute path.
     */
+   //todo mmarkus this is duplicated code from 2x parser, extract it in an FileLookup class 
    public Configuration parseFile(String filename)
    {
       InputStream is = getAsInputStreamFromClassLoader(filename);
@@ -54,8 +56,7 @@
             throw new ConfigurationException("Unable to find config file " + filename + " either in classpath or on the filesystem!", e);
          }
       }
-
-      return parse(is);
+      return parseStream(is);
    }
 
    protected InputStream getAsInputStreamFromClassLoader(String filename)
@@ -70,9 +71,21 @@
       return is;
    }
 
-   public Configuration parse(InputStream configStream)
+   public Configuration parseStream(InputStream configStream)
    {
       readRoot(configStream);
+      return processElements();
+   }
+
+   public Configuration parseElement(Element root)
+   {
+      this.root = root;
+      this.root.normalize();
+      return processElements();
+   }
+
+   private Configuration processElements()
+   {
       configureLocking(getSingleElement("locking"));
       configureTransaction(getSingleElement("transaction"));
       configureReplication(getSingleElement("replication"));
@@ -91,51 +104,55 @@
    private void configureTransaction(Element element)
    {
       if (element == null) return;
-      String txMngLookupClass = element.getAttribute("transactionManagerLookupClass");
-      if (existsAttribute(txMngLookupClass)) config.setTransactionManagerLookupClass(txMngLookupClass); 
-      String syncRollbackPhase = element.getAttribute("syncRollbackPhase");
+      String attrName = "transactionManagerLookupClass";
+      String txMngLookupClass = getAttributeValue(element, attrName);
+      if (existsAttribute(txMngLookupClass)) config.setTransactionManagerLookupClass(txMngLookupClass);
+      String syncRollbackPhase = getAttributeValue(element, "syncRollbackPhase");
       if (existsAttribute(syncRollbackPhase)) config.setSyncRollbackPhase(getBoolean(syncRollbackPhase));
-      String syncCommitPhase = element.getAttribute("syncCommitPhase");
+      String syncCommitPhase = getAttributeValue(element, "syncCommitPhase");
       if (existsAttribute(syncCommitPhase)) config.setSyncCommitPhase(getBoolean(syncCommitPhase));
    }
 
    private void configureSerialization(Element element)
    {
       if (element == null) return;
-      String objectInputStreamPoolSize = element.getAttribute("objectInputStreamPoolSize");
-      if (existsAttribute(objectInputStreamPoolSize)) config.setObjectInputStreamPoolSize(getInt(objectInputStreamPoolSize));
-      String objectOutputStreamPoolSize = element.getAttribute("objectOutputStreamPoolSize");
-      if (existsAttribute(objectOutputStreamPoolSize)) config.setObjectOutputStreamPoolSize(getInt(objectOutputStreamPoolSize));
-      String version = element.getAttribute("version");
+      String objectInputStreamPoolSize = getAttributeValue(element, "objectInputStreamPoolSize");
+      if (existsAttribute(objectInputStreamPoolSize))
+         config.setObjectInputStreamPoolSize(getInt(objectInputStreamPoolSize));
+      String objectOutputStreamPoolSize = getAttributeValue(element, "objectOutputStreamPoolSize");
+      if (existsAttribute(objectOutputStreamPoolSize))
+         config.setObjectOutputStreamPoolSize(getInt(objectOutputStreamPoolSize));
+      String version = getAttributeValue(element, "version");
       if (existsAttribute(version)) config.setReplVersionString(version);
-      String marshallerClass = element.getAttribute("marshallerClass");
+      String marshallerClass = getAttributeValue(element, "marshallerClass");
       if (existsAttribute(marshallerClass)) config.setMarshallerClass(marshallerClass);
-      String useLazyDeserialization = element.getAttribute("useLazyDeserialization");
+      String useLazyDeserialization = getAttributeValue(element, "useLazyDeserialization");
       if (existsAttribute(useLazyDeserialization)) config.setUseLazyDeserialization(getBoolean(useLazyDeserialization));
-      String useRegionBasedMarshalling = element.getAttribute("useRegionBasedMarshalling");
-      if (existsAttribute(useRegionBasedMarshalling)) config.setUseRegionBasedMarshalling(getBoolean(useRegionBasedMarshalling));
+      String useRegionBasedMarshalling = getAttributeValue(element, "useRegionBasedMarshalling");
+      if (existsAttribute(useRegionBasedMarshalling))
+         config.setUseRegionBasedMarshalling(getBoolean(useRegionBasedMarshalling));
    }
 
-   private void configureCustomInterceptors(Element singleElement)
+   private void configureCustomInterceptors(Element element)
    {
-      if (singleElement == null) return; //this element might be missing
-      NodeList interceptorNodes = singleElement.getElementsByTagName("interceptor");
+      if (element == null) return; //this element might be missing
+      NodeList interceptorNodes = element.getElementsByTagName("interceptor");
       List<CustomInterceptorConfig> interceptorConfigs = new ArrayList<CustomInterceptorConfig>(interceptorNodes.getLength());
       for (int i = 0; i < interceptorNodes.getLength(); i++)
       {
          Element interceptorElement = (Element) interceptorNodes.item(i);
-         String interceptorClass = interceptorElement.getAttribute("class");
+         String interceptorClass = getAttributeValue(interceptorElement, "class");
          Properties props = XmlConfigHelper.readPropertiesContents(interceptorElement, "properties");
          Element position = getSingleElement("position", interceptorElement);
-         String firstStr = position.getAttribute("first");
+         String firstStr = getAttributeValue(position, "first");
          boolean first = existsAttribute(firstStr) && getBoolean(firstStr);
-         String lastStr = position.getAttribute("last");
+         String lastStr = getAttributeValue(position, "last");
          boolean last = existsAttribute(lastStr) && getBoolean(lastStr);
-         String indexStr = position.getAttribute("index");
+         String indexStr = getAttributeValue(position, "index");
          int index = existsAttribute(indexStr) ? getInt(indexStr) : -1;
-         String before = position.getAttribute("before");
+         String before = getAttributeValue(position, "before");
          if (!existsAttribute(before)) before = null;
-         String after = position.getAttribute("after");
+         String after = getAttributeValue(position, "after");
          if (!existsAttribute(after)) after = null;
          CustomInterceptorConfig customInterceptorConfig = new CustomInterceptorConfig(interceptorClass, first, last,
                index, after, before, props);
@@ -160,51 +177,52 @@
       config.setCacheLoaderConfig(cacheLoaderConfig);
    }
 
-   private void configureEviction(Element evictionElement)
+   private void configureEviction(Element element)
    {
-      if (evictionElement == null) return; //no eviction might be configured
+      if (element == null) return; //no eviction might be configured
       EvictionElementParser evictionElementParser = new EvictionElementParser();
-      config.setEvictionConfig(evictionElementParser.parseEvictionElement(evictionElement));
+      config.setEvictionConfig(evictionElementParser.parseEvictionElement(element));
    }
 
    private void configureJmxStatistics(Element element)
    {
       if (element == null) return; //might not be specified
-      String enabled = element.getAttribute("enabled");
+      String enabled = getAttributeValue(element, "enabled");
       if (enabled != null) config.setExposeManagementStatistics(getBoolean(enabled));
    }
 
    private void configureShutdown(Element element)
    {
       if (element == null) return;
-      String hookBehavior = element.getAttribute("hookBehavior");
+      String hookBehavior = getAttributeValue(element, "hookBehavior");
       if (hookBehavior != null) config.setShutdownHookBehavior(hookBehavior);
    }
 
    private void configureTransport(Element element)
    {
       if (element == null) return; //transport might be missing
-      String clusterName = element.getAttribute("clusterName");
+      String clusterName = getAttributeValue(element, "clusterName");
       config.setClusterName(clusterName);
-      String multiplexerStack = element.getAttribute("multiplexerStack");
+      String multiplexerStack = getAttributeValue(element, "multiplexerStack");
       if (existsAttribute(multiplexerStack)) config.setMultiplexerStack(multiplexerStack);
       Element clusterConfig = getSingleElement("jgroupsConfig", element);
       if (clusterConfig != null)
       {
          JGroupsStackParser stackParser = new JGroupsStackParser();
          String clusterConfigStr = stackParser.parseClusterConfigXml(clusterConfig);
-         config.setClusterConfig(clusterConfigStr);
+         if (clusterConfigStr != null && clusterConfigStr.trim().length() > 0)
+            config.setClusterConfig(clusterConfigStr);
       }
    }
 
    private void configureStartup(Element element)
    {
       if (element == null) return; //we might not have this configured
-      String fetchInMemoryState = element.getAttribute("fetchInMemoryState");
+      String fetchInMemoryState = getAttributeValue(element, "fetchInMemoryState");
       if (existsAttribute(fetchInMemoryState)) config.setFetchInMemoryState(getBoolean(fetchInMemoryState));
-      String stateRetrievalTimeout = element.getAttribute("stateRetrievalTimeout");
+      String stateRetrievalTimeout = getAttributeValue(element, "stateRetrievalTimeout");
       if (existsAttribute(stateRetrievalTimeout)) config.setStateRetrievalTimeout(getLong(stateRetrievalTimeout));
-      String inactiveOnStartup = element.getAttribute("inactiveOnStartup");
+      String inactiveOnStartup = getAttributeValue(element, "inactiveOnStartup");
       if (existsAttribute(inactiveOnStartup)) config.setInactiveOnStartup(getBoolean(inactiveOnStartup));
    }
 
@@ -245,29 +263,30 @@
 
    private void configureSyncMode(Element element)
    {
-      String replTimeout = element.getAttribute("replTimeout");
+      String replTimeout = getAttributeValue(element, "replTimeout");
       if (replTimeout != null) config.setSyncReplTimeout(getLong(replTimeout));
    }
 
    private void configureAsyncMode(Element element)
    {
-      String useReplQueue = element.getAttribute("useReplQueue");
+      String useReplQueue = getAttributeValue(element, "useReplQueue");
       if (existsAttribute(useReplQueue)) config.setUseReplQueue(getBoolean(useReplQueue));
-      String replQueueInterval = element.getAttribute("replQueueInterval");
+      String replQueueInterval = getAttributeValue(element, "replQueueInterval");
       if (replQueueInterval != null) config.setReplQueueInterval(getLong(replQueueInterval));
-      String replQueueMaxElements = element.getAttribute("replQueueMaxElements");
+      String replQueueMaxElements = getAttributeValue(element, "replQueueMaxElements");
       if (replQueueMaxElements != null) config.setReplQueueMaxElements(getInt(replQueueMaxElements));
    }
 
-   private void configureLocking(Element locking)
+   private void configureLocking(Element element)
    {
-      String isolationLevel = locking.getAttribute("isolationLevel");
+      String isolationLevel = getAttributeValue(element, "isolationLevel");
       if (existsAttribute(isolationLevel)) config.setIsolationLevel(IsolationLevel.valueOf(isolationLevel));
-      String lockParentForChildInsertRemove = locking.getAttribute("lockParentForChildInsertRemove");
-      if (existsAttribute(lockParentForChildInsertRemove)) config.setLockParentForChildInsertRemove(getBoolean(lockParentForChildInsertRemove));
-      String lockAcquisitionTimeout = locking.getAttribute("lockAcquisitionTimeout");
+      String lockParentForChildInsertRemove = getAttributeValue(element, "lockParentForChildInsertRemove");
+      if (existsAttribute(lockParentForChildInsertRemove))
+         config.setLockParentForChildInsertRemove(getBoolean(lockParentForChildInsertRemove));
+      String lockAcquisitionTimeout = getAttributeValue(element, "lockAcquisitionTimeout");
       if (existsAttribute(lockAcquisitionTimeout)) config.setLockAcquisitionTimeout(getLong(lockAcquisitionTimeout));
-      String nodeLockingScheme = locking.getAttribute("nodeLockingScheme");
+      String nodeLockingScheme = getAttributeValue(element, "nodeLockingScheme");
       if (existsAttribute(nodeLockingScheme)) config.setNodeLockingScheme(nodeLockingScheme);
    }
 
@@ -287,7 +306,7 @@
          root.normalize();
       } catch (Exception e)
       {
-         throw new ConfigurationException("Could not parse the ");
+         throw new ConfigurationException("Could not parseStream the ");
       }
    }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -376,8 +376,7 @@
             ec.setDefaultEvictionPolicyClass(temp);
          }
 
-         temp = XmlConfigHelper.getTagContents(element,
-               "wakeUpIntervalSeconds", ATTR, NAME);
+         temp = XmlConfigHelper.getTagContents(element, "wakeUpIntervalSeconds", ATTR, NAME);
 
          int wakeupIntervalSeconds = 0;
          if (temp != null)
@@ -501,7 +500,6 @@
 
       erc.setEvictionPolicyConfig(epc);
       return erc;
-
    }
 
    /**

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlParserBase.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -2,6 +2,7 @@
 
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
+import org.jboss.util.StringPropertyReplacer;
 
 /**
  * Contains utility methods that might be useful to most of the parsers.
@@ -42,4 +43,10 @@
       }
       return (Element) nodeList.item(0);
    }
+
+   protected String getAttributeValue(Element element, String attrName)
+   {
+      String value = element.getAttribute(attrName);
+      return value == null ? null : StringPropertyReplacer.replaceProperties(value);
+   }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/BuddyElementParser.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -23,11 +23,11 @@
    public BuddyReplicationConfig parseBuddyElement(Element element)
    {
       BuddyReplicationConfig brc = new BuddyReplicationConfig();
-      String enabled = element.getAttribute("enabled");
+      String enabled = getAttributeValue(element, "enabled");
       if (existsAttribute(enabled)) brc.setEnabled(getBoolean(enabled));
-      String buddyPoolName = element.getAttribute("poolName");
+      String buddyPoolName = getAttributeValue(element, "poolName");
       if (existsAttribute(buddyPoolName)) brc.setBuddyPoolName(buddyPoolName);
-      String buddyCommunicationTimeout = element.getAttribute("communicationTimeout");
+      String buddyCommunicationTimeout = getAttributeValue(element, "communicationTimeout");
       if (existsAttribute(buddyCommunicationTimeout))
          brc.setBuddyCommunicationTimeout(getInt(buddyCommunicationTimeout));
 
@@ -41,7 +41,7 @@
    {
       if (element == null) return defaultBuddyLocatorConfig();
       BuddyReplicationConfig.BuddyLocatorConfig result = new BuddyReplicationConfig.BuddyLocatorConfig();
-      String buddyLocatorClass = element.getAttribute("class");
+      String buddyLocatorClass = getAttributeValue(element, "class");
       if (existsAttribute(buddyLocatorClass)) result.setBuddyLocatorClass(buddyLocatorClass);
       Properties existing = new Properties();
       Properties configured = XmlConfigHelper.readPropertiesContents(element, "properties");
@@ -63,11 +63,11 @@
    private void parseDataGravitationElement(Element element, BuddyReplicationConfig brc)
    {
       if (element == null) return;
-      String auto = element.getAttribute("auto");
+      String auto = getAttributeValue(element, "auto");
       if (existsAttribute(auto)) brc.setAutoDataGravitation(getBoolean(auto));
-      String removeOnFind = element.getAttribute("removeOnFind");
+      String removeOnFind = getAttributeValue(element, "removeOnFind");
       if (existsAttribute(removeOnFind)) brc.setDataGravitationRemoveOnFind(getBoolean(removeOnFind));
-      String searchBackupTrees = element.getAttribute("searchBackupTrees");
+      String searchBackupTrees = getAttributeValue(element, "searchBackupTrees");
       if (existsAttribute(searchBackupTrees)) brc.setDataGravitationSearchBackupTrees(getBoolean(searchBackupTrees));
    }
 }

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/EvictionElementParser.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -31,7 +31,7 @@
    public EvictionConfig parseEvictionElement(Element evictionElement)
    {
       EvictionConfig evictionConfig = new EvictionConfig();
-      String wakeUpInterval = evictionElement.getAttribute("wakeUpInterval");
+      String wakeUpInterval = getAttributeValue(evictionElement, "wakeUpInterval");
       if (existsAttribute(wakeUpInterval)) evictionConfig.setWakeupInterval(getInt(wakeUpInterval));
 
       Element element = getSingleElement("defaults", evictionElement);
@@ -62,17 +62,17 @@
    private void processDefaults(EvictionConfig evictionConfig, Element element)
    {
       if (element == null) return;
-      String policyClass = element.getAttribute("policyClass");
+      String policyClass = getAttributeValue(element, "policyClass");
       if (existsAttribute(policyClass)) evictionConfig.setDefaultEvictionPolicyClass(policyClass);
-      String eventQueueSize = element.getAttribute("eventQueueSize");
+      String eventQueueSize = getAttributeValue(element, "eventQueueSize");
       if (existsAttribute(eventQueueSize)) evictionConfig.setDefaultEventQueueSize(getInt(eventQueueSize));
    }
 
    private EvictionRegionConfig getEvictionRegionConfig(Element element, String defaultPolicyClass, int defaultEventQueueSize)
    {
       EvictionRegionConfig erc = new EvictionRegionConfig();
-      erc.setRegionName(element.getAttribute("name"));
-      String queueSize = element.getAttribute("eventQueueSize");
+      erc.setRegionName(getAttributeValue(element, "name"));
+      String queueSize = getAttributeValue(element, "eventQueueSize");
       if (existsAttribute(queueSize))
       {
          erc.setEventQueueSize(getInt(queueSize));
@@ -81,7 +81,7 @@
       {
          erc.setEventQueueSize(defaultEventQueueSize);
       }
-      String policyClass = element.getAttribute("policyClass");
+      String policyClass = getAttributeValue(element, "policyClass");
       if (!existsAttribute(policyClass))
       {
          if (defaultPolicyClass == null)

Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -24,9 +24,9 @@
    public CacheLoaderConfig parseLoadersElement(Element element)
    {
       CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
-      String passivation = element.getAttribute("passivation");
+      String passivation = getAttributeValue(element, "passivation");
       if (existsAttribute(passivation)) cacheLoaderConfig.setPassivation(getBoolean(passivation));
-      String shared = element.getAttribute("shared");
+      String shared = getAttributeValue(element, "shared");
       if (existsAttribute(shared)) cacheLoaderConfig.setShared(getBoolean(shared));
       String preload = getPreloadString(getSingleElement("preload", element));
       if (preload != null) cacheLoaderConfig.setPreload(preload);
@@ -45,15 +45,15 @@
    {
       CacheLoaderConfig.IndividualCacheLoaderConfig iclc = new CacheLoaderConfig.IndividualCacheLoaderConfig();
 
-      String async = indivElement.getAttribute("async");
+      String async = getAttributeValue(indivElement, "async");
       if (existsAttribute(async)) iclc.setAsync(getBoolean(async));
-      String fetchPersistentState = indivElement.getAttribute("fetchPersistentState");
+      String fetchPersistentState = getAttributeValue(indivElement, "fetchPersistentState");
       if (existsAttribute(fetchPersistentState)) iclc.setFetchPersistentState(getBoolean(fetchPersistentState));
-      String ignoreModifications = indivElement.getAttribute("ignoreModifications");
+      String ignoreModifications = getAttributeValue(indivElement, "ignoreModifications");
       if (existsAttribute(ignoreModifications)) iclc.setIgnoreModifications(getBoolean(ignoreModifications));
-      String purgeOnStartup = indivElement.getAttribute("purgeOnStartup");
+      String purgeOnStartup = getAttributeValue(indivElement, "purgeOnStartup");
       if (existsAttribute(purgeOnStartup)) iclc.setPurgeOnStartup(getBoolean(purgeOnStartup));
-      String clClass = indivElement.getAttribute("class");
+      String clClass = getAttributeValue(indivElement, "class");
       if (!existsAttribute(clClass))
          throw new ConfigurationException("Missing 'class'  attribute for cache loader configuration");
       iclc.setClassName(clClass);
@@ -74,7 +74,7 @@
       for (int i = 0; i < nodesToPreload.getLength(); i++)
       {
          Element node = (Element) nodesToPreload.item(i);
-         String fqn2preload = node.getAttribute("fqn");
+         String fqn2preload = getAttributeValue(node, "fqn");
          if (!existsAttribute(fqn2preload))
             throw new ConfigurationException("Missing 'fqn' attribute in 'preload\\norde' tag");
          if (i > 0) result.append(",");
@@ -91,9 +91,8 @@
    public CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig parseSingletonStoreConfig(Element element)
    {
       if (element == null) return null; //might happen, this config option is not mandatory
-      String enabled = element.getAttribute("enabled");
-      boolean singletonStoreEnabled = getBoolean(element.getAttribute("enabled"));
-      String singletonStoreClass = element.getAttribute("class");
+      boolean singletonStoreEnabled = getBoolean(getAttributeValue(element, "enabled"));
+      String singletonStoreClass = getAttributeValue(element, "class");
       CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig ssc = new CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig();
       if (existsAttribute(singletonStoreClass)) ssc.setSingletonStoreClass(singletonStoreClass);
       Properties singletonStoreproperties = XmlConfigHelper.readPropertiesContents(element, "properties");

Modified: core/trunk/src/main/java/org/jboss/cache/eviction/LRUConfiguration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/LRUConfiguration.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/LRUConfiguration.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -139,7 +139,7 @@
    }
 
    /**
-    * Requires a positive timeToLiveSeconds value or ConfigurationException
+    * Requires a positive timeToLive value or ConfigurationException
     * is thrown.
     */
    @Override

Modified: core/trunk/src/main/release/build.xml
===================================================================
--- core/trunk/src/main/release/build.xml	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/release/build.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -20,7 +20,7 @@
    <property name="jvm.localhost" value="-Dbind.address=127.0.0.1"/>
    <property name="jvm.ms" value="-Xms128M"/>
    <property name="jvm.mx" value="-Xms1024M"/>
-   <property name="demo.cfg.file" value="META-INF/total-replication-cache-service.xml"/>
+   <property name="demo.cfg.file" value="META-INF/total-replication-cache.xml"/>
 
    <property environment="env"/>
 

Deleted: core/trunk/src/main/resources/cache-config.xml
===================================================================
--- core/trunk/src/main/resources/cache-config.xml	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/resources/cache-config.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-   
-	<mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper" 
-          name="jboss.cache:service=LabconnTreeCacheAop">
-      <depends>jboss:service=Naming</depends>
-      <depends>jboss:service=TransactionManager</depends>
-      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
-      </attribute>
-      <attribute name="IsolationLevel">READ_COMMITTED</attribute>
-
-      <attribute name="CacheMode">LOCAL</attribute>
-
-      <attribute name="CacheLoaderConfig" replace="false">
-         <config>
-            <cacheloader>
-               <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
-               <properties>
-                  location=./
-               </properties>
-            </cacheloader>
-         </config>
-      </attribute>
-   </mbean>
-</server>   

Modified: core/trunk/src/main/resources/config2to3.xslt
===================================================================
--- core/trunk/src/main/resources/config2to3.xslt	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/main/resources/config2to3.xslt	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,7 +11,6 @@
          <xsl:call-template name="startup"/>
          <xsl:call-template name="transport"/>
          <xsl:apply-templates select="//attribute"/>
-         <!--<xsl:call-template name="invalidation"/>         -->
       </xsl:element>
    </xsl:template>
 
@@ -282,6 +281,11 @@
          </xsl:if>
          <xsl:if test="./config/region[@name='/_default_']">
             <root>
+               <xsl:if test="./config/region[@name='/_default_' and string-length(@policyClass) > 0]">
+                  <xsl:attribute name="policyClass">
+                     <xsl:value-of select="./config/region[@name='/_default_' and string-length(@policyClass) > 0]/@policyClass"/>
+                  </xsl:attribute>
+               </xsl:if>
                <xsl:copy-of select="./config/region[@name='/_default_']/*"/>
             </root>
          </xsl:if>
@@ -292,13 +296,18 @@
                      <xsl:value-of select="@name"/>
                   </xsl:attribute>
                </xsl:if>
+               <xsl:if test="@policyClass">
+                  <xsl:attribute name="policyClass">
+                     <xsl:value-of select="@policyClass"/>
+                  </xsl:attribute>
+               </xsl:if>
                <xsl:copy-of select="./*"/>
             </region>
          </xsl:for-each>
       </eviction>
    </xsl:template>
 
-   <xsl:template match="//attribute[@name='CacheLoaderConfiguration']">
+   <xsl:template match="//attribute[@name='CacheLoaderConfig'] | //attribute[@name='CacheLoaderConfiguration']">
       <loaders>
          <xsl:if test="./config/passivation">
             <xsl:attribute name="passivation">

Modified: core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/CacheFactoryTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -7,7 +7,7 @@
 package org.jboss.cache;
 
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.util.TestingUtil;
 import org.jboss.cache.transaction.DummyTransactionManagerLookup;
@@ -25,13 +25,13 @@
 public class CacheFactoryTest
 {
    Configuration expected;
-   String configFile = "META-INF/conf-test/replSync-service.xml";
+   String configFile = "configs/replSync.xml";
    private CacheSPI cache;
 
    @BeforeMethod(alwaysRun = true)
    public void setUp()
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
+      XmlConfigurationParser parser = new XmlConfigurationParser();
       expected = parser.parseFile(configFile);
    }
 

Modified: core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/api/CacheAPITest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -43,7 +43,7 @@
    {
       // start a single cache instance
       CacheFactory<String, String> cf = new DefaultCacheFactory<String, String>();
-      cache = cf.createCache("META-INF/conf-test/local-tx-service.xml", false);
+      cache = cf.createCache("configs/local-tx.xml", false);
       cache.getConfiguration().setNodeLockingScheme(getNodeLockingScheme());
       cache.start();
       events.clear();

Modified: core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/api/DestroyedCacheAPITest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -40,7 +40,7 @@
    {
       // start a single cache instance
       CacheFactory<String, String> cf = new DefaultCacheFactory();
-      cache = cf.createCache("META-INF/conf-test/local-tx-service.xml", false);
+      cache = cf.createCache("configs/local-tx.xml", false);
       cache.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
       cache.start();
       version = cache.getVersion();

Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeAPITest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -46,7 +46,7 @@
    public void setUp() throws Exception
    {
       // start a single cache instance
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("META-INF/conf-test/local-tx-service.xml", false);
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("configs/local-tx.xml", false);
       cache.getConfiguration().setNodeLockingScheme(getNodeLockingScheme());
       cache.start();
       rootNode = cache.getRoot();
@@ -248,7 +248,7 @@
 
    public void testDefensiveCopyOfChildren()
    {
-      Fqn childFqn = Fqn.fromString("/child");
+      Fqn<String> childFqn = Fqn.fromString("/child");
       rootNode.addChild(childFqn).put("k", "v");
       Set<Node<Object, Object>> children = rootNode.getChildren();
       Set<Object> childrenNames = rootNode.getChildrenNames();
@@ -289,7 +289,7 @@
 
    public void testGetChildrenUnderTx() throws Exception
    {
-      Fqn A_B = Fqn.fromRelativeFqn(A, B);
+      Fqn<Object> A_B = Fqn.fromRelativeFqn(A, B);
       Fqn A_C = Fqn.fromRelativeFqn(A, C);
       tm.begin();
       cache.put(A_B, "1", "1");

Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -47,7 +47,7 @@
    public void setUp() throws Exception
    {
       // start a single cache instance
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache("META-INF/conf-test/local-tx-service.xml", false);
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache("configs/local-tx.xml", false);
       cache.getConfiguration().setNodeLockingScheme(nodeLockingScheme);
       cache.start();
       rootNode = cache.getRoot();

Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationConfigTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,7 +11,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.interceptors.DataGravitatorInterceptor;
 import org.jboss.cache.interceptors.base.CommandInterceptor;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
@@ -84,7 +84,7 @@
 
    public void testXmlConfig() throws Exception
    {
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(new XmlConfigurationParser2x().parseFile("META-INF/buddy-replication-cache-service.xml"), false);
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(new XmlConfigurationParser().parseFile("configs/buddy-replication-cache.xml"), false);
       cache.create();
       cache.start();
       BuddyManager bm = cache.getBuddyManager();

Modified: core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -7,25 +7,20 @@
 package org.jboss.cache.config;
 
 
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.util.List;
-import java.util.Properties;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.config.Configuration.NodeLockingScheme;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.eviction.LRUPolicy;
+import static org.testng.AssertJUnit.*;
 import org.testng.annotations.Test;
 
+import java.util.List;
+import java.util.Properties;
+
 /**
  * Tests the ability to clone Configuration elements and end up with
  * independently modifiable configurations.
@@ -36,13 +31,13 @@
 public class ConfigurationCloningTest
 {
    /** A file that includes every configuration element I could think of */
-   public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/conf-test/clonable-config-service.xml";
+   public static final String DEFAULT_CONFIGURATION_FILE = "/configs/clonable-config.xml";
    
    private static final Log log = LogFactory.getLog(ConfigurationCloningTest.class);
    
    public void testClone() throws Exception
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
+      XmlConfigurationParser parser = new XmlConfigurationParser();
       Configuration c = parser.parseFile(DEFAULT_CONFIGURATION_FILE);
       
       try {
@@ -50,28 +45,11 @@
          
          // Test a few simple properties 
          assertEquals(NodeLockingScheme.OPTIMISTIC, clone.getNodeLockingScheme());   
-         assertEquals(CacheMode.INVALIDATION_SYNC, clone.getCacheMode());   
+         assertEquals(CacheMode.REPL_SYNC, clone.getCacheMode());
          assertEquals("CloneCluster", clone.getClusterName());   
          assertEquals(c.getClusterConfig(), clone.getClusterConfig());   
-         assertEquals(3, clone.getStateRetrievalTimeout());   
+         assertEquals(3, clone.getStateRetrievalTimeout());
          
-         // Buddy replication config
-         BuddyReplicationConfig brc1 = c.getBuddyReplicationConfig();
-         BuddyReplicationConfig brc2 = clone.getBuddyReplicationConfig();
-         
-         assertFalse(brc1 == brc2);
-         
-         assertEquals(7, brc2.getBuddyCommunicationTimeout());
-         assertEquals("cloneGroup", brc2.getBuddyPoolName());
-         
-         BuddyLocatorConfig blc1 = brc1.getBuddyLocatorConfig();
-         BuddyLocatorConfig blc2 = brc2.getBuddyLocatorConfig();
-         assertFalse(blc1 == blc2);
-         Properties p1 = blc1.getBuddyLocatorProperties();
-         Properties p2 = blc2.getBuddyLocatorProperties();
-         assertFalse(p1 == p2);
-         assertEquals(p1, p2);
-         
          // Eviction
          EvictionConfig ec1 = c.getEvictionConfig();
          EvictionConfig ec2 = clone.getEvictionConfig();

Modified: core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -12,7 +12,7 @@
 
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.transaction.TransactionSetup;
 import org.testng.annotations.Test;
@@ -47,8 +47,8 @@
 
    public void testMultiplexerStack() throws Exception
    {
-      XmlConfigurationParser2x parser = new XmlConfigurationParser2x();
-      Configuration conf = parser.parseFile("META-INF/conf-test/mux-service.xml");
+      XmlConfigurationParser parser = new XmlConfigurationParser();
+      Configuration conf = parser.parseFile("configs/mux.xml");
 
       // test that multiplexer settings have been read in properly.
       //assertEquals("MultiplexerService", "jgroups.mux:name=Multiplexer", conf.getMultiplexerService());

Modified: core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -26,7 +26,7 @@
 public class ConfigurationTransformerTest
 {
    public static final String XSLT_FILE = "config2to3.xslt";
-   private static final String BASE_DIR = "META-INF/config2.x";
+   private static final String BASE_DIR = "configs/conf2x";
    ConfigFilesConvertor convertor = new ConfigFilesConvertor();
 
    /**
@@ -34,14 +34,15 @@
     */
    public void testSingleFile() throws Exception
    {
-      String fileName = getFileName("/optimistically-locked-cache-service.xml");
+      String fileName = getFileName("/default-test-config2x.xml");
       ByteArrayOutputStream baos = new ByteArrayOutputStream();
       convertor.parse(fileName, baos, XSLT_FILE);
+      System.out.println("result = \n" + baos);
 
       XmlConfigurationParser newParser = new XmlConfigurationParser();
       XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
 
-      Configuration newConfig = newParser.parse(new ByteArrayInputStream(baos.toByteArray()));
+      Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
       Configuration oldConfig = oldParser.parseFile(fileName);
 
       assert oldConfig.equals(newConfig);
@@ -49,9 +50,10 @@
 
    public void testEqualityOnTransformedFiles() throws Exception
    {
-      String[] fileNames = {"buddy-replication-cache-service.xml", "cacheloader-enabled-cache-service.xml",
-            "eviction-enabled-cache-service.xml", "local-cache-service.xml", "multiplexer-enabled-cache-service.xml",
-            "optimistically-locked-cache-service.xml", "total-replication-cache-service.xml"};
+      String[] fileNames = {"buddy-replication-cache.xml", "cacheloader-enabled-cache.xml",
+            "eviction-enabled-cache.xml", "local-cache.xml", "multiplexer-enabled-cache.xml",
+            "optimistically-locked-cache.xml", "total-replication-cache.xml", "clonable-config.xml",
+            "policyPerRegion-eviction.xml" , "default-test-config2x.xml"};
       for (String file : fileNames)
       {
          System.out.println("Processing file = " + file);
@@ -62,7 +64,7 @@
          XmlConfigurationParser newParser = new XmlConfigurationParser();
          XmlConfigurationParser2x oldParser = new XmlConfigurationParser2x();
 
-         Configuration newConfig = newParser.parse(new ByteArrayInputStream(baos.toByteArray()));
+         Configuration newConfig = newParser.parseStream(new ByteArrayInputStream(baos.toByteArray()));
          Configuration oldConfig = oldParser.parseFile(fileName);
 
          assert newConfig.equals(oldConfig);

Modified: core/trunk/src/test/java/org/jboss/cache/config/StringPropertyReplacementTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/StringPropertyReplacementTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/StringPropertyReplacementTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -13,11 +13,10 @@
 
 import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig;
 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.config.Configuration.NodeLockingScheme;
 import org.jboss.cache.eviction.LRUConfiguration;
 import org.jboss.cache.eviction.LRUPolicy;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -31,16 +30,14 @@
 @Test(groups = {"functional"})
 public class StringPropertyReplacementTest
 {
-   public static final String STRING_REPLACED_FILE = "META-INF/conf-test/string-property-replaced-service.xml";
+   public static final String STRING_REPLACED_FILE = "configs/string-property-replaced.xml";
    
    private static final String PROP_BASE = "test.property.";
-   private static final String CACHE_MODE_PROP = PROP_BASE + "CacheMode";
    private static final String SYNC_COMMIT_PROP = PROP_BASE + "SyncCommitPhase";
    private static final String NUM_BUDDIES_PROP = PROP_BASE + "BuddyReplicationConfig.numBuddies";
    private static final String MAX_NODES_PROP = PROP_BASE + "EvictionPolicyConfig.maxNodes";
    private static final String BUDDY_POOL_PROP = PROP_BASE + "BuddyReplicationConfig.buddyPoolName";
    
-   private String cacheMode;
    private String numBuddies;
    private String syncCommitPhase;
    private String maxNodes;
@@ -49,7 +46,6 @@
    @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception
    {
-      cacheMode = System.getProperty(CACHE_MODE_PROP);
       numBuddies = System.getProperty(NUM_BUDDIES_PROP);
       syncCommitPhase = System.getProperty(SYNC_COMMIT_PROP);
       maxNodes = System.getProperty(MAX_NODES_PROP);
@@ -59,11 +55,6 @@
    @AfterMethod(alwaysRun = true)
    public void tearDown() throws Exception
    {
-      if (cacheMode == null)
-         System.clearProperty(CACHE_MODE_PROP);
-      else
-         System.setProperty(CACHE_MODE_PROP, cacheMode);
-
       if (numBuddies == null)
          System.clearProperty(NUM_BUDDIES_PROP);
       else
@@ -87,16 +78,14 @@
    
    public void testStringPropertyReplacement() throws Exception
    {
-      System.setProperty(CACHE_MODE_PROP, "REPL_SYNC");
       System.setProperty(NUM_BUDDIES_PROP, "3");
       System.setProperty(SYNC_COMMIT_PROP, "false");
       System.setProperty(MAX_NODES_PROP, "1000");
       System.setProperty(BUDDY_POOL_PROP, "replaced");
       
-      Configuration cfg = new XmlConfigurationParser2x().parseFile(STRING_REPLACED_FILE);
+      Configuration cfg = new XmlConfigurationParser().parseFile(STRING_REPLACED_FILE);
       
       assertEquals(NodeLockingScheme.OPTIMISTIC, cfg.getNodeLockingScheme());
-      assertEquals(CacheMode.REPL_SYNC, cfg.getCacheMode());
       assertFalse(cfg.isSyncCommitPhase());
       assertTrue(cfg.isSyncRollbackPhase());
       assertEquals(15000, cfg.getLockAcquisitionTimeout());

Added: core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java	                        (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/EvictionElementParserTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,206 @@
+package org.jboss.cache.config.parsing;
+
+import org.testng.annotations.Test;
+import org.jboss.cache.config.parsing.element.EvictionElementParser;
+import org.jboss.cache.config.ConfigurationException;
+import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.EvictionRegionConfig;
+import org.jboss.cache.config.MissingPolicyException;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.RegionManager;
+import org.jboss.cache.eviction.MRUConfiguration;
+import org.jboss.cache.eviction.LRUConfiguration;
+import org.w3c.dom.Element;
+
+/**
+ * Tester class for {@link org.jboss.cache.config.parsing.element.EvictionElementParser}.
+ *
+ * @author Mircea.Markus at jboss.com
+ * @since 3.0
+ */
+ at Test(groups = "unit")
+public class EvictionElementParserTest
+{
+   EvictionElementParser parser = new EvictionElementParser();
+
+   /**
+    * Test that when nodes are not specified the config defaults to certain values.
+    */
+   public void testDefaults()
+   {
+      String xml =
+            "   <eviction wakeUpInterval=\"5\">\n" +
+                  "      <defaults policyClass=\"org.jboss.cache.eviction.MRUPolicy\"/>\n" +
+                  "      <region name=\"/org/jboss/xyz\" policyClass=\"org.jboss.cache.eviction.MRUPolicy\" eventQueueSize=\"21\">\n" +
+                  "         <attribute name=\"maxNodes\">2103</attribute>\n" +
+                  "         <attribute name=\"minTimeToLive\">22</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      EvictionConfig evictionConfig = getEvictionConfig(xml);
+      assert evictionConfig.getDefaultEventQueueSize() == EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT;
+   }
+
+   /**
+    *
+    */
+   public void testNormalConfig()
+   {
+      String xml =
+            "   <eviction wakeUpInterval=\"5\">\n" +
+                  "      <defaults policyClass=\"org.jboss.cache.eviction.MRUPolicy\" eventQueueSize=\"123456\"/>\n" +
+                  "      <root>\n" +
+                  "         <attribute name=\"maxNodes\">6</attribute>\n" +
+                  "         <attribute name=\"minTimeToLive\">7</attribute>\n" +
+                  "      </root>\n" +
+                  "      <region name=\"/org/jboss/data\">\n" +
+                  "         <attribute name=\"minTimeToLive\">1002</attribute>\n" +
+                  "         <attribute name=\"maxNodes\">2021</attribute>\n" +
+                  "      </region>\n" +
+                  "      <region name=\"/org/jboss/xyz\" policyClass=\"org.jboss.cache.eviction.LRUPolicy\" eventQueueSize=\"21\">\n" +
+                  "         <attribute name=\"maxNodes\">2103</attribute>\n" +
+                  "         <attribute name=\"timeToLive\">22</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      EvictionConfig config = getEvictionConfig(xml);
+      //tests the defaults
+      assert config.getWakeupInterval() == 5;
+      assert config.getDefaultEvictionPolicyClass().equals("org.jboss.cache.eviction.MRUPolicy");
+      assert config.getDefaultEventQueueSize() == 123456;
+      assert config.getEvictionRegionConfigs().size() == 3;
+
+      //test first region config
+      EvictionRegionConfig erConfig1 = config.getEvictionRegionConfigs().get(0);
+      erConfig1.getRegionFqn().equals(Fqn.ROOT);
+      MRUConfiguration defaultPolicyonfig = (MRUConfiguration) erConfig1.getEvictionPolicyConfig();
+      assert defaultPolicyonfig.getMaxNodes() == 6;
+      assert defaultPolicyonfig.getMinTimeToLive() == 7;
+
+      //test second region config
+      EvictionRegionConfig erConfig2 = config.getEvictionRegionConfigs().get(1);
+      assert erConfig2.getEventQueueSize() == 123456;
+      assert erConfig2.getRegionFqn().equals(Fqn.fromString("/org/jboss/data"));
+      MRUConfiguration mruConfiguration = (MRUConfiguration) erConfig2.getEvictionPolicyConfig();
+      assert mruConfiguration.getMinTimeToLive() == 1002;
+      assert mruConfiguration.getMaxNodes() == 2021;
+
+      //test 3rd region config
+      EvictionRegionConfig erConfig3 = config.getEvictionRegionConfigs().get(2);
+      assert erConfig3.getEventQueueSize() == 21;
+      assert erConfig3.getRegionFqn().equals(Fqn.fromString("/org/jboss/xyz"));
+      LRUConfiguration lruConfiguration = (LRUConfiguration) erConfig3.getEvictionPolicyConfig();
+      assert lruConfiguration.getTimeToLive() == 22;
+      assert lruConfiguration.getMaxNodes() == 2103;
+   }
+
+   public void testLruConfig()
+   {
+      String xml =
+            "   <eviction wakeUpInterval=\"45000\">\n" +
+                  "      <defaults policyClass=\"org.jboss.cache.eviction.LRUPolicy\" eventQueueSize=\"4\"/>\n" +
+                  "      <root>\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "         <attribute name=\"timeToLiveSeconds\">1000</attribute>\n" +
+                  "         <attribute name=\"maxAge\">15000</attribute>\n" +
+                  "      </root>\n" +
+                  "      <region name=\"/fifo\">\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "      </region>\n" +
+                  "      <region name=\"/mru\">\n" +
+                  "         <attribute name=\"maxNodes\">10000</attribute>\n" +
+                  "      </region>\n" +
+                  "      <region name=\"/lfu\">\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "         <attribute name=\"minNodes\">4000</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      EvictionConfig evConfig = getEvictionConfig(xml);
+      EvictionRegionConfig evictionRegionConfig = evConfig.getEvictionRegionConfigs().get(0);
+      assert evictionRegionConfig.getRegionName().equals(RegionManager.DEFAULT_REGION.toString());
+      assert evictionRegionConfig.getRegionName().equals(RegionManager.DEFAULT_REGION.toString());
+      assert ((LRUConfiguration) evictionRegionConfig.getEvictionPolicyConfig()).getTimeToLiveSeconds() == 1000;
+      assert ((LRUConfiguration) evictionRegionConfig.getEvictionPolicyConfig()).getTimeToLive() == 1000000;
+   }
+
+   /**
+    * This is an mandatory parameter, if it is not present then an configuration exception is expected.
+    */
+   public void testMissingWakeUpInterval() throws Exception
+   {
+      String xml =
+            "   <eviction defaultPolicyClass=\"org.jboss.cache.eviction.LRUPolicy\" defaultEventQueueSize=\"200000\">\n" +
+                  "      <default>\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "         <attribute name=\"timeToLive\">1000</attribute>\n" +
+                  "      </default>\n" +
+                  "      <region name=\"/org/jboss/data\">\n" +
+                  "         <attribute name=\"timeToLive\">1002</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      try
+      {
+         getEvictionConfig(xml);
+         assert false : "exception expected as wake up interval is not set";
+      } catch (ConfigurationException e)
+      {
+         //expected
+      }
+   }
+
+   /**
+    * If no policy is configured at region basis, and also no policy is configured at region basis,
+    * exception is expected.
+    */
+   public void testMissingPolicyOnRegion()
+   {
+      String xml =
+            "   <eviction defaultPolicyClass=\"org.jboss.cache.eviction.LRUPolicy\" defaultEventQueueSize=\"200000\">\n" +
+                  "      <region name=\"/org/jboss/data\">\n" +
+                  "         <attribute name=\"timeToLive\">1002</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      try
+      {
+         getEvictionConfig(xml);
+         assert false : "missing policy in both default and region, exception expected.";
+      } catch (MissingPolicyException e)
+      {
+         //expected
+      }
+   }
+
+   private EvictionConfig getEvictionConfig(String xml)
+   {
+      Element el;
+      try
+      {
+         el = XmlConfigHelper.stringToElement(xml);
+      } catch (Exception e)
+      {
+         throw new ConfigurationException(e);
+      }
+      return parser.parseEvictionElement(el);
+   }
+
+   public void testMissingDefaultEvictionClass() throws Exception
+   {
+      String xml =
+            "   <eviction wakeUpInterval=\"5000\">\n" +
+                  "      <root>\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "         <attribute name=\"timeToLiveSeconds\">1000</attribute>\n" +
+                  "      </root>\n" +
+                  "      <region name=\"/org/jboss/data\" policyClass=\"org.jboss.cache.eviction.LFUPolicy\">\n" +
+                  "         <attribute name=\"maxNodes\">5000</attribute>\n" +
+                  "         <attribute name=\"minNodes\">1000</attribute>\n" +
+                  "      </region>\n" +
+                  "   </eviction>";
+      try
+      {
+         getEvictionConfig(xml);
+         assert false : " excewption expectecd as root does not have a eviction policy defined"; 
+      } catch (MissingPolicyException e)
+      {
+         //expected
+      }
+   }
+}

Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/JGroupsStackParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/JGroupsStackParserTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/JGroupsStackParserTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -74,4 +74,11 @@
       assert result.indexOf("num_initial_members=3") > 0;
       assert result.indexOf("min_interval=10000") > 0;
    }
+
+   public void testParsingEmptyConfig() throws Exception
+   {
+      String xml = "<jgroupsConfig/>";
+      Element element = XmlConfigHelper.stringToElement(xml);
+      String result = parser.parseClusterConfigXml(element);
+   }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -22,7 +22,7 @@
    public void setUp()
    {
       XmlConfigurationParser parser = new XmlConfigurationParser();
-      config = parser.parseFile("META-INF/conf-test/parser-test-file-3.x.xml");
+      config = parser.parseFile("/configs/parser-test-file-3.x.xml");
    }
 
    public void testTransactionManagerLookupClass()

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/EvictionConfigurationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/EvictionConfigurationTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/EvictionConfigurationTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,16 +11,12 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.Region;
 import org.jboss.cache.RegionManager;
-import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.config.EvictionPolicyConfig;
-import org.jboss.cache.config.Configuration;
 import org.jboss.cache.lock.IsolationLevel;
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertTrue;
 import org.testng.annotations.Test;
 
-import java.net.URL;
-
 /**
  * Unit test to test Eviction configuration types.
  *
@@ -35,7 +31,7 @@
 
    public void testPolicyPerRegion() throws Exception
    {
-      this.setupCache("META-INF/conf-test/policyPerRegion-eviction-service.xml");
+      this.setupCache("configs/policyPerRegion-eviction.xml");
       assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());
 
       Region region = regionManager.getRegion("/org/jboss/data", true);
@@ -89,7 +85,7 @@
 
    public void testMixedPolicies() throws Exception
    {
-      this.setupCache("META-INF/conf-test/mixedPolicy-eviction-service.xml");
+      this.setupCache("configs/mixedPolicy-eviction.xml");
       assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());
 
       Region region = regionManager.getRegion("/org/jboss/data", true);
@@ -134,7 +130,7 @@
 
    public void testLegacyPolicyConfiguration() throws Exception
    {
-      this.setupCache("META-INF/conf-test/local-lru-eviction-service.xml");
+      this.setupCache("configs/local-lru-eviction.xml");
       assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());
 
       Region region = regionManager.getRegion("/org/jboss/data", false);
@@ -191,8 +187,8 @@
 
    public void testTwoCacheInstanceConfiguration() throws Exception
    {
-      this.setupCache("META-INF/conf-test/local-lru-eviction-service.xml");
-      this.setupCache("META-INF/conf-test/local-lru-eviction-service.xml");
+      this.setupCache("configs/local-lru-eviction.xml");
+      this.setupCache("configs/local-lru-eviction.xml");
    }
 
    public void testNoEviction() throws Exception

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -8,7 +8,7 @@
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.config.EvictionPolicyConfig;
 import org.jboss.cache.config.EvictionRegionConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.interceptors.EvictionInterceptor;
 import org.jboss.cache.util.TestingUtil;

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -31,7 +31,7 @@
 import org.jboss.cache.config.Configuration;
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.config.EvictionRegionConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.lock.IsolationLevel;

Modified: core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/RegionManagerTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -6,7 +6,7 @@
 import org.jboss.cache.config.EvictionConfig;
 import org.jboss.cache.config.EvictionPolicyConfig;
 import org.jboss.cache.config.EvictionRegionConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.BeforeMethod;

Modified: core/trunk/src/test/java/org/jboss/cache/factories/UnitTestCacheConfigurationFactory.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/UnitTestCacheConfigurationFactory.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/factories/UnitTestCacheConfigurationFactory.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,8 +11,7 @@
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.config.ConfigurationException;
 import org.jboss.cache.config.EvictionRegionConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
-import org.jboss.cache.config.parsing.ParsedAttributes;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import org.jboss.cache.config.parsing.element.LoadersElementParser;
 import org.jboss.cache.eviction.LRUConfiguration;
@@ -31,7 +30,7 @@
 {
    public static final String JGROUPS_CHANNEL;
    public static final String JGROUPS_STACK_TYPE = "jgroups.stack";
-   public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/unit-test-cache-service.xml";
+   public static final String DEFAULT_CONFIGURATION_FILE = "unit-test-cache-service.xml";
 
    static
    {
@@ -171,7 +170,7 @@
       return erc;
    }
 
-   private static class UnitTestXmlConfigurationParser extends XmlConfigurationParser2x
+   private static class UnitTestXmlConfigurationParser extends XmlConfigurationParser
    {
 
       public Configuration parseFile(String filename, CacheMode mode)
@@ -185,22 +184,9 @@
          if (stream == null) throw new ConfigurationException("Input stream for configuration xml is null!");
 
          Element root = XmlConfigHelper.getDocumentRoot(stream);
-         Element mbeanElement = getMBeanElement(root);
+         XmlConfigurationParser parser = new UnitTestXmlConfigurationParser();
+         Configuration conf = parser.parseElement(root);
 
-         ParsedAttributes attributes = XmlConfigHelper.extractAttributes(mbeanElement);
-
-         // Deal with rename of the old property that controlled MBean registration
-         String keepStats = attributes.stringAttribs.remove("UseMbean");
-         if (keepStats != null && attributes.stringAttribs.get("ExposeManagementStatistics") == null)
-         {
-            attributes.stringAttribs.put("ExposeManagementStatistics", keepStats);
-         }
-
-         Configuration c = new Configuration();
-         XmlConfigHelper.setValues(c, attributes.stringAttribs, false);
-         // Special handling for XML elements -- we hard code the parsing
-         setXmlValues(c, attributes.xmlAttribs);
-
          Element list = (Element) root.getElementsByTagName("protocol_stacks").item(0);
          NodeList stacks = list.getElementsByTagName("stack");
 
@@ -213,22 +199,22 @@
                Element jgroupsStack = (Element) stack.getElementsByTagName("config").item(0);
                if (mode == CacheMode.REPL_ASYNC && !stackName.contains("-"))
                {
-                  c.setClusterConfig(jgroupsStack);
-                  c.setCacheMode(CacheMode.REPL_ASYNC);
+                  conf.setClusterConfig(jgroupsStack);
+                  conf.setCacheMode(CacheMode.REPL_ASYNC);
                   break;
                }
                else if (mode == CacheMode.REPL_SYNC && stackName.contains("-"))
                {
-                  c.setClusterConfig(jgroupsStack);
-                  c.setCacheMode(CacheMode.REPL_SYNC);
+                  conf.setClusterConfig(jgroupsStack);
+                  conf.setCacheMode(CacheMode.REPL_SYNC);
                   break;
                }
             }
          }
 
          // either way, set mode in the config!!
-         c.setCacheMode(mode);
-         return c;
+         conf.setCacheMode(mode);
+         return conf;
       }
    }
 }

Modified: core/trunk/src/test/java/org/jboss/cache/integration/hibernate/UpdateTimestampsCachingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/integration/hibernate/UpdateTimestampsCachingTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/integration/hibernate/UpdateTimestampsCachingTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -54,7 +54,7 @@
    private Cache<String, Object> createCache(boolean optimistic)
    {
       CacheFactory<String, Object> cf = new DefaultCacheFactory<String, Object>();
-      Cache<String, Object> cache = cf.createCache("META-INF/conf-test/local-tx-service.xml", false);
+      Cache<String, Object> cache = cf.createCache("configs/local-tx.xml", false);
       cache.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
       cache.start();
       caches.add(cache);

Modified: core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -29,7 +29,7 @@
    @BeforeMethod(alwaysRun = true)
    public void setUp()
    {
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("META-INF/conf-test/local-tx-service.xml");
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("configs/local-tx.xml");
       tm = cache.getTransactionManager();
    }
 
@@ -153,7 +153,7 @@
          cache = null;
       }
 
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("META-INF/conf-test/replSync-service.xml", false);
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("configs/replSync.xml", false);
       cache.getConfiguration().setCacheMode(CacheMode.REPL_ASYNC);
       cache.start();
       tm = cache.getTransactionManager();

Modified: core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/loader/ChainingCacheLoaderFullTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -12,7 +12,7 @@
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.transaction.DummyTransactionManagerLookup;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import static org.testng.AssertJUnit.assertEquals;

Modified: core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/loader/SingletonStoreCacheLoaderTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -13,7 +13,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.util.internals.ViewChangeListener;
 import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import org.jboss.cache.config.Configuration.CacheMode;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;

Modified: core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/loader/TcpCacheServerTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -8,7 +8,7 @@
 import org.jboss.cache.util.TestingUtil;
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.config.parsing.XmlConfigHelper;
 import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.jmx.CacheJmxWrapper;

Modified: core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/manager/CacheManagerTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -32,7 +32,7 @@
    /**
     * A file that includes every configuration element I could think of
     */
-   public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/jbc2-configs.xml";
+   public static final String DEFAULT_CONFIGURATION_FILE = "jbc2-registry-configs.xml";
 
    private Set<Cache<Object, Object>> caches = new HashSet<Cache<Object, Object>>();
 

Modified: core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/mgmt/MgmtTestBase.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -6,7 +6,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.CacheLoaderConfig;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.loader.CacheLoader;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
 import org.jboss.cache.config.parsing.XmlConfigHelper;

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,14 +11,14 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
-import org.jboss.cache.util.TestingUtil;
 import org.jboss.cache.notifications.annotation.CacheListener;
 import org.jboss.cache.notifications.annotation.NodeActivated;
 import org.jboss.cache.notifications.annotation.NodePassivated;
 import org.jboss.cache.notifications.event.Event;
 import org.jboss.cache.notifications.event.NodeEvent;
+import org.jboss.cache.util.TestingUtil;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
@@ -59,7 +59,7 @@
    private void initCaches()
    {
       CacheFactory<String, String> instance = new DefaultCacheFactory<String, String>();
-      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser2x().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("configs/local-passivation.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       Object listener = new TestCacheListener();
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -11,7 +11,7 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
 import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.fail;
@@ -47,7 +47,7 @@
    private void initCaches()
    {
       CacheFactory<Integer, String> instance = new DefaultCacheFactory();
-      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser2x().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("configs/local-passivation.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
       cache.start();

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -13,7 +13,7 @@
 import org.jboss.cache.CacheSPI;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
 import org.jboss.cache.util.TestingUtil;
 import org.jboss.cache.notifications.annotation.CacheListener;
@@ -44,7 +44,7 @@
    public void setUp() throws Exception
    {
       CacheFactory<String, String> instance = new DefaultCacheFactory();
-      cache = (CacheSPI<String, String>) instance.createCache(new XmlConfigurationParser2x().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
+      cache = (CacheSPI<String, String>) instance.createCache(new XmlConfigurationParser().parseFile("configs/local-passivation.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
       cache.getConfiguration().setUseRegionBasedMarshalling(true);

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java	2008-06-30 16:42:15 UTC (rev 6126)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/PassivationTestsBase.java	2008-06-30 16:44:47 UTC (rev 6127)
@@ -10,7 +10,7 @@
 import org.jboss.cache.Node;
 import org.jboss.cache.NodeSPI;
 import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
 import org.jboss.cache.loader.CacheLoader;
 import org.jboss.cache.loader.SamplePojo;
 import org.jboss.cache.lock.IsolationLevel;

Added: core/trunk/src/test/resources/configs/buddy-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/buddy-replication-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/buddy-replication-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster">
+      <jgroupsConfig>
+         <TCP recv_buf_size="20000000" use_send_queues="false" loopback="false" discard_incompatible_packets="true"
+              max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true"
+              enable_unicast_bundling="true" enable_diagnostics="true" use_concurrent_stack="true"
+              thread_naming_pattern="pl" thread_pool.enabled="true" thread_pool.min_threads="1"
+              thread_pool.max_threads="4" thread_pool.keep_alive_time="30000" thread_pool.queue_enabled="true"
+              thread_pool.queue_max_size="50000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
+              oob_thread_pool.min_threads="2" oob_thread_pool.max_threads="4" oob_thread_pool.keep_alive_time="10000"
+              oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run"/>
+         <MPING mcast_addr="232.1.2.3" timeout="2000" num_initial_members="3"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD timeout="10000" max_tries="5" shun="true"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        discard_delivered_msgs="true"/>
+         <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
+         <pbcast.GMS print_local_addr="true" join_timeout="5000" join_retry_timeout="2000" shun="false"
+                     view_bundling="true" view_ack_collection_timeout="5000"/>
+         <FC max_credits="5000000" min_threshold="0.20"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+   </transport>
+   <replication>
+      <sync replTimeout="15000"/>
+      <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+         <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+         <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+            <properties>
+               numBuddies = 1
+               ignoreColocatedBuddies = true
+            </properties>
+         </locator>
+      </buddy>
+   </replication>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/clonable-config.xml
===================================================================
--- core/trunk/src/test/resources/configs/clonable-config.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/clonable-config.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="SERIALIZABLE" lockAcquisitionTimeout="1" nodeLockingScheme="OPTIMISTIC"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup fetchInMemoryState="false" stateRetrievalTimeout="3"/>
+   <transport clusterName="CloneCluster" multiplexerStack="udp">
+      <jgroupsConfig>
+         <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+              ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+              discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+              use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="false" enable_diagnostics="true"
+              use_concurrent_stack="true" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="30000"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="4"
+              oob_thread_pool.keep_alive_time="10000" oob_thread_pool.queue_enabled="true"
+              oob_thread_pool.queue_max_size="10" oob_thread_pool.rejection_policy="Run"/>
+         <PING timeout="2000" num_initial_members="3"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD timeout="10000" max_tries="5" shun="true"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        discard_delivered_msgs="true"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
+         <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false" view_bundling="true"
+                     view_ack_collection_timeout="5000"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+   </transport>
+   <replication>
+      <sync replTimeout="2"/>
+      <buddy enabled="true" poolName="cloneGroup" communicationTimeout="7">
+         <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+         <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+            <properties>
+               numBuddies = 11
+               ignoreColocatedBuddies = true
+            </properties>
+         </locator>
+      </buddy>
+   </replication>
+   <eviction wakeUpInterval="45000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="4"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+         <attribute name="maxAge">15000</attribute>
+      </root>
+      <region name="/fifo" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+         <attribute name="maxNodes">5000</attribute>
+      </region>
+      <region name="/mru" policyClass="org.jboss.cache.eviction.MRUPolicy">
+         <attribute name="maxNodes">10000</attribute>
+      </region>
+      <region name="/lfu" policyClass="org.jboss.cache.eviction.LFUPolicy">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="minNodes">4000</attribute>
+      </region>
+   </eviction>
+   <loaders passivation="false" shared="true">
+      <preload>
+         <node fqn="/"/>
+      </preload>
+      <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false">
+         <properties>
+            location=/tmp/FileCacheLoader
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+      <loader class="org.jboss.cache.loader.bdbje.BdbjeCacheLoader" async="false" fetchPersistentState="false"
+              ignoreModifications="false">
+         <properties>
+            location=/tmp/BdbjeCacheLoader
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+      <loader class="org.jboss.cache.loader.jdbm.JdbmCacheLoader" async="false" fetchPersistentState="false"
+              ignoreModifications="false">
+         <properties>
+            location=/tmp/JdbmCacheLoader
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+      <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false"
+              ignoreModifications="false">
+         <properties>
+            cache.jdbc.driver=com.foo.jdbc.Driver
+            cache.jdbc.url=foo://driver
+            cache.jdbc.user=sa
+            cache.jdbc.password=secret
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+      <loader class="org.jboss.cache.loader.TcpDelegatingCacheLoader" async="false" fetchPersistentState="false"
+              ignoreModifications="false">
+         <properties>
+            host=127.0.0.1\nport=12121
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+      <loader class="org.jboss.cache.loader.ClusteredCacheLoader" async="false" fetchPersistentState="false"
+              ignoreModifications="false">
+         <properties>
+            timeout=500
+         </properties>
+         <singletonStore enabled="false">
+            <properties>
+               pushStateWhenCoordinator=true
+               pushStateWhenCoordinatorTimeout=5000
+            </properties>
+         </singletonStore>
+      </loader>
+   </loaders>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/conf2x/buddy-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/buddy-replication-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/buddy-replication-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+      <!-- JGroups protocol stack properties.
+         ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+      -->
+      <attribute name="ClusterConfig">
+         <config>
+            <TCP recv_buf_size="20000000" use_send_queues="false"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 enable_bundling="true"
+                 enable_unicast_bundling="true"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="4"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="50000"
+                 thread_pool.rejection_policy="discard"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="2"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <!--<PING timeout="2000" num_initial_members="3"/>-->
+            <MPING mcast_addr="232.1.2.3" timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <!--<UNICAST timeout="30,60,120,300,600,1200,2400,3600"/>-->
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FC max_credits="5000000"
+                min_threshold="0.20"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">20000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+
+      <!-- Buddy Replication config -->
+      <attribute name="BuddyReplicationConfig">
+         <config>
+            <buddyReplicationEnabled>true</buddyReplicationEnabled>
+            <!-- these are the default values anyway -->
+            <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
+            <!-- numBuddies is the number of backup nodes each node maintains.  ignoreColocatedBuddies means that
+     each node will *try* to select a buddy on a different physical host.  If not able to do so though,
+     it will fall back to colocated nodes. -->
+            <buddyLocatorProperties>
+               numBuddies = 1
+               ignoreColocatedBuddies = true
+            </buddyLocatorProperties>
+
+            <!-- A way to specify a preferred replication group.  If specified, we try and pick a buddy why shares
+    the same pool name (falling back to other buddies if not available).  This allows the sysdmin to hint at
+    backup buddies are picked, so for example, nodes may be hinted topick buddies on a different physical rack
+    or power supply for added fault tolerance.  -->
+            <buddyPoolName>myBuddyPoolReplicationGroup</buddyPoolName>
+            <!-- communication timeout for inter-buddy group organisation messages (such as assigning to and removing
+          from groups -->
+            <buddyCommunicationTimeout>2000</buddyCommunicationTimeout>
+
+            <!-- the following three elements, all relating to data gravitation, default to false -->
+            <!-- Should data gravitation be attempted whenever there is a cache miss on finding a node?
+If false, data will only be gravitated if an Option is set enabling it -->
+            <autoDataGravitation>false</autoDataGravitation>
+            <!-- removes data on remote caches' trees and backup subtrees when gravitated to a new data owner -->
+            <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
+            <!-- search backup subtrees as well for data when gravitating.  Results in backup nodes being able to
+        answer data gravitation requests. -->
+            <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
+
+         </config>
+      </attribute>
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/cacheloader-enabled-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/cacheloader-enabled-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/cacheloader-enabled-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">5</attribute>
+            <!-- This defaults to 200000 if not specified -->
+            <attribute name="eventQueueSize">200000</attribute>
+            <!-- Name of the DEFAULT eviction policy class. -->
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+
+            <!-- Cache wide default -->
+            <region name="/_default_">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">3</attribute>
+            </region>
+            <region name="/org/jboss/test/data">
+               <attribute name="maxNodes">100</attribute>
+               <attribute name="timeToLiveSeconds">3</attribute>
+            </region>
+         </config>
+      </attribute>
+
+      <!-- Cache Passivation for Tree Cache
+On pasivation, The objects are written to the backend store on eviction if CacheLoaderPassivation
+is true, otheriwse the objects are persisted.
+On activation, the objects are restored in the memory cache and removed from the cache loader
+if CacheLoaderPassivation is true, otherwise the objects are only loaded from the cache loader -->
+      <attribute name="CacheLoaderConfiguration">
+         <config>
+            <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+            <passivation>false</passivation>
+            <preload>/</preload>
+            <shared>false</shared>
+
+            <!-- we can now have multiple cache loaders, which get chained -->
+            <cacheloader>
+               <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+               <!-- same as the old CacheLoaderConfig attribute -->
+               <properties>
+                  cache.jdbc.table.name=jbosscache
+                  cache.jdbc.table.create=true
+                  cache.jdbc.table.drop=true
+                  cache.jdbc.table.primarykey=jbosscache_pk
+                  cache.jdbc.fqn.column=fqn
+                  cache.jdbc.fqn.type=varchar(255)
+                  cache.jdbc.node.column=node
+                  cache.jdbc.node.type=blob
+                  cache.jdbc.parent.column=parent
+                  cache.jdbc.driver=com.mysql.jdbc.Driver
+                  cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
+                  cache.jdbc.user=root
+                  cache.jdbc.password=
+                  cache.jdbc.sql-concat=concat(1,2)
+               </properties>
+               <!-- whether the cache loader writes are asynchronous -->
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+               <fetchPersistentState>true</fetchPersistentState>
+               <!-- determines whether this cache loader ignores writes - defaults to false. -->
+               <ignoreModifications>false</ignoreModifications>
+               <!-- if set to true, purges the contents of this cache loader when the cache starts up.
+           Defaults to false.  -->
+               <purgeOnStartup>false</purgeOnStartup>
+            </cacheloader>
+         </config>
+      </attribute>
+
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/clonable-config.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/clonable-config.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/clonable-config.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+      Cache configuration file that attempts to utilize all known elements.
+      Intent here is not to create such a cache; rather it is to create
+      a Configuration and then see if that Configuration can be cloned.
+      Basically just for testing the clone() method of the various
+      configuration elements.
+-->
+
+<server>
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+      <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
+      <attribute name="IsolationLevel">SERIALIZABLE</attribute>
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <attribute name="ClusterName">CloneCluster</attribute>
+
+      <!-- Use both a stack name and a ClusterConfig so we can test both -->
+      <attribute name="MultiplexerStack">udp</attribute>
+      <attribute name="ClusterConfig">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="false"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="10"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="true"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK
+                  use_mcast_xmit="false" gc_lag="0"
+                  retransmit_timeout="300,600,1200,2400,4800"
+                  discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,1200,2400,3600"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+      <attribute name="FetchInMemoryState">false</attribute>
+      <attribute name="StateRetrievalTimeout">3</attribute>
+      <attribute name="SyncReplTimeout">2</attribute>
+      <attribute name="LockAcquisitionTimeout">1</attribute>
+
+
+      <attribute name="BuddyReplicationConfig">
+         <config>
+            <buddyReplicationEnabled>true</buddyReplicationEnabled>
+            <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
+            <buddyLocatorProperties>
+               numBuddies = 11
+               ignoreColocatedBuddies = true
+            </buddyLocatorProperties>
+
+            <buddyPoolName>cloneGroup</buddyPoolName>
+            <buddyCommunicationTimeout>7</buddyCommunicationTimeout>
+
+            <autoDataGravitation>false</autoDataGravitation>
+            <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
+            <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
+
+         </config>
+      </attribute>
+
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">45</attribute>
+            <attribute name="eventQueueSize">4</attribute>
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+            <!-- Cache wide default -->
+            <region name="/_default_">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+               <attribute name="maxAge">15000</attribute>
+            </region>
+            <region name="/fifo" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+               <attribute name="maxNodes">5000</attribute>
+            </region>
+            <region name="/mru" policyClass="org.jboss.cache.eviction.MRUPolicy">
+               <attribute name="maxNodes">10000</attribute>
+            </region>
+            <region name="/lfu" policyClass="org.jboss.cache.eviction.LFUPolicy">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="minNodes">4000</attribute>
+            </region>
+         </config>
+      </attribute>
+
+      <attribute name="CacheLoaderConfig">
+         <config>
+            <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+            <passivation>false</passivation>
+            <preload>/</preload>
+            <shared>true</shared>
+
+            <!-- we can now have multiple cache loaders, which get chained -->
+            <cacheloader>
+               <class>org.jboss.cache.loader.FileCacheLoader</class>
+               <properties>
+                  location=/tmp/FileCacheLoader
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>true</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+            <cacheloader>
+               <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
+               <properties>
+                  location=/tmp/BdbjeCacheLoader
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>false</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+            <cacheloader>
+               <class>org.jboss.cache.loader.jdbm.JdbmCacheLoader</class>
+               <properties>
+                  location=/tmp/JdbmCacheLoader
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>false</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+            <cacheloader>
+               <class>org.jboss.cache.loader.JDBCCacheLoader</class>
+               <properties>
+                  cache.jdbc.driver=com.foo.jdbc.Driver
+                  cache.jdbc.url=foo://driver
+                  cache.jdbc.user=sa
+                  cache.jdbc.password=secret
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>false</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+            <cacheloader>
+               <class>org.jboss.cache.loader.TcpDelegatingCacheLoader</class>
+               <properties>
+                  host=127.0.0.1\nport=12121
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>false</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+            <cacheloader>
+               <class>org.jboss.cache.loader.ClusteredCacheLoader</class>
+               <properties>
+                  timeout=500
+               </properties>
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
+               <fetchPersistentState>false</fetchPersistentState>
+               <ignoreModifications>false</ignoreModifications>
+               <singletonStore>
+                  <enabled>false</enabled>
+                  <properties>
+                     pushStateWhenCoordinator=true
+                     pushStateWhenCoordinatorTimeout=5000
+                  </properties>
+               </singletonStore>
+            </cacheloader>
+
+         </config>
+      </attribute>
+
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/default-test-config2x.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/default-test-config2x.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/default-test-config2x.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,130 @@
+<server>
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+      <!--
+          Isolation level : SERIALIZABLE
+                            REPEATABLE_READ (default)
+                            READ_COMMITTED
+                            READ_UNCOMMITTED
+                            NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!--
+      Just used for async repl: use a replication queue
+      -->
+      <attribute name="UseReplQueue">false</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+      <!--
+       Whether or not to fetch state on joining a cluster
+       NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
+      -->
+      <attribute name="FetchInMemoryState">true</attribute>
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">15000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">2</attribute>
+            <!-- Name of the DEFAULT eviction policy class. -->
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+            <!-- Cache wide default -->
+            <region name="/_default_">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+            </region>
+            <region name="/org/jboss/data">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+            </region>
+            <region name="/org/jboss/test/data">
+               <attribute name="maxNodes">5</attribute>
+               <attribute name="timeToLiveSeconds">4</attribute>
+            </region>
+         </config>
+      </attribute>
+
+      <!-- New 1.3.x cache loader config block -->
+      <attribute name="CacheLoaderConfiguration">
+         <config>
+            <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+            <passivation>true</passivation>
+            <preload>/</preload>
+            <shared>false</shared>
+
+            <!-- we can now have multiple cache loaders, which get chained -->
+            <cacheloader>
+               <class>org.jboss.cache.loader.FileCacheLoader</class>
+               <!-- same as the old CacheLoaderConfig attribute
+                  location=/tmp this can be part of the properties.
+               -->
+               <properties>
+               </properties>
+               <!-- whether the cache loader writes are asynchronous -->
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+               <fetchPersistentState>true</fetchPersistentState>
+               <!-- determines whether this cache loader ignores writes - defaults to false. -->
+               <ignoreModifications>false</ignoreModifications>
+            </cacheloader>
+
+         </config>
+      </attribute>
+
+      <!--
+         Indicate whether to use region based marshalling or not. Set this to true if you are running under a scoped
+         class loader, e.g., inside an application server. Default is "false".
+      -->
+      <attribute name="UseRegionBasedMarshalling">false</attribute>
+   </mbean>
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/eviction-enabled-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/eviction-enabled-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/eviction-enabled-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--
+Sample JBoss Cache Service Configuration that hightlights various
+eviction configurations. By default LRUPolicy is enabled, by this can be
+changed by commenting it out and uncommenting another present
+eviction policy.
+-->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines JBoss Cache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=Cache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">5</attribute>
+            <!-- This defaults to 200000 if not specified -->
+            <attribute name="eventQueueSize">200000</attribute>
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+            <!-- Cache wide default -->
+            <region name="/_default_">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+            </region>
+            <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+            </region>
+            <region name="/org/jboss/test/data">
+               <attribute name="maxNodes">5</attribute>
+               <attribute name="timeToLiveSeconds">4</attribute>
+            </region>
+            <region name="/test">
+               <attribute name="maxNodes">10000</attribute>
+               <attribute name="timeToLiveSeconds">4</attribute>
+            </region>
+            <region name="/maxAgeTest">
+               <attribute name="maxNodes">10000</attribute>
+               <attribute name="timeToLiveSeconds">8</attribute>
+               <attribute name="maxAgeSeconds">10</attribute>
+            </region>
+         </config>
+      </attribute>
+
+
+      <!--ElementSizePolicy eviction config-->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!--<attribute name="wakeUpIntervalSeconds">3</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+      <!-- Name of the DEFAULT eviction policy class. -->
+      <!--<attribute name="policyClass">org.jboss.cache.eviction.ElementSizePolicy</attribute>-->
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--<attribute name="maxElementsPerNode">100</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/data">-->
+      <!--<attribute name="maxNodes">10</attribute>-->
+      <!--<attribute name="maxElementsPerNode">20</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/test/data">-->
+      <!--<attribute name="maxElementsPerNode">5</attribute>-->
+      <!--</region>-->
+      <!--<region name="/test/">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--<attribute name="maxElementsPerNode">1</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+      <!-- ExpirationPolicy eviction policy configurations. -->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!-- One second is a good default -->
+      <!--<attribute name="wakeUpIntervalSeconds">1</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+      <!-- Name of the DEFAULT eviction policy class. -->
+      <!--<attribute name="policyClass">org.jboss.cache.eviction.ExpirationPolicy</attribute>-->
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_">-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/data">-->
+      <!-- Removes the soonest to expire nodes to reduce the region size to at most 250 nodes -->
+      <!--<attribute name="maxNodes">250</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+      <!-- Specific eviction policy configurations. This is FIFOPolicy -->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!--<attribute name="wakeUpIntervalSeconds">3</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+      <!-- Name of the DEFAULT eviction policy class. -->
+      <!--<attribute name="policyClass">org.jboss.cache.eviction.FIFOPolicy</attribute>-->
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/data">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/test/data">-->
+      <!--<attribute name="maxNodes">5</attribute>-->
+      <!--</region>-->
+      <!--<region name="/test/">-->
+      <!--<attribute name="maxNodes">10000</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+      <!-- Specific eviction policy configurations. This is LFUPolicy -->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!--<attribute name="wakeUpIntervalSeconds">3</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_" policyClass="org.jboss.cache.eviction.LFUPolicy">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--<attribute name="minNodes">10</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--<attribute name="minNodes">4000</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/test/data" policyClass="org.jboss.cache.eviction.LFUPolicy">-->
+      <!--<attribute name="minNodes">5</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+      <!-- Specific eviction policy configurations. This is MRUPolicy -->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!--<attribute name="wakeUpIntervalSeconds">3</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+      <!-- Name of the DEFAULT eviction policy class. -->
+      <!--<attribute name="policyClass">org.jboss.cache.eviction.MRUPolicy</attribute>-->
+
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_">-->
+      <!--<attribute name="maxNodes">100</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/data">-->
+      <!--<attribute name="maxNodes">250</attribute>-->
+      <!--</region>-->
+      <!--<region name="/org/jboss/test/data">-->
+      <!--<attribute name="maxNodes">6</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <!--<attribute name="EvictionPolicyConfig">-->
+      <!--<config>-->
+      <!--<attribute name="wakeUpIntervalSeconds">1</attribute>-->
+      <!-- This defaults to 200000 if not specified -->
+      <!--<attribute name="eventQueueSize">200000</attribute>-->
+      <!--<attribute name="policyClass">org.jboss.cache.eviction.NullEvictionPolicy</attribute>-->
+
+      <!-- Cache wide default -->
+      <!--<region name="/_default_">-->
+      <!--<attribute name="maxNodes">5000</attribute>-->
+      <!--<attribute name="timeToLiveSeconds">1</attribute>-->
+      <!--</region>-->
+      <!--<region name="/test" policyClass="org.jboss.cache.eviction.NullEvictionPolicy">-->
+      <!--<attribute name="maxNodes">10000</attribute>-->
+      <!--<attribute name="timeToLiveSeconds">1</attribute>-->
+      <!--</region>-->
+      <!--<region name="/lru" policyClass="org.jboss.cache.eviction.LRUPolicy">-->
+      <!--<attribute name="maxNodes">10000</attribute>-->
+      <!--<attribute name="timeToLiveSeconds">1</attribute>-->
+      <!--</region>-->
+      <!--</config>-->
+      <!--</attribute>-->
+
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/local-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/local-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/local-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+
+      <!-- Configure the TransactionManager -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+   </mbean>
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/multiplexer-enabled-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/multiplexer-enabled-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/multiplexer-enabled-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+
+      <!-- JGroups protocol stack properties.
+         ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+      -->
+      <attribute name="ClusterConfig">
+         <config>
+            <TCP recv_buf_size="20000000" use_send_queues="false"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 enable_bundling="true"
+                 enable_unicast_bundling="true"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="4"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="50000"
+                 thread_pool.rejection_policy="discard"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="2"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <!--<PING timeout="2000" num_initial_members="3"/>-->
+            <MPING mcast_addr="232.1.2.3" timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <!--<UNICAST timeout="30,60,120,300,600,1200,2400,3600"/>-->
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FC max_credits="5000000"
+                min_threshold="0.20"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">20000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+
+      <!-- Buddy Replication config -->
+      <attribute name="BuddyReplicationConfig">
+         <config>
+            <buddyReplicationEnabled>true</buddyReplicationEnabled>
+            <!-- these are the default values anyway -->
+            <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
+            <!-- numBuddies is the number of backup nodes each node maintains.  ignoreColocatedBuddies means that
+     each node will *try* to select a buddy on a different physical host.  If not able to do so though,
+     it will fall back to colocated nodes. -->
+            <buddyLocatorProperties>
+               numBuddies = 1
+               ignoreColocatedBuddies = true
+            </buddyLocatorProperties>
+
+            <!-- A way to specify a preferred replication group.  If specified, we try and pick a buddy why shares
+    the same pool name (falling back to other buddies if not available).  This allows the sysdmin to hint at
+    backup buddies are picked, so for example, nodes may be hinted topick buddies on a different physical rack
+    or power supply for added fault tolerance.  -->
+            <buddyPoolName>myBuddyPoolReplicationGroup</buddyPoolName>
+            <!-- communication timeout for inter-buddy group organisation messages (such as assigning to and removing
+          from groups -->
+            <buddyCommunicationTimeout>2000</buddyCommunicationTimeout>
+
+            <!-- the following three elements, all relating to data gravitation, default to false -->
+            <!-- Should data gravitation be attempted whenever there is a cache miss on finding a node?
+If false, data will only be gravitated if an Option is set enabling it -->
+            <autoDataGravitation>false</autoDataGravitation>
+            <!-- removes data on remote caches' trees and backup subtrees when gravitated to a new data owner -->
+            <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
+            <!-- search backup subtrees as well for data when gravitating.  Results in backup nodes being able to
+        answer data gravitation requests. -->
+            <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
+
+         </config>
+      </attribute>
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/optimistically-locked-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/optimistically-locked-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/optimistically-locked-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+      <attribute name="FetchInMemoryState">false</attribute>
+
+      <!--  Whether each interceptor should have an mbean
+registered to capture and display its statistics.  -->
+      <attribute name="UseInterceptorMbeans">true</attribute>
+
+      <!--
+          Node locking scheme:
+              OPTIMISTIC
+              PESSIMISTIC (default)
+      -->
+      <attribute name="NodeLockingScheme">Optimistic</attribute>
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">1</attribute>
+            <!-- Name of the DEFAULT eviction policy class.-->
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+            <region name="/_default_">
+               <attribute name="maxNodes">10</attribute>
+               <attribute name="timeToLiveSeconds">0</attribute>
+               <attribute name="maxAgeSeconds">0</attribute>
+            </region>
+            <region name="/testingRegion">
+               <attribute name="maxNodes">10</attribute>
+               <attribute name="timeToLiveSeconds">0</attribute>
+               <attribute name="maxAgeSeconds">0</attribute>
+            </region>
+            <region name="/timeBased">
+               <attribute name="maxNodes">10</attribute>
+               <attribute name="timeToLiveSeconds">1</attribute>
+               <attribute name="maxAgeSeconds">1</attribute>
+            </region>
+         </config>
+      </attribute>
+
+   </mbean>
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/policyPerRegion-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/policyPerRegion-eviction.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/policyPerRegion-eviction.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+      <!-- JGroups protocol stack properties.
+         ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+      -->
+      <attribute name="ClusterConfig">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="false"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="10"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="true"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,1200,2400,3600"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FC max_credits="20000000" min_threshold="0.10"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">5</attribute>
+            <!-- This defaults to 200000 if not specified -->
+            <attribute name="eventQueueSize">200000</attribute>
+
+            <!-- Cache wide default -->
+            <region name="/_default_" policyClass="org.jboss.cache.eviction.LRUPolicy">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">1000</attribute>
+            </region>
+            <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="minNodes">1000</attribute>
+            </region>
+            <region name="/org/jboss/test/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+               <attribute name="maxNodes">5</attribute>
+            </region>
+            <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
+               <attribute name="maxNodes">10000</attribute>
+            </region>
+            <region name="/maxAgeTest/" policyClass="org.jboss.cache.eviction.LRUPolicy">
+               <attribute name="maxNodes">10000</attribute>
+               <attribute name="timeToLiveSeconds">8</attribute>
+               <attribute name="maxAgeSeconds">10</attribute>
+            </region>
+         </config>
+      </attribute>
+   </mbean>
+
+
+</server>

Added: core/trunk/src/test/resources/configs/conf2x/total-replication-cache.xml
===================================================================
--- core/trunk/src/test/resources/configs/conf2x/total-replication-cache.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/conf2x/total-replication-cache.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample for total replication.                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+      This configuration is dependent on the JGroups multiplexer being
+      registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+      <!-- JGroups protocol stack properties.
+         ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+      -->
+      <attribute name="ClusterConfig">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="false"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="10"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="true"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="2"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK
+                  use_mcast_xmit="false" gc_lag="0"
+                  retransmit_timeout="300,600,1200,2400,4800"
+                  discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,1200,2400,3600"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+      <!--
+              Whether or not to fetch state on joining a cluster
+              NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
+      -->
+      <attribute name="FetchInMemoryState">true</attribute>
+
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">20000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+
+   </mbean>
+</server>

Added: core/trunk/src/test/resources/configs/local-lru-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-lru-eviction.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/local-lru-eviction.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster"/>
+   <eviction wakeUpInterval="5000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+      <region name="/org/jboss/data">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </region>
+      <region name="/org/jboss/test/data">
+         <attribute name="maxNodes">5</attribute>
+         <attribute name="timeToLiveSeconds">4</attribute>
+      </region>
+      <region name="/test">
+         <attribute name="maxNodes">10000</attribute>
+         <attribute name="timeToLiveSeconds">4</attribute>
+      </region>
+      <region name="/maxAgeTest">
+         <attribute name="maxNodes">10000</attribute>
+         <attribute name="timeToLiveSeconds">8</attribute>
+         <attribute name="maxAgeSeconds">10</attribute>
+      </region>
+   </eviction>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/local-passivation.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-passivation.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/local-passivation.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster"/>
+   <eviction wakeUpInterval="1000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1</attribute>
+      </root>
+      <region name="/org/jboss/test/data">
+         <attribute name="maxNodes">100</attribute>
+         <attribute name="timeToLiveSeconds">1</attribute>
+      </region>
+   </eviction>
+   <loaders passivation="true" shared="false">
+      <preload>
+         <node fqn="/"/>
+      </preload>
+      <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false">
+         <properties>
+         </properties>
+      </loader>
+   </loaders>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/local-tx.xml
===================================================================
--- core/trunk/src/test/resources/configs/local-tx.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/local-tx.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <serialization useRegionBasedMarshalling="false"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster"/>
+   <eviction wakeUpInterval="5000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+      <region name="/org/jboss/data">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </region>
+      <region name="/org/jboss/test/data">
+         <attribute name="maxNodes">5</attribute>
+         <attribute name="timeToLiveSeconds">4</attribute>
+      </region>
+   </eviction>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/mixedPolicy-eviction.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster">
+      <jgroupsConfig>
+         <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+              ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+              discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+              use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="false" enable_diagnostics="true"
+              use_concurrent_stack="true" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="30000"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="4"
+              oob_thread_pool.keep_alive_time="10000" oob_thread_pool.queue_enabled="true"
+              oob_thread_pool.queue_max_size="10" oob_thread_pool.rejection_policy="Run"/>
+         <PING timeout="2000" num_initial_members="3"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD timeout="10000" max_tries="5" shun="true"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        discard_delivered_msgs="true"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
+         <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false" view_bundling="true"
+                     view_ack_collection_timeout="5000"/>
+         <FC max_credits="20000000" min_threshold="0.10"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+   </transport>
+   <eviction wakeUpInterval="5000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy" eventQueueSize="200000"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+      <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+         <attribute name="maxNodes">5000</attribute>
+      </region>
+      <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
+         <attribute name="maxNodes">10000</attribute>
+      </region>
+      <region name="/maxAgeTest/">
+         <attribute name="maxNodes">10000</attribute>
+         <attribute name="timeToLiveSeconds">8</attribute>
+         <attribute name="maxAgeSeconds">10</attribute>
+      </region>
+   </eviction>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/mux.xml
===================================================================
--- core/trunk/src/test/resources/configs/mux.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/mux.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster" multiplexerStack="tcp"/>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml
===================================================================
--- core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/policyPerRegion-eviction.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <startup stateRetrievalTimeout="20000"/>
+   <transport clusterName="JBossCache-Cluster">
+      <jgroupsConfig>
+         <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+              ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+              discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+              use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="false" enable_diagnostics="true"
+              use_concurrent_stack="true" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="30000"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="4"
+              oob_thread_pool.keep_alive_time="10000" oob_thread_pool.queue_enabled="true"
+              oob_thread_pool.queue_max_size="10" oob_thread_pool.rejection_policy="Run"/>
+         <PING timeout="2000" num_initial_members="3"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD timeout="10000" max_tries="5" shun="true"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        discard_delivered_msgs="true"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
+         <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false" view_bundling="true"
+                     view_ack_collection_timeout="5000"/>
+         <FC max_credits="20000000" min_threshold="0.10"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+   </transport>
+   <eviction wakeUpInterval="5000">
+      <root policyClass="org.jboss.cache.eviction.LRUPolicy">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+      <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LFUPolicy">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="minNodes">1000</attribute>
+      </region>
+      <region name="/org/jboss/test/data" policyClass="org.jboss.cache.eviction.FIFOPolicy">
+         <attribute name="maxNodes">5</attribute>
+      </region>
+      <region name="/test/" policyClass="org.jboss.cache.eviction.MRUPolicy">
+         <attribute name="maxNodes">10000</attribute>
+      </region>
+      <region name="/maxAgeTest/" policyClass="org.jboss.cache.eviction.LRUPolicy">
+         <attribute name="maxNodes">10000</attribute>
+         <attribute name="timeToLiveSeconds">8</attribute>
+         <attribute name="maxAgeSeconds">10</attribute>
+      </region>
+   </eviction>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/replSync.xml
===================================================================
--- core/trunk/src/test/resources/configs/replSync.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/replSync.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <serialization useRegionBasedMarshalling="true"/>
+   <startup fetchInMemoryState="true" stateRetrievalTimeout="15000"/>
+   <transport clusterName="JBossCache-Cluster">
+      <jgroupsConfig>
+         <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+              ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+              discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+              use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="false" enable_diagnostics="true"
+              use_concurrent_stack="true" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.min_threads="1" thread_pool.max_threads="25" thread_pool.keep_alive_time="30000"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="4"
+              oob_thread_pool.keep_alive_time="10000" oob_thread_pool.queue_enabled="true"
+              oob_thread_pool.queue_max_size="10" oob_thread_pool.rejection_policy="Run"/>
+         <PING timeout="2000" num_initial_members="3"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD timeout="10000" max_tries="5" shun="true"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        discard_delivered_msgs="true"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
+         <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false" view_bundling="true"
+                     view_ack_collection_timeout="5000"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+   </transport>
+   <replication>
+      <sync replTimeout="15000"/>
+   </replication>
+</jbosscache>

Added: core/trunk/src/test/resources/configs/string-property-replaced.xml
===================================================================
--- core/trunk/src/test/resources/configs/string-property-replaced.xml	                        (rev 0)
+++ core/trunk/src/test/resources/configs/string-property-replaced.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache>
+   <locking lockAcquisitionTimeout="${test.property.LockAcquisitionTimeout:15000}"
+            nodeLockingScheme="${test.property.NodeLockingScheme:OPTIMISTIC}"/>
+   <transaction syncCommitPhase="${test.property.SyncCommitPhase:true}" syncRollbackPhase="true"/>
+   <serialization useRegionBasedMarshalling="true"/>
+   <startup fetchInMemoryState="false" stateRetrievalTimeout="20000" inactiveOnStartup="true"/>
+   <transport clusterName="optimistic-entity" multiplexerStack="udp-sync">
+      <jgroupsConfig/>
+   </transport>
+   <replication>
+      <sync replTimeout="20000"/>
+      <buddy enabled="${test.property.BuddyReplicationConfig.enabled:true}"
+             poolName="${test.property.BuddyReplicationConfig.buddyPoolName:default}" communicationTimeout="2000">
+         <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+         <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+            <properties>
+               ignoreColocatedBuddies = true
+               numBuddies = ${test.property.BuddyReplicationConfig.numBuddies:1}
+            </properties>
+         </locator>
+      </buddy>
+   </replication>
+   <eviction wakeUpInterval="5000">
+      <defaults policyClass="${test.property.EvictionPolicyConfig.policyClass:org.jboss.cache.eviction.LRUPolicy}"/>
+      <root>
+         <attribute name="maxNodes">${test.property.EvictionPolicyConfig.maxNodes:5000}</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+   </eviction>
+   <loaders passivation="true" shared="false">
+      <preload>
+         <node fqn="/"/>
+      </preload>
+      <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false">
+         <properties>
+            location=${test.property.CacheLoaderConfiguration.location,java.io.tmpdir:/tmp}
+         </properties>
+      </loader>
+   </loaders>
+</jbosscache>

Copied: core/trunk/src/test/resources/jbc2-registry-configs.xml (from rev 6119, core/trunk/src/test/resources/META-INF/jbc2-configs.xml)
===================================================================
(Binary files differ)


Property changes on: core/trunk/src/test/resources/jbc2-registry-configs.xml
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Copied: core/trunk/src/test/resources/unit-test-cache-service.xml (from rev 6119, core/trunk/src/test/resources/META-INF/unit-test-cache-service.xml)
===================================================================
--- core/trunk/src/test/resources/unit-test-cache-service.xml	                        (rev 0)
+++ core/trunk/src/test/resources/unit-test-cache-service.xml	2008-06-30 16:44:47 UTC (rev 6127)
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<jbosscache>
+   
+   <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+   <serialization useRegionBasedMarshalling="false"/>
+   <startup fetchInMemoryState="true" stateRetrievalTimeout="15000"/>
+   <transport clusterName="JBossCache-Cluster"/>
+   <replication>
+      <sync replTimeout="15000"/>
+   </replication>
+   <eviction wakeUpInterval="2000">
+      <defaults policyClass="org.jboss.cache.eviction.LRUPolicy"/>
+      <root>
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </root>
+      <region name="/org/jboss/data">
+         <attribute name="maxNodes">5000</attribute>
+         <attribute name="timeToLiveSeconds">1000</attribute>
+      </region>
+      <region name="/org/jboss/test/data">
+         <attribute name="maxNodes">5</attribute>
+         <attribute name="timeToLiveSeconds">4</attribute>
+      </region>
+   </eviction>
+   <loaders passivation="true" shared="false">
+      <preload>
+         <node fqn="/"/>
+      </preload>
+      <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false">
+         <properties/>
+      </loader>
+   </loaders>
+
+   <protocol_stacks>
+      <stack name="udp"
+             description="Default: IP multicast based stack, with flow control and message bundling">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="true"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="false"
+                 thread_pool.queue_max_size="10"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <!--
+               Note that this is an atypically short timeout and a small number of retries
+               configured this way to speed up unit testing, since we know all nodes run in the same JVM
+               and hence failure detections will be very quick.
+            -->
+            <FD timeout="1000" max_tries="2" shun="true"/>
+            <VERIFY_SUSPECT timeout="250"/>
+            <!-- this is a more typical configuration of FD and VERIFY_SUSPECT-->
+            <!--<FD timeout="10000" max_tries="5" shun="true"/>-->
+            <!--<VERIFY_SUSPECT timeout="1500"/>-->
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600"
+                           discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="false" join_timeout="1000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="1000"/>
+            <FC max_credits="20000000" min_threshold="0.10"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </stack>
+
+      <stack name="udp-sync"
+             description="IP multicast based stack, without flow control and without message bundling. This should be used
+            instead of udp if (1) synchronous calls are used and (2) the message volume (rate and size)
+            is not that large. Don't use this configuration if you send messages at a high sustained rate, or you might
+            run out of memory">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="true"
+                 enable_diagnostics="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="false"
+                 thread_pool.queue_max_size="100"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <!--
+               Note that this is an atypically short timeout and a small number of retries
+               configured this way to speed up unit testing, since we know all nodes run in the same JVM
+               and hence failure detections will be very quick.
+            -->
+            <FD timeout="1000" max_tries="2" shun="true"/>
+            <VERIFY_SUSPECT timeout="250"/>
+            <!-- this is a more typical configuration of FD and VERIFY_SUSPECT-->
+            <!--<FD timeout="10000" max_tries="5" shun="true"/>-->
+            <!--<VERIFY_SUSPECT timeout="1500"/>-->
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,900,1200"
+                           discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,900,1200"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="false" join_timeout="1000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="1000"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </stack>
+
+
+      <stack name="tcp"
+             description="TCP based stack, with flow control and message bundling. This is usually used when IP
+             multicasting cannot be used in a network, e.g. because it is disabled (routers discard multicast).
+             Note that TCP.bind_addr and TCPPING.initial_hosts should be set, possibly via system properties, e.g.
+             -Djgroups.bind_addr=192.168.5.2 and -Djgroups.tcpping.initial_hosts=192.168.5.2[7800]">
+         <config>
+            <TCP start_port="7800"
+                 loopback="true"
+                 recv_buf_size="20000000"
+                 send_buf_size="640000"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 enable_bundling="true"
+                 use_send_queues="false"
+                 sock_conn_timeout="300"
+                 skip_suspected_members="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="5000"
+                 thread_pool.queue_enabled="false"
+                 thread_pool.queue_max_size="100"
+                 thread_pool.rejection_policy="run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="8"
+                 oob_thread_pool.keep_alive_time="5000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="100"
+                 oob_thread_pool.rejection_policy="run"/>
+
+            <TCPPING timeout="3000"
+                     initial_hosts="127.0.0.1[7800],127.0.0.1[7801]"
+                     port_range="1"
+                     num_initial_members="3"/>
+            <MERGE2 max_interval="100000"
+                    min_interval="20000"/>
+            <FD_SOCK/>
+            <!--
+               Note that this is an atypically short timeout and a small number of retries
+               configured this way to speed up unit testing, since we know all nodes run in the same JVM
+               and hence failure detections will be very quick.
+            -->
+            <FD timeout="1000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <BARRIER/>
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <VIEW_SYNC avg_send_interval="60000"/>
+            <pbcast.GMS print_local_addr="false" join_timeout="3000" shun="true"
+                        view_bundling="true"/>
+            <FC max_credits="2000000"
+                min_threshold="0.10"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </stack>
+
+
+      <stack name="tcp-sync"
+             description="TCP based stack, without flow control and without message bundling. This is usually used when IP
+           multicasting cannot be used in a network, e.g. because it is disabled (routers discard multicast). This
+           configuration should be used instead of tcp when (1) synchronous calls are used and (2) the message volume
+           (rate and size) is not that large">
+         <config>
+            <TCP start_port="7800"
+                 loopback="true"
+                 recv_buf_size="20000000"
+                 send_buf_size="640000"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 enable_bundling="true"
+                 use_send_queues="false"
+                 sock_conn_timeout="300"
+                 skip_suspected_members="true"
+
+                 use_concurrent_stack="true"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="5000"
+                 thread_pool.queue_enabled="false"
+                 thread_pool.queue_max_size="100"
+                 thread_pool.rejection_policy="run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="8"
+                 oob_thread_pool.keep_alive_time="5000"
+                 oob_thread_pool.queue_enabled="false"
+                 oob_thread_pool.queue_max_size="100"
+                 oob_thread_pool.rejection_policy="run"/>
+
+            <TCPPING timeout="3000"
+                     initial_hosts="127.0.0.1[7800],127.0.0.1[7801]"
+                     port_range="1"
+                     num_initial_members="3"/>
+            <MERGE2 max_interval="100000"
+                    min_interval="20000"/>
+            <FD_SOCK/>
+            <!--
+               Note that this is an atypically short timeout and a small number of retries
+               configured this way to speed up unit testing, since we know all nodes run in the same JVM
+               and hence failure detections will be very quick.
+            -->
+            <FD timeout="1000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <BARRIER/>
+            <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <VIEW_SYNC avg_send_interval="60000"/>
+            <pbcast.GMS print_local_addr="false" join_timeout="3000" shun="true"
+                        view_bundling="true"/>
+            <FC max_credits="2000000"
+                min_threshold="0.10"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </stack>
+   </protocol_stacks>
+
+</jbosscache>




More information about the jbosscache-commits mailing list