JBoss Cache SVN: r7216 - in benchmarks/benchmark-fwk/trunk/cache-products: starobrno/src/org/cachebench/cachewrappers and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 09:38:14 -0500 (Thu, 27 Nov 2008)
New Revision: 7216
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java
Log:
bench tree cache as well
Modified: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml 2008-11-27 14:11:09 UTC (rev 7215)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml 2008-11-27 14:38:14 UTC (rev 7216)
@@ -1,46 +1,253 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module relativePaths="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="CacheBenchmarkFwk" />
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
- </CLASSES>
- <JAVADOC>
- <root url="file://$MODULE_DIR$/../../../products/ehcache-1.5.0/javadocs" />
- </JAVADOC>
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntryProperties />
- <javadoc-paths>
- <root url="jar://$MODULE_DIR$/../../../products/ehcache-1.5.0/ehcache-1.5.0-javadoc.zip!/" />
- </javadoc-paths>
- </component>
-</module>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="CacheBenchmarkFwk" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="file://$MODULE_DIR$/../../../products/ehcache-1.5.0/javadocs" />
+ </JAVADOC>
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/whirlycache-1.0.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/concurrent-1.3.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/commons-collections-3.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/smtp.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/jcommon.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/mailapi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/dsn.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/commons-beanutils.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/commons-math-1.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/pop3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/activation.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/mail.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/imap.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/commons-digester.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/jfreechart.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../lib/common/testng-5.1-jdk15.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../coherence-3.3.1/lib/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="Trunk" />
+ <javadoc-paths>
+ <root url="jar://$MODULE_DIR$/../../../products/ehcache-1.5.0/ehcache-1.5.0-javadoc.zip!/" />
+ </javadoc-paths>
+ </component>
+</module>
+
Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java 2008-11-27 14:11:09 UTC (rev 7215)
+++ benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java 2008-11-27 14:38:14 UTC (rev 7216)
@@ -5,6 +5,9 @@
import org.cachebench.CacheWrapper;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.tree.TreeCache;
+import org.jboss.starobrno.tree.TreeCacheImpl;
+import org.jboss.starobrno.tree.Fqn;
import java.util.List;
import java.util.Map;
@@ -12,18 +15,27 @@
public class StarobrnoWrapper implements CacheWrapper
{
private Cache flatCache;
+ private TreeCache treeCache;
private Log log = LogFactory.getLog(StarobrnoWrapper.class);
+ private boolean useTree = false;
+
+
public StarobrnoWrapper()
{
}
public void init(Map parameters) throws Exception
{
+ useTree = Boolean.getBoolean("starobrno.tree");
log.info("Creating cache with the following configuration: " + parameters);
- flatCache = new DefaultCacheFactory().createCache((String) parameters.get("config"));
+ flatCache = new DefaultCacheFactory().createCache((String) parameters.get("config"), false);
+ if (useTree) flatCache.getConfiguration().setInvocationBatchingEnabled(true);
+ flatCache.start();
log.info("Running following JBossCacheVersion: " + org.jboss.cache.Version.version);
log.info("Running following JBossCacheCodeName: " + org.jboss.cache.Version.codename);
+ log.info("Starobrno: Using tree API? " + useTree);
+ if (useTree) treeCache = new TreeCacheImpl(flatCache);
}
public void setUp() throws Exception
@@ -37,12 +49,18 @@
public void put(List<String> path, Object key, Object value) throws Exception
{
- flatCache.put(key, value);
+ if (useTree)
+ treeCache.put(Fqn.fromList(path, true), key, value);
+ else
+ flatCache.put(key, value);
}
public Object get(List<String> path, Object key) throws Exception
{
- return flatCache.get(key);
+ if (useTree)
+ return treeCache.get(Fqn.fromList(path, true), key);
+ else
+ return flatCache.get(key);
}
public void empty() throws Exception
@@ -62,7 +80,11 @@
public Object getReplicatedData(List<String> path, String key) throws Exception
{
- return flatCache.get(key); // todo
+ if (useTree)
+ return treeCache.get(Fqn.fromList(path, true), key);
+ else
+ return flatCache.get(key);
+// return flatCache.get(key); // todo
// if (!cache.getConfiguration().getCacheMode().isSynchronous())
// {
// log.info("Sleeping 5 seconds because the cache is replicated asynchronious!");
16 years
JBoss Cache SVN: r7215 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 09:11:09 -0500 (Thu, 27 Nov 2008)
New Revision: 7215
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jgroups.jar
Log:
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jgroups.jar
===================================================================
(Binary files differ)
16 years
JBoss Cache SVN: r7214 - benchmarks/benchmark-fwk/trunk/cache-products/starobrno/lib.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 09:03:46 -0500 (Thu, 27 Nov 2008)
New Revision: 7214
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/starobrno/lib/jgroups.jar
benchmarks/benchmark-fwk/trunk/cache-products/starobrno/lib/starobrno.jar
Log:
Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/lib/jgroups.jar
===================================================================
(Binary files differ)
Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/lib/starobrno.jar
===================================================================
(Binary files differ)
16 years
JBoss Cache SVN: r7213 - core/branches/flat/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 08:37:31 -0500 (Thu, 27 Nov 2008)
New Revision: 7213
Modified:
core/branches/flat/src/main/java/org/jboss/cache/jmx/JmxRegistrationManager.java
Log:
Ported from trunk
Modified: core/branches/flat/src/main/java/org/jboss/cache/jmx/JmxRegistrationManager.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/jmx/JmxRegistrationManager.java 2008-11-27 12:39:44 UTC (rev 7212)
+++ core/branches/flat/src/main/java/org/jboss/cache/jmx/JmxRegistrationManager.java 2008-11-27 13:37:31 UTC (rev 7213)
@@ -45,176 +45,159 @@
* is being used.
* <p/>
* It is immutable: both cache instance and MBeanServer are being passed as arguments to the constructor.
+ * <p />
+ * <p>
+ * Note that by default object names used are prefixed with <tt>jboss.cache:service=JBossCache</tt>. While this format
+ * works for and is consistent with JBoss AS and the JMX console, it has been known to cause problems with other JMX
+ * servers such as Websphere. To work around this, you can provide the following VM system property to override this
+ * prefix with a prefix of your choice:
+ * <tt><b>-Djbosscache.jmx.prefix=JBossCache</b></tt>
+ * </p>
*
* @author Mircea.Markus(a)jboss.com
* @since 3.0
*/
-public class JmxRegistrationManager
-{
- private static final Log log = LogFactory.getLog(JmxRegistrationManager.class);
+public class JmxRegistrationManager {
- /**
- * default ObjectName for clusterd caches. Cluster name should pe appended.
- */
- public static final String REPLICATED_CACHE_PREFIX = "jboss.cache:service=JBossCache,cluster=";
+ private static final Log log = LogFactory.getLog(JmxRegistrationManager.class);
- /**
- * default ObjectName for non clustered caches. An unique identifier should be appended.
- */
- public static final String LOCAL_CACHE_PREFIX = "jboss.cache:service=JBossCache,uniqueId=";
+ private static final String GENERAL_PREFIX = System.getProperty("jbosscache.jmx.prefix", "jboss.cache:service=JBossCache");
- /**
- * Key for every Dynamic mbean added.
- */
- public static final String JMX_RESOURCE_KEY = ",jmx-resource=";
+ /**
+ * default ObjectName for clusterd caches. Cluster name should pe appended.
+ */
+ public static final String REPLICATED_CACHE_PREFIX = GENERAL_PREFIX + ",cluster=";
- private MBeanServer mBeanServer;
+ /**
+ * default ObjectName for non clustered caches. An unique identifier should be appended.
+ */
+ public static final String LOCAL_CACHE_PREFIX = GENERAL_PREFIX + ",uniqueId=";
- private String objectNameBase;
+ /**
+ * Key for every Dynamic mbean added.
+ */
+ public static final String JMX_RESOURCE_KEY = ",jmx-resource=";
- private CacheSPI cacheSpi;
+ private MBeanServer mBeanServer;
- /**
- * C-tor.
- *
- * @param mBeanServer the server where mbeans are being registered
- * @param cache cache that needs to be monitored
- * @param objectNameBase path in the MBeanServer where to register cache MBeans
- */
- public JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, ObjectName objectNameBase)
- {
- this.mBeanServer = mBeanServer;
- this.cacheSpi = (CacheSPI) cache;
- processBaseName(objectNameBase);
- }
+ private String objectNameBase;
- public JmxRegistrationManager(MBeanServer mBeanServer, Cache_Legacy cache, String objectNameBase)
- {
- throw new UnsupportedOperationException("Remove any code that relies on this!");
- }
+ private CacheSPI cacheSpi;
- /**
- * @throws IllegalArgumentException if the supplied objectNameBase name isn't valid
- * @see #JmxRegistrationManager(javax.management.MBeanServer, org.jboss.cache.Cache_Legacy , javax.management.ObjectName)
- */
- public JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, String objectNameBase)
- {
- this.mBeanServer = mBeanServer;
- this.cacheSpi = (CacheSPI) cache;
- try
- {
- processBaseName(new ObjectName(objectNameBase));
- }
- catch (MalformedObjectNameException e)
- {
- throw new IllegalArgumentException("Invalid Object Name : " + objectNameBase, e);
- }
- }
+ /**
+ * C-tor.
+ *
+ * @param mBeanServer the server where mbeans are being registered
+ * @param cache cache that needs to be monitored
+ * @param objectNameBase path in the MBeanServer where to register cache MBeans
+ */
+ public JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, ObjectName objectNameBase) {
+ this.mBeanServer = mBeanServer;
+ this.cacheSpi = (CacheSPI) cache;
+ processBaseName(objectNameBase);
+ }
- /**
- * Defaults to platform to platform MBeanServer.
- *
- * @see java.lang.management.ManagementFactory#getPlatformMBeanServer()
- * @see <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/mxbeans.html#mbean_s...">platform MBeanServer</a>
- */
- public JmxRegistrationManager(Cache cache, ObjectName objectNameBase)
- {
- this(ManagementFactory.getPlatformMBeanServer(), cache, objectNameBase);
- }
+ public JmxRegistrationManager(MBeanServer mBeanServer, Cache_Legacy cache, String objectNameBase) {
+ throw new UnsupportedOperationException("Remove any code that relies on this!");
+ }
- public JmxRegistrationManager(Cache cache)
- {
- this(cache, null);
- }
+ /**
+ * @throws IllegalArgumentException if the supplied objectNameBase name isn't valid
+ */
+ public JmxRegistrationManager(MBeanServer mBeanServer, Cache cache, String objectNameBase) {
+ this.mBeanServer = mBeanServer;
+ this.cacheSpi = (CacheSPI) cache;
+ try {
+ processBaseName(new ObjectName(objectNameBase));
+ }
+ catch (MalformedObjectNameException e) {
+ throw new IllegalArgumentException("Invalid Object Name : " + objectNameBase, e);
+ }
+ }
- /**
- * Performs the MBean registration.
- */
- public void registerAllMBeans() throws CacheException
- {
- try
- {
- List<ResourceDMBean> resourceDMBeans = getResourceDMBeans();
- for (ResourceDMBean resource : resourceDMBeans)
- {
- String resourceName = resource.getObjectName();
- ObjectName objectName = new ObjectName(getObjectName(resourceName));
- if (!mBeanServer.isRegistered(objectName))
- {
- mBeanServer.registerMBean(resource, objectName);
+ /**
+ * Defaults to platform to platform MBeanServer.
+ *
+ * @see java.lang.management.ManagementFactory#getPlatformMBeanServer()
+ * @see <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/mxbeans.html#mbean_s...">platform MBeanServer</a>
+ */
+ public JmxRegistrationManager(Cache cache, ObjectName objectNameBase) {
+ this(ManagementFactory.getPlatformMBeanServer(), cache, objectNameBase);
+ }
+
+ public JmxRegistrationManager(Cache cache) {
+ this(cache, null);
+ }
+
+ /**
+ * Performs the MBean registration.
+ */
+ public void registerAllMBeans() throws CacheException {
+ try {
+ List<ResourceDMBean> resourceDMBeans = getResourceDMBeans();
+ for (ResourceDMBean resource : resourceDMBeans) {
+ String resourceName = resource.getObjectName();
+ ObjectName objectName = new ObjectName(getObjectName(resourceName));
+ if (!mBeanServer.isRegistered(objectName)) {
+ mBeanServer.registerMBean(resource, objectName);
+ }
}
- }
- }
- catch (Exception e)
- {
- throw new CacheException("Failure while registering mbeans", e);
- }
- }
+ }
+ catch (Exception e) {
+ throw new CacheException("Failure while registering mbeans", e);
+ }
+ }
- /**
- * Unregisters all the MBeans registered through {@link #registerAllMBeans()}.
- */
- public void unregisterAllMBeans() throws CacheException
- {
- log.trace("Unregistering jmx resources..");
- try
- {
- List<ResourceDMBean> resourceDMBeans = getResourceDMBeans();
- for (ResourceDMBean resource : resourceDMBeans)
- {
- String resourceName = resource.getObject().getClass().getSimpleName();
- ObjectName objectName = new ObjectName(getObjectName(resourceName));
- if (mBeanServer.isRegistered(objectName))
- {
- mBeanServer.unregisterMBean(objectName);
+ /**
+ * Unregisters all the MBeans registered through {@link #registerAllMBeans()}.
+ */
+ public void unregisterAllMBeans() throws CacheException {
+ log.trace("Unregistering jmx resources..");
+ try {
+ List<ResourceDMBean> resourceDMBeans = getResourceDMBeans();
+ for (ResourceDMBean resource : resourceDMBeans) {
+ String resourceName = resource.getObject().getClass().getSimpleName();
+ ObjectName objectName = new ObjectName(getObjectName(resourceName));
+ if (mBeanServer.isRegistered(objectName)) {
+ mBeanServer.unregisterMBean(objectName);
+ }
}
- }
- }
- catch (Exception e)
- {
- throw new CacheException("Failure while unregistering mbeans", e);
- }
- }
+ }
+ catch (Exception e) {
+ throw new CacheException("Failure while unregistering mbeans", e);
+ }
+ }
- private List<ResourceDMBean> getResourceDMBeans()
- {
- List<ResourceDMBean> resourceDMBeans = new ArrayList<ResourceDMBean>();
- for (ComponentRegistry.Component component : cacheSpi.getComponentRegistry().getRegiteredComponents())
- {
- ResourceDMBean resourceDMBean = new ResourceDMBean(component.getInstance());
- if (resourceDMBean.isManagedResource())
- {
- resourceDMBeans.add(resourceDMBean);
- }
- }
- return resourceDMBeans;
- }
+ private List<ResourceDMBean> getResourceDMBeans() {
+ List<ResourceDMBean> resourceDMBeans = new ArrayList<ResourceDMBean>();
+ for (ComponentRegistry.Component component : cacheSpi.getComponentRegistry().getRegiteredComponents()) {
+ ResourceDMBean resourceDMBean = new ResourceDMBean(component.getInstance());
+ if (resourceDMBean.isManagedResource()) {
+ resourceDMBeans.add(resourceDMBean);
+ }
+ }
+ return resourceDMBeans;
+ }
- private void processBaseName(ObjectName baseName)
- {
- if (baseName != null)
- {
- this.objectNameBase = baseName.getCanonicalName();
- return;
- }
- if (cacheSpi.getConfiguration().getCacheMode().equals(Configuration.CacheMode.LOCAL))
- {
- objectNameBase = LOCAL_CACHE_PREFIX + System.currentTimeMillis();
- }
- else //the cache is clustered
- {
- objectNameBase = REPLICATED_CACHE_PREFIX + cacheSpi.getConfiguration().getClusterName();
- }
- }
+ private void processBaseName(ObjectName baseName) {
+ if (baseName != null) {
+ this.objectNameBase = baseName.getCanonicalName();
+ return;
+ }
+ if (cacheSpi.getConfiguration().getCacheMode().equals(Configuration.CacheMode.LOCAL)) {
+ objectNameBase = LOCAL_CACHE_PREFIX + System.currentTimeMillis();
+ } else //the cache is clustered
+ {
+ objectNameBase = REPLICATED_CACHE_PREFIX + cacheSpi.getConfiguration().getClusterName();
+ }
+ }
- public String getObjectName(String resourceName)
- {
- return objectNameBase + JMX_RESOURCE_KEY + resourceName;
- }
+ public String getObjectName(String resourceName) {
+ return objectNameBase + JMX_RESOURCE_KEY + resourceName;
+ }
- public String getObjectNameBase()
- {
- return objectNameBase;
- }
+ public String getObjectNameBase() {
+ return objectNameBase;
+ }
}
16 years
JBoss Cache SVN: r7212 - in core/tags/3.0.1.GA: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 07:39:44 -0500 (Thu, 27 Nov 2008)
New Revision: 7212
Modified:
core/tags/3.0.1.GA/pom.xml
core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java
Log:
GA
Modified: core/tags/3.0.1.GA/pom.xml
===================================================================
--- core/tags/3.0.1.GA/pom.xml 2008-11-27 12:37:27 UTC (rev 7211)
+++ core/tags/3.0.1.GA/pom.xml 2008-11-27 12:39:44 UTC (rev 7212)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>3.0.1-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.0.1.GA</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
@@ -443,7 +443,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.0.1-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.0.1.GA-JBossAS</jbosscache-core-version>
</properties>
<dependencies>
<dependency>
Modified: core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java 2008-11-27 12:37:27 UTC (rev 7211)
+++ core/tags/3.0.1.GA/src/main/java/org/jboss/cache/Version.java 2008-11-27 12:39:44 UTC (rev 7212)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.0.1-SNAPSHOT";
+ public static final String version = "3.0.1.GA";
public static final String codename = "Naga";
//public static final String cvs = "$Id$";
- static final byte[] version_id = {'0', '3', '0', '0', 'S'};
+ static final byte[] version_id = {'0', '3', '0', '1', 'G', 'A'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
16 years
JBoss Cache SVN: r7211 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 07:37:27 -0500 (Thu, 27 Nov 2008)
New Revision: 7211
Added:
core/tags/3.0.1.GA/
Log:
Copied: core/tags/3.0.1.GA (from rev 7210, core/trunk)
16 years
JBoss Cache SVN: r7210 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-11-27 07:28:29 -0500 (Thu, 27 Nov 2008)
New Revision: 7210
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
Log:
Mem leak on Fqns in Invocation context
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-11-27 04:07:17 UTC (rev 7209)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-11-27 12:28:29 UTC (rev 7210)
@@ -181,6 +181,10 @@
private boolean wasLoadedIntoMemory(InvocationContext ctx, Fqn fqn)
{
Set<Fqn> fqnsLoaded = ctx.getFqnsLoaded();
+ // make sure we wipe this in the context otherwise this will leak.
+ // TODO: This should ideally be done in the InvocationContextInterceptor by calling InvocationContext.reset() on exit
+ // for now, just remove this here
+ ctx.setFqnsLoaded(null);
return fqnsLoaded != null && fqnsLoaded.contains(fqn);
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 04:07:17 UTC (rev 7209)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyActivationInterceptor.java 2008-11-27 12:28:29 UTC (rev 7210)
@@ -181,6 +181,10 @@
private boolean wasLoadedIntoMemory(InvocationContext ctx, Fqn fqn)
{
Set<Fqn> fqnsLoaded = ctx.getFqnsLoaded();
+ // make sure we wipe this in the context otherwise this will leak.
+ // TODO: This should ideally be done in the InvocationContextInterceptor by calling InvocationContext.reset() on exit
+ // for now, just remove this here
+ ctx.setFqnsLoaded(null);
return fqnsLoaded != null && fqnsLoaded.contains(fqn);
}
16 years
JBoss Cache SVN: r7209 - core/trunk/src/test/java/org/jboss/cache/integration/websession/util.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-26 23:07:17 -0500 (Wed, 26 Nov 2008)
New Revision: 7209
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/Request.java
Log:
Emulate the StandardHostValve
Modified: core/trunk/src/test/java/org/jboss/cache/integration/websession/util/Request.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/integration/websession/util/Request.java 2008-11-27 04:06:45 UTC (rev 7208)
+++ core/trunk/src/test/java/org/jboss/cache/integration/websession/util/Request.java 2008-11-27 04:07:17 UTC (rev 7209)
@@ -63,6 +63,9 @@
manager.endBatch();
}
}
+
+ // StandardHostValve calls getSession(false) on the way out, so...
+ getSession(false);
}
/**
@@ -77,7 +80,10 @@
}
if (session != null && !session.isValid())
+ {
session = null;
+ getSession(create);
+ }
if (create && session == null)
session = manager.createSession();
16 years
JBoss Cache SVN: r7208 - core/trunk/src/test/java/org/jboss/cache/integration/websession/util.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-26 23:06:45 -0500 (Wed, 26 Nov 2008)
New Revision: 7208
Modified:
core/trunk/src/test/java/org/jboss/cache/integration/websession/util/SessionManager.java
Log:
Handle expiration/passivation of sessions in buddy backup tree
Modified: core/trunk/src/test/java/org/jboss/cache/integration/websession/util/SessionManager.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/integration/websession/util/SessionManager.java 2008-11-27 02:12:22 UTC (rev 7207)
+++ core/trunk/src/test/java/org/jboss/cache/integration/websession/util/SessionManager.java 2008-11-27 04:06:45 UTC (rev 7208)
@@ -38,6 +38,8 @@
import org.jboss.cache.CacheManager;
import org.jboss.cache.CacheStatus;
import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.integration.websession.util.WebAppMetadata.Granularity;
import org.jboss.cache.notifications.annotation.CacheListener;
@@ -147,13 +149,16 @@
* Allows test driver to mock Tomcat background processes' expiration
* of an overage session.
*
- * FIXME deal with buddy backup tree
- *
* @param id the session id
*/
public void expireSession(String id)
{
Session session = removeSession(id, true, true);
+ if (buddyReplication)
+ {
+ cleanBuddyBackupTree(id, false);
+ }
+
if (session != null)
session.getMetadata().valid = false;
}
@@ -162,8 +167,6 @@
* Allows test driver to mock Tomcat background processes' passivation
* of a session.
*
- * FIXME deal with buddy backup tree
- *
* @param id the session id
*/
public void passivate(String id)
@@ -174,6 +177,11 @@
sessions.remove(id);
cache.evict(getSessionFqn(id), true);
+
+ if (buddyReplication)
+ {
+ cleanBuddyBackupTree(id, true);
+ }
}
public Cache<Object, Object> getCache()
@@ -528,5 +536,30 @@
session.setOutdated(true);
}
}
+
+ private void cleanBuddyBackupTree(String id, boolean evict)
+ {
+ Fqn<String> mainFqn = getSessionFqn(id);
+ Node<Object, Object> root = cache.getNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
+ if (root != null)
+ {
+ Set<Node<Object, Object>> children = root.getChildren();
+ for (Node<Object, Object> child : children)
+ {
+ @SuppressWarnings("unchecked")
+ Fqn<String> backupFqn = Fqn.fromRelativeFqn(child.getFqn(), mainFqn);
+ if (evict)
+ {
+ cache.evict(backupFqn, true);
+ }
+ else
+ {
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.removeNode(backupFqn);
+ }
+ }
+ }
+
+ }
}
16 years
JBoss Cache SVN: r7207 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-11-26 21:12:22 -0500 (Wed, 26 Nov 2008)
New Revision: 7207
Modified:
core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
Log:
[JBCACHE-1446] Include fqnsLoaded in doCopy()
Modified: core/trunk/src/main/java/org/jboss/cache/InvocationContext.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2008-11-27 02:05:06 UTC (rev 7206)
+++ core/trunk/src/main/java/org/jboss/cache/InvocationContext.java 2008-11-27 02:12:22 UTC (rev 7207)
@@ -576,6 +576,7 @@
copy.originLocal = originLocal;
copy.transaction = transaction;
copy.transactionContext = transactionContext;
+ copy.fqnsLoaded = fqnsLoaded;
}
/**
16 years