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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 29 13:53:11 EDT 2010


Author: pferraro
Date: 2010-07-29 13:53:10 -0400 (Thu, 29 Jul 2010)
New Revision: 107214

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerImpl.java
   projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java
Log:
Use narrowed CacheInvoker.Operation subinterface, now that keys and values are generic.

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerImpl.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerImpl.java	2010-07-29 17:45:36 UTC (rev 107213)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerImpl.java	2010-07-29 17:53:10 UTC (rev 107214)
@@ -211,7 +211,7 @@
       
       this.attributeStorage.store(data, sessionData);
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = new CacheInvoker.Operation<AtomicMap<Object, Object>>()
+      Operation<AtomicMap<Object, Object>> operation = new Operation<AtomicMap<Object, Object>>()
       {
          @Override
          public AtomicMap<Object, Object> invoke(Cache<String, AtomicMap<Object, Object>> cache)
@@ -245,7 +245,7 @@
    
    private IncomingDistributableSessionData getData(final String sessionId, boolean includeAttributes)
    {
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = new CacheInvoker.Operation<AtomicMap<Object, Object>>()
+      Operation<AtomicMap<Object, Object>> operation = new Operation<AtomicMap<Object, Object>>()
       {
          @Override
          public AtomicMap<Object, Object> invoke(Cache<String, AtomicMap<Object, Object>> cache)
@@ -315,7 +315,7 @@
 
    private void removeSession(final String sessionId, final boolean local)
    {
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = new CacheInvoker.Operation<AtomicMap<Object, Object>>()
+      Operation<AtomicMap<Object, Object>> operation = new Operation<AtomicMap<Object, Object>>()
       {
          @Override
          public AtomicMap<Object, Object> invoke(Cache<String, AtomicMap<Object, Object>> cache)
@@ -352,7 +352,7 @@
    @Override
    public void evictSession(final String sessionId)
    {
-      CacheInvoker.Operation<Void> operation = new CacheInvoker.Operation<Void>()
+      Operation<Void> operation = new Operation<Void>()
       {
          @Override
          public Void invoke(Cache<String, AtomicMap<Object, Object>> cache)
@@ -482,4 +482,9 @@
          this.manager.sessionActivated();
       }
    }
+   
+   // Simplified CacheInvoker.Operation using assigned key/value types
+   static interface Operation<R> extends CacheInvoker.Operation<String, AtomicMap<Object, Object>, R>
+   {      
+   }
 }

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java	2010-07-29 17:45:36 UTC (rev 107213)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java	2010-07-29 17:53:10 UTC (rev 107214)
@@ -180,7 +180,7 @@
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       Capture<AtomicMap<Object, Object>> capturedMap = new Capture<AtomicMap<Object, Object>>();
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
       
       String sessionId = "abc";
       int version = 10;
@@ -212,7 +212,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, data);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> oldMap = EasyMock.createMock(AtomicMap.class);
       
@@ -244,7 +244,7 @@
       AtomicMap<Object, Object> map = EasyMock.createNiceMock(AtomicMap.class);
       Map<String, Object> attributes = Collections.emptyMap();
       
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
 
       Integer version = Integer.valueOf(10);
       Long timestamp = Long.valueOf(System.currentTimeMillis());
@@ -299,7 +299,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, map);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> expectedMap = EasyMock.createMock(AtomicMap.class);
       
@@ -326,7 +326,7 @@
    
    private void getMissingSessionDataNoOwner(boolean includeAttributes)
    {
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -343,7 +343,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> expectedMap = EasyMock.createMock(AtomicMap.class);
       
@@ -388,7 +388,7 @@
    {
       String sessionId = "abc";
       
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -402,7 +402,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> expectedMap = EasyMock.createMock(AtomicMap.class);
       
@@ -424,7 +424,7 @@
    {
       String sessionId = "abc";
       
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -438,7 +438,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> expectedMap = EasyMock.createMock(AtomicMap.class);
       
@@ -462,7 +462,7 @@
    {
       String sessionId = "abc";
       
-      Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<CacheInvoker.Operation<AtomicMap<Object, Object>>>();
+      Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -476,7 +476,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
       @SuppressWarnings("unchecked")
       AtomicMap<Object, Object> expectedMap = EasyMock.createMock(AtomicMap.class);
       
@@ -513,7 +513,7 @@
    {
       String sessionId = "abc";
       
-      Capture<CacheInvoker.Operation<Void>> capturedOperation = new Capture<CacheInvoker.Operation<Void>>();
+      Capture<DistributedCacheManagerImpl.Operation<Void>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<Void>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -527,7 +527,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<Void> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<Void> operation = capturedOperation.getValue();
       
       this.cache.evict(sessionId);
       
@@ -547,7 +547,7 @@
    {
       String sessionId = "abc";
       
-      Capture<CacheInvoker.Operation<Void>> capturedOperation = new Capture<CacheInvoker.Operation<Void>>();
+      Capture<DistributedCacheManagerImpl.Operation<Void>> capturedOperation = new Capture<DistributedCacheManagerImpl.Operation<Void>>();
       
       DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
       
@@ -561,7 +561,7 @@
       EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
       
       
-      CacheInvoker.Operation<Void> operation = capturedOperation.getValue();
+      DistributedCacheManagerImpl.Operation<Void> operation = capturedOperation.getValue();
       
       this.cache.evict(sessionId);
       



More information about the jboss-cvs-commits mailing list