[jboss-cvs] JBossAS SVN: r107778 - in projects/cluster/ha-server-cache-ispn/trunk/src: test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 25 11:14:13 EDT 2010


Author: vblagojevic at jboss.com
Date: 2010-08-25 11:14:12 -0400 (Wed, 25 Aug 2010)
New Revision: 107778

Added:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/LockManagerSource.java
Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DefaultCacheSource.java
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactory.java
   projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactoryTest.java
   projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerTest.java
Log:
initial lock manager integration

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/AtomicMapEntry.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -46,9 +46,10 @@
     * @param data an atomic map
     * @return the entry value
     */
+   @SuppressWarnings("unchecked")
    public <T> T get(AtomicMap<Object, Object> data)
    {
-      return this.cast(data.get(this.key()));
+      return (T) this.cast(data.get(this.key()));
    }
 
    /**
@@ -58,6 +59,7 @@
     * @param value the entry value
     * @return the old entry value, or null if no previous entry existed
     */
+   @SuppressWarnings("unchecked")
    public <T> T put(AtomicMap<Object, Object> data, Object value)
    {
       if (value == null) return null;
@@ -67,7 +69,7 @@
          throw new IllegalArgumentException(String.format("Attempt to put value of type %s into %s entry", value.getClass().getName(), this));
       }
       
-      return this.cast(data.put(this.key(), value));
+      return (T) this.cast(data.put(this.key(), value));
    }
    
    @SuppressWarnings("unchecked")

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DefaultCacheSource.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DefaultCacheSource.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DefaultCacheSource.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -21,39 +21,102 @@
  */
 package org.jboss.web.tomcat.service.session.distributedcache.ispn;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.infinispan.Cache;
 import org.infinispan.config.Configuration;
 import org.infinispan.config.Configuration.CacheMode;
 import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
+import org.jboss.ha.core.framework.server.CoreGroupCommunicationService;
+import org.jboss.ha.framework.server.lock.SharedLocalYieldingClusterLockManager;
 import org.jboss.ha.ispn.CacheContainerRegistry;
 import org.jboss.metadata.web.jboss.ReplicationConfig;
 import org.jboss.metadata.web.jboss.ReplicationMode;
 import org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager;
+import org.jgroups.Channel;
 
 /**
  * @author Paul Ferraro
  *
  */
-public class DefaultCacheSource implements CacheSource
+public class DefaultCacheSource implements CacheSource, LockManagerSource
 {
+   /** The scope we assign to our CoreGroupCommunicationService */
+   public static final Short HTTP_SESSION_MGR_SCOPE_ID = Short.valueOf((short) 222);
+   
    public static final String DEFAULT_CACHE_CONTAINER = "session";
    
    private final CacheContainerRegistry registry;
    
    private String defaultContainerName = DEFAULT_CACHE_CONTAINER;
    
+   private final Map<String,SharedLocalYieldingClusterLockManager> lockManagers = new HashMap<String, SharedLocalYieldingClusterLockManager>();
+   
    public DefaultCacheSource(CacheContainerRegistry registry)
    {
       this.registry = registry;
    }
+   
+   @Override
+   public SharedLocalYieldingClusterLockManager getLockManager(LocalDistributableSessionManager manager)
+   {
+      
+      String containerName = getContainerName(manager.getReplicationConfig());
+      SharedLocalYieldingClusterLockManager lockManager = null;
+      synchronized (lockManagers)
+      {
+         lockManager = lockManagers.get(containerName);
+         if(lockManager == null){
+            EmbeddedCacheManager container = this.registry.getCacheContainer(containerName);            
+            String cacheName = cacheName(manager); 
+            Cache<Object, Object> cache = container.getCache(cacheName);
+            JGroupsTransport transport = (JGroupsTransport) cache.getAdvancedCache().getRpcManager().getTransport();
+            Channel channel = transport.getChannel();
+            
+            try
+            {
+               CoreGroupCommunicationService gcs = new CoreGroupCommunicationService();
+               gcs.setChannel(channel);
+               gcs.setScopeId(HTTP_SESSION_MGR_SCOPE_ID);
+               gcs.start();
 
+               lockManager = new SharedLocalYieldingClusterLockManager("HTTPSESSIONOWNER", gcs, gcs);
+               lockManager.start();
+               lockManagers.put(containerName, lockManager);
+            }
+            catch (Exception e)
+            {
+               throw new IllegalStateException("Unexpected exception while starting lock manager for " + cacheName);
+            }
+         }
+      }          
+      return lockManager;
+   }
+   
+
    @Override
    public <K, V> Cache<K, V> getCache(LocalDistributableSessionManager manager)
    {
-      ReplicationConfig replConfig = manager.getReplicationConfig();
+      ReplicationConfig replConfig = manager.getReplicationConfig();            
+      String containerName = getContainerName(replConfig);    
+      
+      EmbeddedCacheManager container = this.registry.getCacheContainer(containerName);            
+      String cacheName = cacheName(manager);      
+      
+      Cache<?, ?> templateCache = container.getCache();
+      Configuration configuration = templateCache.getConfiguration().clone();      
+      CacheMode mode = selectMode(replConfig, configuration);      
+      configuration.setCacheMode(mode);      
+      container.defineConfiguration(cacheName, configuration);      
+      return container.getCache(cacheName);
+   }
+   
+   private String getContainerName(ReplicationConfig replConfig){      
       String templateCacheName = replConfig.getCacheName();
       
-      String containerName = this.defaultContainerName;
+      String containerName = this.defaultContainerName;;
       
       if (templateCacheName != null)
       {
@@ -61,24 +124,14 @@
          
          if (parts.length == 2)
          {
-            containerName = parts[0];
-            templateCacheName = parts[1];
+            containerName = parts[0];            
          }
       }
-      
-      EmbeddedCacheManager container = this.registry.getCacheContainer(containerName);
-      
-      String hostName = manager.getHostName();
-      String host = (hostName == null) || hostName.isEmpty() ? "localhost" : hostName;
-      
-      String context = manager.getContextName();
-      String path = context.isEmpty() || context.equals("/") ? "ROOT" : context.startsWith("/") ? context.substring(1) : context;
+      return containerName;
+   }
 
-      String cacheName = host + "/" + path;
-
-      Cache<?, ?> templateCache = container.getCache();
-      Configuration configuration = templateCache.getConfiguration().clone();
-      
+   private CacheMode selectMode(ReplicationConfig replConfig, Configuration configuration)
+   {
       Integer backups = replConfig.getBackups();
       ReplicationMode replMode = replConfig.getReplicationMode();
       
@@ -124,14 +177,19 @@
             }
          }
       }
