[jboss-cvs] JBossAS SVN: r108949 - projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 27 14:16:37 EDT 2010
Author: smarlow at redhat.com
Date: 2010-10-27 14:16:37 -0400 (Wed, 27 Oct 2010)
New Revision: 108949
Modified:
projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java
Log:
handle the restart case by using the same treecache refererence. previous contents may still be present which reflects what we may see on the cluster
Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java 2010-10-27 18:14:57 UTC (rev 108948)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java 2010-10-27 18:16:37 UTC (rev 108949)
@@ -92,13 +92,21 @@
@Override
public void init()
{
- CacheContainer container = this.registry.getCacheContainer(this.containerName);
- Cache<String, Binding> cache = (this.cacheName == null) ? container.<String, Binding>getCache() : container.<String, Binding>getCache(this.cacheName);
- this.cache = this.treeCacheFactory.createTreeCache(cache);
-
- if (!cache.getStatus().allowInvocations())
+ if(this.cache == null) // only create the treecache once (stop + start will use the same treecache)
{
- this.cache.start();
+ CacheContainer container = this.registry.getCacheContainer(this.containerName);
+ Cache<String, Binding> underlyingCache = (this.cacheName == null) ? container.<String, Binding>getCache() : container.<String, Binding>getCache(this.cacheName);
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("cache " + underlyingCache.getName() + " allow invocations flag == " + underlyingCache.getStatus().allowInvocations());
+ }
+
+ if (!underlyingCache.getStatus().allowInvocations())
+ {
+ underlyingCache.start();
+ }
+
+ this.cache = this.treeCacheFactory.createTreeCache(underlyingCache);
}
}
More information about the jboss-cvs-commits
mailing list