[jboss-cvs] JBossAS SVN: r108953 - 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:54:07 EDT 2010


Author: smarlow at redhat.com
Date: 2010-10-27 14:54:07 -0400 (Wed, 27 Oct 2010)
New Revision: 108953

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java
Log:
handle else restart case

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:49:04 UTC (rev 108952)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/jndi/ispn/DistributedTreeManager.java	2010-10-27 18:54:07 UTC (rev 108953)
@@ -92,28 +92,37 @@
    @Override
    public void init()
    {
+      if (LOG.isDebugEnabled())
+      {
+         LOG.debug("init: reuse current cache?" + (cache!=null? "yes" : "no") +
+            ", cache name=" + this.cacheName);
+      }
       if(this.cache == null)  // only create the treecache once (stop + start will use the same treecache)
       {
          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);
       }
+      else
+      if (!cache.getCache().getStatus().allowInvocations())
+      {
+         cache.getCache().start();
+      }
    }
 
 
    @Override
    public void shutdown()
    {
+      if (LOG.isDebugEnabled())
+      {
+         LOG.debug("shutdown: stopping");
+      }
+
       this.cache.stop();
    }
 



More information about the jboss-cvs-commits mailing list