-      
-      configuration.setCacheMode(mode);
-      
-      container.defineConfiguration(cacheName, configuration);
-      
-      return container.getCache(cacheName);
+      return mode;
    }
    
+   private String cacheName(LocalDistributableSessionManager manager){
+      String hostName = manager.getHostName();
+      String host = (hostName == null) || hostName.isEmpty() ? "localhost" : hostName;
+      
+      String context = manager.getContextName();
+      String path = context.isEmpty() || context.equals("/") ? "ROOT" : context.startsWith("/") ? context.substring(1) : context;
+
+      return host + "/" + path;
+   }   
+   
    public void setDefaultContainerName(String defaultContainerName)
    {
       this.defaultContainerName = defaultContainerName;

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManager.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -38,6 +38,8 @@
 import org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent;
 import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
 import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
+import org.jboss.ha.framework.server.lock.SharedLocalYieldingClusterLockManager;
+import org.jboss.ha.framework.server.lock.TimeoutException;
 import org.jboss.ha.ispn.atomic.AtomicMapFactory;
 import org.jboss.ha.ispn.invoker.CacheInvoker;
 import org.jboss.logging.Logger;
@@ -54,7 +56,7 @@
  * @author Paul Ferraro
  */
 @Listener
-public class DistributedCacheManager<T extends OutgoingDistributableSessionData> implements org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager<T>
+public class DistributedCacheManager<T extends OutgoingDistributableSessionData> implements org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager<T>,SessionOwnershipSupport
 {
    static String mask(String sessionId)
    {
@@ -77,6 +79,7 @@
    private static final Logger log = Logger.getLogger(DistributedCacheManager.class);
    
    private final LocalDistributableSessionManager manager;
+   private final SharedLocalYieldingClusterLockManager lockManager;
    private final SessionAttributeStorage<T> attributeStorage;
    private final Cache<String, AtomicMap<Object, Object>> cache;
    private final CacheInvoker invoker;
@@ -86,18 +89,23 @@
    
    private final AtomicBoolean startedCache = new AtomicBoolean(false);
    
-   public DistributedCacheManager(LocalDistributableSessionManager manager, Cache<String, AtomicMap<Object, Object>> cache, SessionAttributeStorage<T> attributeStorage, BatchingManager batchingManager, CacheInvoker invoker, AtomicMapFactory atomicMapFactory)
+   public DistributedCacheManager(LocalDistributableSessionManager manager,
+         SharedLocalYieldingClusterLockManager lockManager, Cache<String, AtomicMap<Object, Object>> cache,
+         SessionAttributeStorage<T> attributeStorage, BatchingManager batchingManager, CacheInvoker invoker,
+         AtomicMapFactory atomicMapFactory)
    {
       this.manager = manager;
+      this.lockManager = lockManager;
       this.cache = cache;
       this.attributeStorage = attributeStorage;
       this.batchingManager = batchingManager;
       this.invoker = invoker;
       this.atomicMapFactory = atomicMapFactory;
-      
+
       CacheLoaderManagerConfig loaderManagerConfig = this.cache.getConfiguration().getCacheLoaderManagerConfig();
-      
-      this.passivationEnabled = (loaderManagerConfig != null) ? loaderManagerConfig.isPassivation().booleanValue() && !loaderManagerConfig.isShared().booleanValue() : false;
+
+      this.passivationEnabled = (loaderManagerConfig != null) ? loaderManagerConfig.isPassivation().booleanValue()
+            && !loaderManagerConfig.isShared().booleanValue() : false;
    }
 
    /**
@@ -382,9 +390,47 @@
    @Override
    public SessionOwnershipSupport getSessionOwnershipSupport()
    {
-      return null;
+      return this;
    }
    
+   @Override
+   public LockResult acquireSessionOwnership(String realId, boolean newLock) throws TimeoutException, InterruptedException
+   {
+      String lockName = getSessionLockName(cache.getName(), realId);
+      SharedLocalYieldingClusterLockManager.LockResult result = lockManager.lock(lockName, getLockTimeout(), newLock);
+      LockResult ourResult = null;
+      switch (result)
+      {
+         case ACQUIRED_FROM_CLUSTER:
+            ourResult = LockResult.ACQUIRED_FROM_CLUSTER;
+            break;
+         case ALREADY_HELD:
+            ourResult = LockResult.ALREADY_HELD;
+            break;
+         case NEW_LOCK:
+            ourResult = LockResult.NEW_LOCK;
+      }
+      return ourResult;
+   }
+
+   @Override
+   public void relinquishSessionOwnership(String realId, boolean remove)
+   {
+      String lockName = getSessionLockName(cache.getName(), realId);
+      lockManager.unlock(lockName, remove);
+   }
+   
+   protected String getSessionLockName(String contextHostPath, String sessionId)
+   {
+      return contextHostPath + "_" + sessionId;
+   }
+   
+   protected long getLockTimeout()
+   {
+      // FIXME
+      return 30000;
+   }
+   
    /**
     * {@inheritDoc}
     * @see org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager#isLocal(java.lang.String)

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactory.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactory.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactory.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -26,6 +26,7 @@
 import org.infinispan.Cache;
 import org.infinispan.atomic.AtomicMap;
 import org.infinispan.transaction.tm.BatchModeTransactionManager;
+import org.jboss.ha.framework.server.lock.SharedLocalYieldingClusterLockManager;
 import org.jboss.ha.ispn.DefaultCacheContainerRegistry;
 import org.jboss.ha.ispn.atomic.AtomicMapFactory;
 import org.jboss.ha.ispn.atomic.DefaultAtomicMapFactory;
@@ -45,17 +46,25 @@
  */
 public class DistributedCacheManagerFactory implements org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManagerFactory
 {
-   private CacheSource source = new DefaultCacheSource(DefaultCacheContainerRegistry.getInstance());
+   private CacheSource source;
+   private LockManagerSource lmSource;
    private SessionAttributeStorageFactory storageFactory = new SessionAttributeStorageFactoryImpl();
    private SessionAttributeMarshallerFactory marshallerFactory = new SessionAttributeMarshallerFactoryImpl();
    private CacheInvoker invoker = new RetryingCacheInvoker(10, 100);
    private AtomicMapFactory atomicMapFactory = new DefaultAtomicMapFactory();
    
+   public DistributedCacheManagerFactory()
+   {      
+      DefaultCacheSource dcmSource = new DefaultCacheSource(DefaultCacheContainerRegistry.getInstance());
+      this.source = dcmSource;
+      this.lmSource = dcmSource;
+   }
+
    @Override
    public <T extends OutgoingDistributableSessionData> org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager<T> getDistributedCacheManager(LocalDistributableSessionManager manager)
    {
-      Cache<String, AtomicMap<Object, Object>> cache = this.source.getCache(manager);
-      
+      Cache<String, AtomicMap<Object, Object>> cache = this.source.getCache(manager);      
+      SharedLocalYieldingClusterLockManager lockManager = this.lmSource.getLockManager(manager);
       TransactionManager tm = cache.getAdvancedCache().getTransactionManager();
       
       if (!(tm instanceof BatchModeTransactionManager))
@@ -67,7 +76,7 @@
       SessionAttributeMarshaller marshaller = this.marshallerFactory.createMarshaller(manager);
       SessionAttributeStorage<T> storage = this.storageFactory.createStorage(manager.getReplicationConfig().getReplicationGranularity(), marshaller);
       
-      return new DistributedCacheManager<T>(manager, cache, storage, batchingManager, this.invoker, this.atomicMapFactory);
+      return new DistributedCacheManager<T>(manager, lockManager, cache, storage, batchingManager, this.invoker, this.atomicMapFactory);
    }
    
    public void setCacheSource(CacheSource source)
@@ -75,6 +84,11 @@
       this.source = source;
    }
    
+   public void setLockManagerSource(LockManagerSource lmSource)
+   {
+      this.lmSource = lmSource;
+   }
+   
    public void setSessionAttributeStorageFactory(SessionAttributeStorageFactory storageFactory)
    {
       this.storageFactory = storageFactory;

Added: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/LockManagerSource.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/LockManagerSource.java	                        (rev 0)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/LockManagerSource.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.web.tomcat.service.session.distributedcache.ispn;
+
+import org.jboss.ha.framework.server.lock.SharedLocalYieldingClusterLockManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager;
+
+/**
+ * @author Vladimir Blagojevic
+ *
+ */
+public interface LockManagerSource
+{
+   SharedLocalYieldingClusterLockManager getLockManager(LocalDistributableSessionManager manager);
+}

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactoryTest.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactoryTest.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerFactoryTest.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -51,6 +51,7 @@
 public class DistributedCacheManagerFactoryTest
 {
    private final CacheSource source = EasyMock.createStrictMock(CacheSource.class);
+   private final LockManagerSource lmsource = EasyMock.createStrictMock(LockManagerSource.class);
    private final SessionAttributeStorageFactory storageFactory = EasyMock.createStrictMock(SessionAttributeStorageFactory.class);
    private final SessionAttributeMarshallerFactory marshallerFactory = EasyMock.createStrictMock(SessionAttributeMarshallerFactory.class);
    private final CacheInvoker invoker = EasyMock.createStrictMock(CacheInvoker.class);
@@ -73,6 +74,7 @@
       factory.setCacheInvoker(this.invoker);
       factory.setAtomicMapFactory(this.atomicMapFactory);
       factory.setCacheSource(this.source);
+      factory.setLockManagerSource(this.lmsource);
       
       ReplicationConfig config = new ReplicationConfig();
       ReplicationGranularity granularity = ReplicationGranularity.SESSION;

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerTest.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerTest.java	2010-08-25 15:12:24 UTC (rev 107777)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/web/tomcat/service/session/distributedcache/ispn/DistributedCacheManagerTest.java	2010-08-25 15:14:12 UTC (rev 107778)
@@ -35,6 +35,7 @@
 import org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent;
 import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
 import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
+import org.jboss.ha.framework.server.lock.SharedLocalYieldingClusterLockManager;
 import org.jboss.ha.ispn.atomic.AtomicMapFactory;
 import org.jboss.ha.ispn.invoker.CacheInvoker;
 import org.jboss.web.tomcat.service.session.distributedcache.spi.BatchingManager;
@@ -59,6 +60,7 @@
    private final SessionAttributeStorage<OutgoingDistributableSessionData> storage = EasyMock.createStrictMock(SessionAttributeStorage.class);
    @SuppressWarnings("unchecked")
    private final AdvancedCache<String, AtomicMap<Object, Object>> cache = EasyMock.createStrictMock(AdvancedCache.class);
+   private final SharedLocalYieldingClusterLockManager lockManager = EasyMock.createStrictMock(SharedLocalYieldingClusterLockManager.class);
    private final BatchingManager batchingManager = EasyMock.createStrictMock(BatchingManager.class);
    private final CacheInvoker invoker = EasyMock.createStrictMock(CacheInvoker.class);
    private final AtomicMapFactory atomicMapFactory = EasyMock.createStrictMock(AtomicMapFactory.class);
@@ -73,7 +75,7 @@
       
       EasyMock.replay(this.sessionManager, this.storage, this.cache, this.batchingManager, this.invoker, this.atomicMapFactory);
       
-      this.manager = new DistributedCacheManager<OutgoingDistributableSessionData>(this.sessionManager, this.cache, this.storage, this.batchingManager, this.invoker, this.atomicMapFactory);
+      this.manager = new DistributedCacheManager<OutgoingDistributableSessionData>(this.sessionManager, lockManager, this.cache, this.storage, this.batchingManager, this.invoker, this.atomicMapFactory);
       
       EasyMock.verify(this.sessionManager, this.storage, this.cache, this.batchingManager, this.invoker, this.atomicMapFactory);
       this.reset();
@@ -571,9 +573,7 @@
       
       EasyMock.verify(this.sessionManager, this.storage, this.cache, this.batchingManager, this.invoker, this.atomicMapFactory);
       
-// TODO when session ownership support is added, replace these assertions
-      Assert.assertNull(support);
-//      Assert.assertSame(manager, support);
+      Assert.assertSame(manager, support);
    }
    
    @Test



More information about the jboss-cvs-commits mailing list