[jboss-cvs] JBossAS SVN: r104569 - in projects/cluster/ha-server-cache-jbc/branches/Branch_2_0: src/main/java/org/jboss/ha/cachemanager and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 7 14:33:38 EDT 2010
Author: bstansberry at jboss.com
Date: 2010-05-07 14:33:38 -0400 (Fri, 07 May 2010)
New Revision: 104569
Added:
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/java/org/jboss/ha/cachemanager/CacheManagerUnitTestCase.java
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml
Removed:
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml
Modified:
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/pom.xml
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManager.java
projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManagerManagedCache.java
Log:
[JBCLUSTER-249] Port to Branch_2_0 (incl JBCLUSTER-250 fix)
Modified: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/pom.xml
===================================================================
--- projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/pom.xml 2010-05-07 18:32:23 UTC (rev 104568)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/pom.xml 2010-05-07 18:33:38 UTC (rev 104569)
@@ -91,6 +91,10 @@
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-client</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -254,7 +258,31 @@
<scope>test</scope>
</dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>2.0.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.0.jboss</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.0.1</version>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManager.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManager.java 2010-05-07 18:32:23 UTC (rev 104568)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManager.java 2010-05-07 18:33:38 UTC (rev 104569)
@@ -24,7 +24,6 @@
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -41,9 +40,12 @@
import javax.naming.StringRefAddr;
import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
import org.jboss.cache.CacheStatus;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationRegistry;
+import org.jboss.cache.config.XmlParsingConfigurationRegistry;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.CacheStarted;
import org.jboss.cache.notifications.annotation.CacheStopped;
@@ -60,7 +62,7 @@
import org.jgroups.ChannelFactory;
/**
- * JBoss AS specific {@link CacheManager}. Extends the core JBoss Cache
+ * JBoss AS specific implementation of {@link CacheManager}. Extends the core JBoss Cache
* cache manager by also handling, PojoCache, by registering created caches
* in JMX, and by registering itself in JNDI.
*
@@ -68,7 +70,6 @@
* @version $Revision: 1.1 $
*/
public class CacheManager
- extends org.jboss.cache.CacheManagerImpl
implements org.jboss.cache.CacheManager, PojoCacheManager, MBeanRegistration, CacheManagerMBean
{
private static final Logger log = Logger.getLogger(CacheManager.class);
@@ -76,11 +77,23 @@
public static final String DEFAULT_CORE_CACHE_JMX_ATTRIBUTES = "service=Cache,config=";
public static final String DEFAULT_POJO_CACHE_JMX_ATTRIBUTES = "service=Cache,cacheType=PojoCache,config=";
+ private static final ThreadLocal<Boolean> starting = new ThreadLocal<Boolean>();
+
private MBeanServer mbeanServer;
private String jmxDomain;
private String coreCacheJmxAttributes = DEFAULT_CORE_CACHE_JMX_ATTRIBUTES;
- private String pojoCacheJmxAttributes = DEFAULT_POJO_CACHE_JMX_ATTRIBUTES;
+ private String pojoCacheJmxAttributes = DEFAULT_POJO_CACHE_JMX_ATTRIBUTES;
+
+ private ConfigurationRegistry configRegistry;
+ private boolean configRegistryInjected;
+
+ private ChannelFactory channelFactory;
+
+ private final Map<String, Cache<Object, Object>> plainCaches = new HashMap<String, Cache<Object, Object>>();
+
+ private final Map<String, Integer> plainCacheCheckouts = new HashMap<String, Integer>();
+
private Map<String, PojoCache> pojoCaches = new HashMap<String, PojoCache>();
private Map<String, Integer> pojoCacheCheckouts = new HashMap<String, Integer>();
@@ -95,49 +108,40 @@
private boolean started;
/**
- * Create a new CacheManagerImpl.
+ * Create a new CacheManager.
*
*/
public CacheManager()
{
- super();
}
/**
- * Create a new CacheManagerImpl.
+ * Create a new CacheManager.
*
* @param configRegistry
* @param factory
*/
public CacheManager(ConfigurationRegistry configRegistry, ChannelFactory factory)
{
- super(configRegistry, factory);
+ this.configRegistry = configRegistry;
+ this.configRegistryInjected = true;
+ this.channelFactory = factory;
}
/**
- * Create a new CacheManagerImpl.
+ * Create a new CacheManager.
*
* @param configFileName
* @param factory
*/
public CacheManager(String configFileName, ChannelFactory factory)
{
- super(configFileName, factory);
+ configRegistry = new XmlParsingConfigurationRegistry(configFileName);
+ this.channelFactory = factory;
}
// -------------------------------------------------------- PojoCacheManager
- public Set<String> getConfigurationNames()
- {
- synchronized (pojoCaches)
- {
- Set<String> configNames = super.getConfigurationNames();
- configNames.addAll(getPojoCacheNames());
- configNames.addAll(configAliases.keySet());
- return configNames;
- }
- }
-
public Set<String> getPojoCacheNames()
{
synchronized (pojoCaches)
@@ -148,6 +152,11 @@
public PojoCache getPojoCache(String configName, boolean create) throws Exception
{
+ if (create)
+ {
+ checkStarted();
+ }
+
// Check if there's an alias involved
configName = resolveAlias(configName);
@@ -177,21 +186,11 @@
// Wrap the pojocache to control classloading and disable stop/destroy
return cache == null ? null : new PojoCacheManagerManagedPojoCache(cache);
}
-
- /**
- * Extension point for subclasses, where we actually use a
- * {@link PojoCacheFactory} to create a PojoCache.
- *
- * @param config the Configuration for the cache
- * @return the PojoCache
- */
- protected PojoCache createPojoCache(Configuration config)
- {
- return PojoCacheFactory.createCache(config, false);
- }
public void registerPojoCache(PojoCache cache, String configName)
{
+ checkStarted();
+
synchronized (pojoCaches)
{
if (pojoCaches.containsKey(configName) || getCacheNames().contains(configName))
@@ -219,11 +218,39 @@
}
}
- // ------------------------------------------------------------- Overrides
+ // ------------------------------------------------------------ CacheManager
+
+ public ChannelFactory getChannelFactory()
+ {
+ return channelFactory;
+ }
+
+ public Set<String> getConfigurationNames()
+ {
+ synchronized (pojoCaches)
+ {
+ Set<String> configNames = getPlainCacheConfigurationNames();
+ configNames.addAll(getPojoCacheNames());
+ configNames.addAll(configAliases.keySet());
+ return configNames;
+ }
+ }
+
+ public Set<String> getCacheNames()
+ {
+ synchronized (plainCaches)
+ {
+ return new HashSet<String>(plainCaches.keySet());
+ }
+ }
- @Override
public Cache<Object, Object> getCache(String configName, boolean create) throws Exception
{
+ if (create)
+ {
+ checkStarted();
+ }
+
// Check if there's an alias involved
configName = resolveAlias(configName);
@@ -241,24 +268,24 @@
}
}
- return wrapCache(super.getCache(configName, create));
+ return wrapCache(getPlainCache(configName, create));
}
}
- @Override
public void registerCache(Cache<Object, Object> cache, String configName)
{
+ checkStarted();
+
synchronized (pojoCaches)
{
if (pojoCaches.containsKey(configName))
throw new IllegalStateException(configName + " already registered");
- super.registerCache(cache, configName);
+ registerPlainCache(cache, configName);
if (registerCachesInJmx && mbeanServer != null)
{
String oName = getObjectName(getCoreCacheJmxAttributes(), configName);
- @SuppressWarnings("deprecation")
org.jboss.cache.jmx.CacheJmxWrapper<Object, Object> wrapper =
new org.jboss.cache.jmx.CacheJmxWrapper<Object, Object>(cache);
try
@@ -276,7 +303,6 @@
}
}
- @Override
public void releaseCache(String configName)
{
// Check if there's an alias involved
@@ -294,79 +320,102 @@
}
else
{
- super.releaseCache(configName);
-
- if (registerCachesInJmx && mbeanServer != null && !getCacheNames().contains(configName))
+ synchronized (plainCaches)
{
- String oNameStr = getObjectName(getCoreCacheJmxAttributes(), configName);
- try
+ if (!plainCaches.containsKey(configName))
+ throw new IllegalStateException(configName + " not registered");
+ if (decrementPlainCacheCheckout(configName) == 0)
{
- ObjectName oName = new ObjectName(oNameStr);
- if (mbeanServer.isRegistered(oName))
- {
- mbeanServer.unregisterMBean(oName);
- }
+ Cache<Object, Object> cache = plainCaches.remove(configName);
+ destroyPlainCache(cache, configName);
}
- catch (JMException e)
- {
- log.error("Problem unregistering CacheJmxWrapper " + oNameStr, e);
- }
-
- }
+ };
}
}
}
- @Override
+ // ----------------------------------------------------------------- Public
+
public void start() throws Exception
{
if (!started)
{
- super.start();
-
- startEagerStartCaches();
-
- CacheManagerLocator locator = CacheManagerLocator.getCacheManagerLocator();
- if (locator.getDirectlyRegisteredManager() == null)
- locator.registerCacheManager(this);
-
- PojoCacheManagerLocator pclocator = PojoCacheManagerLocator.getCacheManagerLocator();
- if (pclocator.getDirectlyRegisteredManager() == null)
- pclocator.registerCacheManager(this);
-
- // Bind ourself in the public JNDI space if configured to do so
- if (jndiName != null)
+ if (configRegistry == null)
+ throw new IllegalStateException("Must configure a ConfigurationRegistry before calling start()");
+ if (channelFactory == null)
+ throw new IllegalStateException("Must provide a ChannelFactory before calling start()");
+
+ try
{
- Context ctx = new InitialContext();
- this.bind(jndiName, this, CacheManager.class, ctx);
- log.debug("Bound in JNDI under " + jndiName);
+ starting.set(Boolean.TRUE);
+
+ if (!configRegistryInjected)
+ {
+ ((XmlParsingConfigurationRegistry) configRegistry).start();
+ }
+
+ startEagerStartCaches();
+
+ CacheManagerLocator locator = CacheManagerLocator.getCacheManagerLocator();
+ if (locator.getDirectlyRegisteredManager() == null)
+ locator.registerCacheManager(this);
+
+ PojoCacheManagerLocator pclocator = PojoCacheManagerLocator.getCacheManagerLocator();
+ if (pclocator.getDirectlyRegisteredManager() == null)
+ pclocator.registerCacheManager(this);
+
+ // Bind ourself in the public JNDI space if configured to do so
+ if (jndiName != null)
+ {
+ Context ctx = new InitialContext();
+ this.bind(jndiName, this, CacheManager.class, ctx);
+ log.debug("Bound in JNDI under " + jndiName);
+ }
}
+ finally
+ {
+ starting.remove();
+ }
started = true;
}
}
- @Override
public void stop()
{
if (started)
{
releaseEagerStartCaches();
- synchronized (pojoCaches)
+// synchronized (pojoCaches)
+// {
+// for (Iterator<Map.Entry<String, PojoCache>> it = pojoCaches.entrySet().iterator(); it.hasNext();)
+// {
+// Map.Entry<String, PojoCache> entry = it.next();
+// destroyPojoCache(entry.getKey(), entry.getValue());
+// it.remove();
+// }
+// pojoCaches.clear();
+// pojoCacheCheckouts.clear();
+// }
+
+// synchronized (plainCaches)
+// {
+// for (Iterator<Map.Entry<String, Cache<Object, Object>>> it = plainCaches.entrySet().iterator(); it.hasNext();)
+// {
+// Map.Entry<String, Cache<Object, Object>> entry = it.next();
+// destroyPlainCache(entry.getValue(), entry.getKey());
+// it.remove();
+// }
+// plainCaches.clear();
+// plainCacheCheckouts.clear();
+// }
+
+ if (!configRegistryInjected)
{
- for (Iterator<Map.Entry<String, PojoCache>> it = pojoCaches.entrySet().iterator(); it.hasNext();)
- {
- Map.Entry<String, PojoCache> entry = it.next();
- destroyPojoCache(entry.getKey(), entry.getValue());
- it.remove();
- }
- pojoCaches.clear();
- pojoCacheCheckouts.clear();
+ ((XmlParsingConfigurationRegistry) configRegistry).stop();
}
- super.stop();
-
if (jndiName != null)
{
InitialContext ctx = null;
@@ -416,10 +465,24 @@
}
}
-
-
// ------------------------------------------------------------- Properties
+ public ConfigurationRegistry getConfigurationRegistry()
+ {
+ return configRegistry;
+ }
+
+ public void setConfigurationRegistry(ConfigurationRegistry configRegistry)
+ {
+ this.configRegistry = configRegistry;
+ this.configRegistryInjected = true;
+ }
+
+ public void setChannelFactory(ChannelFactory channelFactory)
+ {
+ this.channelFactory = channelFactory;
+ }
+
public String getJmxDomain()
{
return jmxDomain;
@@ -532,8 +595,7 @@
public void preDeregister() throws Exception
{
- // TODO Auto-generated method stub
-
+ // no-op
}
public void postRegister(Boolean registrationDone)
@@ -541,8 +603,149 @@
// no-op
}
+ // -------------------------------------------------------------- Protected
+
+
+ /**
+ * Extension point for subclasses, where we actually use a
+ * {@link PojoCacheFactory} to create a PojoCache.
+ *
+ * @param config the Configuration for the cache
+ * @return the PojoCache
+ */
+ protected PojoCache createPojoCache(Configuration config)
+ {
+ return PojoCacheFactory.createCache(config, false);
+ }
+
+ /**
+ * Extension point for subclasses, where we actually use a
+ * {@link CacheFactory} to create a cache. This default implementation
+ * uses {@link DefaultCacheFactory}.
+ *
+ * @param config the Configuration for the cache
+ * @return the Cache
+ */
+ protected Cache<Object, Object> createCache(Configuration config)
+ {
+ return new DefaultCacheFactory<Object, Object>().createCache(config, false);
+ }
+
+
// ---------------------------------------------------------------- Private
+ private void checkStarted()
+ {
+ if (!started && Boolean.TRUE.equals(starting.get()) == false)
+ {
+ throw new IllegalStateException(getClass().getSimpleName() + " is not started.");
+ }
+ }
+
+ private int incrementCheckout(String configName)
+ {
+ synchronized (plainCacheCheckouts)
+ {
+ Integer count = plainCacheCheckouts.get(configName);
+ if (count == null)
+ count = Integer.valueOf(0);
+ Integer newVal = Integer.valueOf(count.intValue() + 1);
+ plainCacheCheckouts.put(configName, newVal);
+ return newVal;
+ }
+ }
+
+ private int decrementPlainCacheCheckout(String configName)
+ {
+ synchronized (plainCacheCheckouts)
+ {
+ Integer count = plainCacheCheckouts.get(configName);
+ if (count == null || count.intValue() < 1)
+ throw new IllegalStateException("invalid count of " + count + " for " + configName);
+
+ Integer newVal = Integer.valueOf(count.intValue() - 1);
+ plainCacheCheckouts.put(configName, newVal);
+ return newVal;
+ }
+ }
+
+ private void destroyPlainCache(Cache<Object, Object> cache, String configName)
+ {
+ if (cache.getCacheStatus() == CacheStatus.STARTED)
+ {
+ cache.stop();
+ }
+ if (cache.getCacheStatus() != CacheStatus.DESTROYED && cache.getCacheStatus() != CacheStatus.INSTANTIATED)
+ {
+ cache.destroy();
+ }
+
+ if (registerCachesInJmx && mbeanServer != null && !getCacheNames().contains(configName))
+ {
+ String oNameStr = getObjectName(getCoreCacheJmxAttributes(), configName);
+ try
+ {
+ ObjectName oName = new ObjectName(oNameStr);
+ if (mbeanServer.isRegistered(oName))
+ {
+ mbeanServer.unregisterMBean(oName);
+ }
+ }
+ catch (JMException e)
+ {
+ log.error("Problem unregistering CacheJmxWrapper " + oNameStr, e);
+ }
+
+ }
+ }
+
+ private void registerPlainCache(Cache<Object, Object> cache, String configName)
+ {
+ synchronized (plainCaches)
+ {
+ if (plainCaches.containsKey(configName))
+ throw new IllegalStateException(configName + " already registered");
+ plainCaches.put(configName, cache);
+ incrementCheckout(configName);
+ }
+ }
+
+ private Cache<Object, Object> getPlainCache(String configName, boolean create) throws Exception
+ {
+ Cache<Object, Object> cache;
+ synchronized (plainCaches)
+ {
+ cache = plainCaches.get(configName);
+ if (cache == null && create)
+ {
+ Configuration config = configRegistry.getConfiguration(configName);
+ if (channelFactory != null && config.getMultiplexerStack() != null)
+ {
+ config.getRuntimeConfig().setMuxChannelFactory(channelFactory);
+ }
+ cache = createCache(config);
+ registerCache(cache, configName);
+ }
+ else if (cache != null)
+ {
+ incrementCheckout(configName);
+ }
+ }
+
+ return cache;
+ }
+
+ private Set<String> getPlainCacheConfigurationNames()
+ {
+ synchronized (plainCaches)
+ {
+ Set<String> configNames = configRegistry == null ? new HashSet<String>()
+ : configRegistry.getConfigurationNames();
+ configNames.addAll(getCacheNames());
+ return configNames;
+ }
+ }
+
/**
* Wrap the pojocache to control classloading and disable stop/destroy
*/
@@ -614,7 +817,6 @@
return base + ":" + attributesBase + configName;
}
- @SuppressWarnings("deprecation")
@CacheListener
public static class StartStopListener
{
Modified: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManagerManagedCache.java
===================================================================
--- projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManagerManagedCache.java 2010-05-07 18:32:23 UTC (rev 104568)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/main/java/org/jboss/ha/cachemanager/CacheManagerManagedCache.java 2010-05-07 18:33:38 UTC (rev 104569)
@@ -66,6 +66,12 @@
ContextClassLoaderSwitcher unchecked = (ContextClassLoaderSwitcher) AccessController.doPrivileged(ContextClassLoaderSwitcher.INSTANTIATOR);
this.switcher = unchecked;
}
+
+ /** For unit testing */
+ Cache<K, V> getDelegate()
+ {
+ return delegate;
+ }
/**
* Switches the TCCL to the delegate's classloader before calling create()
Copied: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/java/org/jboss/ha/cachemanager/CacheManagerUnitTestCase.java (from rev 100437, projects/cluster/ha-server-cache-jbc/trunk/src/test/java/org/jboss/ha/cachemanager/CacheManagerUnitTestCase.java)
===================================================================
--- projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/java/org/jboss/ha/cachemanager/CacheManagerUnitTestCase.java (rev 0)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/java/org/jboss/ha/cachemanager/CacheManagerUnitTestCase.java 2010-05-07 18:33:38 UTC (rev 104569)
@@ -0,0 +1,301 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ha.cachemanager;
+
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheStatus;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.ConfigurationRegistry;
+import org.jboss.cache.pojo.PojoCache;
+import org.jgroups.JChannelFactory;
+
+/**
+ * Tests CacheManager.
+ *
+ * @author Brian Stansberry
+ */
+public class CacheManagerUnitTestCase extends TestCase
+{
+ /**
+ * A file that includes every configuration element I could think of
+ */
+ public static final String DEFAULT_CONFIGURATION_FILE = "jboss-cache-configs.xml";
+ public static final String DEFAULT_CONFIG = "local-query";
+
+ private Set<Cache<Object, Object>> caches = new HashSet<Cache<Object, Object>>();
+
+ public void tearDown() throws Exception
+ {
+ for (Cache<Object, Object> cache : caches)
+ {
+ try
+ {
+ cache.destroy();
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+ caches.clear();
+ }
+
+ /**
+ * A test that instantiates a CacheManager and cycles through all its
+ * configs, creating and releasing each.
+ * <p/>
+ * TODO: Break this up into more fine-grained tests
+ *
+ * @throws Exception
+ */
+ public void testBasic() throws Exception
+ {
+ JChannelFactory cf = new JChannelFactory();
+ cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
+ CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
+ registry.start();
+
+ ConfigurationRegistry configRegistry = registry.getConfigurationRegistry();
+
+ Set<String> configNames = registry.getConfigurationNames();
+ assertEquals(17, configNames.size());
+ Set<String> cacheNames = registry.getCacheNames();
+ assertEquals(0, cacheNames.size());
+
+ for (String configName : configNames)
+ {
+ assertNull(configName + " not created", registry.getCache(configName, false));
+ Cache<Object, Object> cache = registry.getCache(configName, true);
+ caches.add(cache);
+
+ // Cache shouldn't be started
+ assertEquals(CacheStatus.INSTANTIATED, cache.getCacheStatus());
+ cache.create();
+ cache.start();
+
+ // Config should be a clone
+ Configuration rawConfig = configRegistry.getConfiguration(configName);
+ Configuration realConfig = cache.getConfiguration();
+ assertFalse(rawConfig == realConfig);
+ assertEquals(rawConfig.getClusterName(), realConfig.getClusterName());
+ }
+
+ cacheNames = registry.getCacheNames();
+ assertEquals(configNames, cacheNames);
+
+ // Test basic releasing of caches
+ for (String configName : configNames)
+ {
+ registry.releaseCache(configName);
+ }
+
+ cacheNames = registry.getCacheNames();
+ assertEquals(0, cacheNames.size());
+
+ // We shouldn't have affected configuration set
+ Set<String> configNames2 = registry.getConfigurationNames();
+ assertEquals(configNames, configNames2);
+
+ // Releasing only checkout of cache should have destroyed it
+ for (Iterator<Cache<Object, Object>> it = caches.iterator(); it.hasNext();)
+ {
+ assertEquals(CacheStatus.DESTROYED, it.next().getCacheStatus());
+ it.remove();
+ }
+
+ // Get cache w/o asking to create returns null
+ String configName = configNames.iterator().next();
+ assertNull(configName + " not created", registry.getCache(configName, false));
+ // Get cache w/ asking to create returns cache
+ Cache<Object, Object> cache = registry.getCache(configName, true);
+ assertFalse(null == cache);
+ caches.add(cache);
+
+ cache.create();
+ cache.start();
+
+ // Test 2 checkouts of the same cache
+ Cache<Object, Object> cache2 = registry.getCache(configName, true);
+ assertTrue(areCachesEquivalent(cache, cache2));
+
+ registry.releaseCache(configName);
+
+ // One release does not cause registry to stop cache
+ assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
+
+ registry.stop();
+
+ // Should still not be stopped
+ assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
+
+ registry.releaseCache(configName);
+
+ // Now it should be stopped
+ assertEquals(CacheStatus.DESTROYED, cache.getCacheStatus());
+ caches.remove(cache);
+
+ cacheNames = registry.getCacheNames();
+ assertEquals(0, cacheNames.size());
+ assertEquals(cacheNames, registry.getConfigurationNames());
+ }
+
+ public void testNullConfigResource() throws Exception
+ {
+ JChannelFactory cf = new JChannelFactory();
+ cf.setMultiplexerConfig("stacks.xml"); // the default stacks in jgroups.jar
+ String configResource = null;
+ CacheManager registry = new CacheManager(configResource, cf);
+ registry.start();
+
+ assertEquals("No configs", 0, registry.getConfigurationNames().size());
+ }
+
+ public void testEagerStartCaches() throws Exception
+ {
+ JChannelFactory cf = new JChannelFactory();
+ cf.setMultiplexerConfig("stacks.xml");
+ cf.setExposeChannels(false);
+ cf.start();
+ CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
+
+ Set<String> cores = new HashSet<String>();
+ cores.add("ha-partition");
+ cores.add("local-query");
+ registry.setEagerStartCaches(cores);
+// Set<String> pojos = new HashSet<String>();
+// pojos.add("test5");
+// pojos.add("test6");
+// registry.setEagerStartPojoCaches(pojos);
+
+ registry.start();
+
+ assertEquals(cores, registry.getCacheNames());
+// assertEquals(pojos, registry.getPojoCacheNames());
+
+ Set<Cache> caches = new HashSet<Cache>();
+
+ for (String name : cores)
+ {
+ Cache cache = registry.getCache(name, false);
+ assertNotNull(cache);
+ assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
+ caches.add(cache);
+ }
+
+// for (String name : pojos)
+// {
+// PojoCache pojocache = registry.getPojoCache(name, false);
+// assertNotNull(pojocache);
+// Cache cache = pojocache.getCache();
+// assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
+// caches.add(cache);
+// }
+//
+ for (String name : cores)
+ {
+ registry.releaseCache(name);
+ }
+
+// for (String name : pojos)
+// {
+// registry.releaseCache(name);
+// }
+
+ for (Cache cache : caches)
+ {
+ assertEquals(CacheStatus.STARTED, cache.getCacheStatus());
+ }
+
+ registry.stop();
+
+ for (Cache cache : caches)
+ {
+ assertEquals(CacheStatus.DESTROYED, cache.getCacheStatus());
+ }
+
+ }
+
+ public void testAliasing() throws Exception
+ {
+ JChannelFactory cf = new JChannelFactory();
+ cf.setMultiplexerConfig("stacks.xml");
+ cf.setExposeChannels(false);
+ cf.start();
+ CacheManager registry = new CacheManager(DEFAULT_CONFIGURATION_FILE, cf);
+ registry.start();
+
+ Set<String> configNames = registry.getConfigurationNames();
+ assertEquals(17, configNames.size());
+
+ assertEquals(0, registry.getCacheNames().size());
+
+ assertEquals(0, registry.getPojoCacheNames().size());
+
+ Map<String, String> aliases = new HashMap<String, String>();
+ aliases.put("alias", DEFAULT_CONFIG);
+ registry.setConfigAliases(aliases);
+
+ Map<String, String> registered = registry.getConfigAliases();
+ assertEquals(1, registered.size());
+ assertEquals(DEFAULT_CONFIG, registered.get("alias"));
+
+ configNames = registry.getConfigurationNames();
+ assertEquals(18, configNames.size());
+ assertTrue(configNames.contains("alias"));
+
+ Cache cache = registry.getCache("alias", true);
+ assertNotNull(cache);
+ Cache other = registry.getCache(DEFAULT_CONFIG, false);
+ assertEquals(cache, other);
+
+ assertEquals(1, registry.getCacheNames().size());
+
+ registry.releaseCache(DEFAULT_CONFIG);
+
+ assertEquals(1, registry.getCacheNames().size());
+
+ registry.releaseCache("alias");
+
+ assertEquals(0, registry.getCacheNames().size());
+
+ PojoCache pcache = registry.getPojoCache("alias", true);
+ assertNotNull(pcache);
+ PojoCache otherPC = registry.getPojoCache(DEFAULT_CONFIG, false);
+ assertEquals(pcache, otherPC);
+
+ assertEquals(1, registry.getPojoCacheNames().size());
+
+ registry.releaseCache(DEFAULT_CONFIG);
+
+ assertEquals(1, registry.getPojoCacheNames().size());
+
+ registry.releaseCache("alias");
+
+ assertEquals(0, registry.getPojoCacheNames().size());
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean areCachesEquivalent(Cache<Object, Object> a, Cache<Object, Object> b)
+ {
+ boolean equiv = a == b;
+ if (!equiv && a instanceof CacheManagerManagedCache && b instanceof CacheManagerManagedCache)
+ {
+ CacheManagerManagedCache cast_a = (CacheManagerManagedCache) a;
+ CacheManagerManagedCache cast_b = (CacheManagerManagedCache) b;
+ equiv = (cast_a.getDelegate() == cast_b.getDelegate());
+ }
+ return equiv;
+ }
+}
Copied: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources (from rev 104564, projects/cluster/ha-server-cache-jbc/trunk/src/test/resources)
Deleted: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml
===================================================================
--- projects/cluster/ha-server-cache-jbc/trunk/src/test/resources/jboss-cache-configs.xml 2010-05-07 15:48:13 UTC (rev 104564)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml 2010-05-07 18:33:38 UTC (rev 104569)
@@ -1,421 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cache-configs xmlns="urn:jboss:jbosscache-core:cache-repo:3.2">
-
- <!--
- JBoss Cache configurations using the standard JBC 3.x config format
- can be added to this file, and will usable by the AS's CacheManager
- if the "configResource" property in the jboss-cache-manager-jboss-beans.xml
- file's "CacheConfigurationRegistry" bean is uncommented. (It is
- commented out by default.)
- However, use of the microcontainer config format used in this
- sar's jboss-cache-manager-jboss-beans.xml file is recommended.
- -->
-
- <cache-config name="standard-session-cache">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="false"/>
- <startup regionsInactiveOnStartup="false"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-SessionCache" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <!-- Choose sync or async -->
- <async serializationExecutorPoolSize="0"/>
- <!-- <sync replTimeout="17500"/> -->
-
- <buddy enabled="false" poolName="default" communicationTimeout="17500">
- <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
- <locator>
- <properties>
- numBuddies=1
- ignoreColocatedBuddies=true
- </properties>
- </locator>
- </buddy>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
-
- <loaders passivation="true" shared="false">
- <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
- fetchPersistentState="true" purgeOnStartup="true">
- <properties>
- location=${jboss.server.data.dir}${/}session
- ignoreModifications=false
- checkCharacterPortability=false
- </properties>
- </loader>
- </loaders>
- </cache-config>
-
- <cache-config name="field-granularity-session-cache">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-FieldSessionCache" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <!-- Choose sync or async -->
- <async serializationExecutorPoolSize="0"/>
- <!-- <sync replTimeout="17500"/> -->
-
- <buddy enabled="false" poolName="default" communicationTimeout="17500">
- <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
- <locator>
- <properties>
- numBuddies=1
- ignoreColocatedBuddies=true
- </properties>
- </locator>
- </buddy>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
-
- <loaders passivation="true" shared="false">
- <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
- fetchPersistentState="true" purgeOnStartup="true">
- <properties>
- location=${jboss.server.data.dir}${/}field-session
- ignoreModifications=false
- checkCharacterPortability=false
- </properties>
- </loader>
- </loaders>
- </cache-config>
-
- <cache-config name="sfsb-cache">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="false"/>
- <startup regionsInactiveOnStartup="false"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-SFSBCache" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <!-- Choose sync or async -->
- <async serializationExecutorPoolSize="0"/>
- <!-- <sync replTimeout="17500"/> -->
-
- <buddy enabled="false" poolName="default" communicationTimeout="17500">
- <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
- <locator>
- <properties>
- numBuddies=1
- ignoreColocatedBuddies=true
- </properties>
- </locator>
- </buddy>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
-
- <loaders passivation="true" shared="false">
- <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
- fetchPersistentState="true" purgeOnStartup="true">
- <properties>
- location=${jboss.server.data.dir}${/}sfsb
- ignoreModifications=false
- checkCharacterPortability=false
- </properties>
- </loader>
- </loaders>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="ha-partition">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="false"/>
- <startup regionsInactiveOnStartup="false"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-HAPartitionCache" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <!-- Choose sync or async -->
- <async serializationExecutorPoolSize="0"/>
- <!-- <sync replTimeout="17500"/> -->
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- </cache-config>
-
- <cache-config name="mvcc-entity">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-entity" mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="optimistic-entity">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="optimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-opt-entity" mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="pessimistic-entity">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-entity" mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="mvcc-entity-repeatable">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-entity-rr" mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="pessimistic-entity-repeatable">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-entity-rr" mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="local-query">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="replicated-query">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-query" mode="replication">
- <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <async serializationExecutorPoolSize="0"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="timestamps-cache">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-timestamps" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <async serializationExecutorPoolSize="0"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- </cache-config>
-
- <cache-config name="mvcc-shared">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-shared" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="optimistic-shared">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="optimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-opt-shared" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="pessimistic-shared">
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-shared" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="mvcc-shared-repeatable">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="mvcc" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-shared-rr" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
- <cache-config name="pessimistic-shared-repeatable">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
- nodeLockingScheme="pessimistic" useLockStriping="false"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-shared-rr" mode="replication">
- <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
- <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
- <sync replTimeout="17500"/>
- </clustering>
- <listeners asyncPoolSize="0"/>
- <jmxStatistics enabled="true"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes">10000</property>
- <property name="timeToLiveSeconds">1000</property>
- <property name="minTimeToLiveSeconds">120</property>
- </default>
- <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
- </eviction>
- </cache-config>
-
-</cache-configs>
Copied: projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml (from rev 104567, projects/cluster/ha-server-cache-jbc/trunk/src/test/resources/jboss-cache-configs.xml)
===================================================================
--- projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml (rev 0)
+++ projects/cluster/ha-server-cache-jbc/branches/Branch_2_0/src/test/resources/jboss-cache-configs.xml 2010-05-07 18:33:38 UTC (rev 104569)
@@ -0,0 +1,421 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cache-configs xmlns="urn:jboss:jbosscache-core:cache-repo:3.2">
+
+ <!--
+ JBoss Cache configurations using the standard JBC 3.x config format
+ can be added to this file, and will usable by the AS's CacheManager
+ if the "configResource" property in the jboss-cache-manager-jboss-beans.xml
+ file's "CacheConfigurationRegistry" bean is uncommented. (It is
+ commented out by default.)
+ However, use of the microcontainer config format used in this
+ sar's jboss-cache-manager-jboss-beans.xml file is recommended.
+ -->
+
+ <cache-config name="standard-session-cache">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="false"/>
+ <startup regionsInactiveOnStartup="false"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-SessionCache" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <!-- Choose sync or async -->
+ <async serializationExecutorPoolSize="0"/>
+ <!-- <sync replTimeout="17500"/> -->
+
+ <buddy enabled="false" poolName="default" communicationTimeout="17500">
+ <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+ <locator>
+ <properties>
+ numBuddies=1
+ ignoreColocatedBuddies=true
+ </properties>
+ </locator>
+ </buddy>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+
+ <loaders passivation="true" shared="false">
+ <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+ fetchPersistentState="true" purgeOnStartup="true">
+ <properties>
+ location=${jboss.server.data.dir}${/}session
+ ignoreModifications=false
+ checkCharacterPortability=false
+ </properties>
+ </loader>
+ </loaders>
+ </cache-config>
+
+ <cache-config name="field-granularity-session-cache">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-FieldSessionCache" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <!-- Choose sync or async -->
+ <async serializationExecutorPoolSize="0"/>
+ <!-- <sync replTimeout="17500"/> -->
+
+ <buddy enabled="false" poolName="default" communicationTimeout="17500">
+ <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+ <locator>
+ <properties>
+ numBuddies=1
+ ignoreColocatedBuddies=true
+ </properties>
+ </locator>
+ </buddy>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+
+ <loaders passivation="true" shared="false">
+ <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+ fetchPersistentState="true" purgeOnStartup="true">
+ <properties>
+ location=${jboss.server.data.dir}${/}field-session
+ ignoreModifications=false
+ checkCharacterPortability=false
+ </properties>
+ </loader>
+ </loaders>
+ </cache-config>
+
+ <cache-config name="sfsb-cache">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="false"/>
+ <startup regionsInactiveOnStartup="false"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-SFSBCache" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <!-- Choose sync or async -->
+ <async serializationExecutorPoolSize="0"/>
+ <!-- <sync replTimeout="17500"/> -->
+
+ <buddy enabled="false" poolName="default" communicationTimeout="17500">
+ <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+ <locator>
+ <properties>
+ numBuddies=1
+ ignoreColocatedBuddies=true
+ </properties>
+ </locator>
+ </buddy>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+
+ <loaders passivation="true" shared="false">
+ <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+ fetchPersistentState="true" purgeOnStartup="true">
+ <properties>
+ location=${jboss.server.data.dir}${/}sfsb
+ ignoreModifications=false
+ checkCharacterPortability=false
+ </properties>
+ </loader>
+ </loaders>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="ha-partition">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.BatchModeTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="false"/>
+ <startup regionsInactiveOnStartup="false"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-HAPartitionCache" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <!-- Choose sync or async -->
+ <async serializationExecutorPoolSize="0"/>
+ <!-- <sync replTimeout="17500"/> -->
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ </cache-config>
+
+ <cache-config name="mvcc-entity">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-entity" mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="optimistic-entity">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="optimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-opt-entity" mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="pessimistic-entity">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-entity" mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="mvcc-entity-repeatable">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-entity-rr" mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="pessimistic-entity-repeatable">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-entity-rr" mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="local-query">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="replicated-query">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-query" mode="replication">
+ <stateRetrieval fetchInMemoryState="false" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <async serializationExecutorPoolSize="0"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="timestamps-cache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-timestamps" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <async serializationExecutorPoolSize="0"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ </cache-config>
+
+ <cache-config name="mvcc-shared">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-shared" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="optimistic-shared">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="optimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-opt-shared" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="pessimistic-shared">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-shared" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="mvcc-shared-repeatable">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="mvcc" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-mvcc-shared-rr" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+ <cache-config name="pessimistic-shared-repeatable">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"
+ nodeLockingScheme="pessimistic" useLockStriping="false"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <clustering clusterName="${jboss.partition.name:DefaultPartition}-pess-shared-rr" mode="replication">
+ <stateRetrieval fetchInMemoryState="true" timeout="60000"/>
+ <jgroupsConfig multiplexerStack="${jboss.default.jgroups.stack:udp}"/>
+ <sync replTimeout="17500"/>
+ </clustering>
+ <listeners asyncPoolSize="0"/>
+ <jmxStatistics enabled="true"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes">10000</property>
+ <property name="timeToLiveSeconds">1000</property>
+ <property name="minTimeToLiveSeconds">120</property>
+ </default>
+ <region name="/TS" algorithmClass="org.jboss.cache.eviction.NullEvictionAlgorithm"/>
+ </eviction>
+ </cache-config>
+
+</cache-configs>
More information about the jboss-cvs-commits
mailing list