[jboss-cvs] JBossAS SVN: r108040 - projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 8 11:10:54 EDT 2010


Author: pferraro
Date: 2010-09-08 11:10:53 -0400 (Wed, 08 Sep 2010)
New Revision: 108040

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java
Log:
Use CacheContainer.getCache() instead of CacheContainer.getCache(null).

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java	2010-09-08 15:10:25 UTC (rev 108039)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java	2010-09-08 15:10:53 UTC (rev 108040)
@@ -37,6 +37,7 @@
 import org.infinispan.atomic.AtomicMap;
 import org.infinispan.atomic.AtomicMapLookup;
 import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.manager.CacheContainer;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
 import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
 import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
@@ -95,7 +96,8 @@
    @Override
    public void startService() throws Exception
    {
-      this.cache = this.registry.getCacheContainer(this.containerName).getCache(this.cacheName);
+      CacheContainer container = this.registry.getCacheContainer(this.containerName);
+      this.cache = (this.cacheName != null) ? container.<Serializable, Serializable>getCache(this.cacheName) : container.<Serializable, Serializable>getCache();
       
       if (this.cache.getStatus() != ComponentStatus.RUNNING)
       {
@@ -111,6 +113,7 @@
    {      
       this.cache.removeListener(this);
       
+      // Only stop cache if we started it
       if (this.startedCache.compareAndSet(true, false))
       {
          this.cache.stop();



More information about the jboss-cvs-commits mailing list