Commits

Anonymous committed 78a7287

CACHE-314 Avoid Duplicate Listeners

  • Participants
  • Parent commits 047ae6f

Comments (0)

Files changed (4)

     <info organisation="opensymphony" module="oscache"
           revision="2.4.2"
           status="integration"
-          publication="20080405310000">
+          publication="20081109120000">
         <license name="Apache" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
         <ivyauthor name="opensymphony" url="http://www.opensymphony.com/"/>
 

File src/java/com/opensymphony/oscache/base/AbstractCacheAdministrator.java

                     }
                 }
 
-                if (listeners[i] instanceof CacheEntryEventListener) {
-                    cache.addCacheEventListener(listeners[i]);
-                } else if (listeners[i] instanceof CacheMapAccessEventListener) {
+                if (listeners[i] instanceof CacheEventListener) {
                     cache.addCacheEventListener(listeners[i]);
                 }
             }

File src/java/com/opensymphony/oscache/base/Cache.java

                             } while (updateState.isUpdating());
                             
                             if (updateState.isCancelled()) {
-                                // The updating thread cancelled the update, let this one have a go. 
+                                // The updating thread canceled the update, let this one have a go. 
                                 // This increments the usage count for this EntryUpdateState instance
                                 updateState.startUpdate();
                                 

File src/java/com/opensymphony/oscache/web/ServletCacheAdministrator.java

 package com.opensymphony.oscache.web;
 
 import com.opensymphony.oscache.base.*;
-import com.opensymphony.oscache.base.events.CacheEventListener;
 import com.opensymphony.oscache.base.events.ScopeEvent;
 import com.opensymphony.oscache.base.events.ScopeEventListener;
 import com.opensymphony.oscache.base.events.ScopeEventType;
 
         newCache = (ServletCache) configureStandardListeners(newCache);
 
-        if (config.getProperty(CACHE_ENTRY_EVENT_LISTENERS_KEY) != null) {
-            // Add any event listeners that have been specified in the configuration
-            CacheEventListener[] listeners = getCacheEventListeners();
-
-            for (int i = 0; i < listeners.length; i++) {
-                if (listeners[i] instanceof ScopeEventListener) {
-                    newCache.addCacheEventListener(listeners[i]);
-                }
-            }
-        }
-
         return newCache;
     }