Commits

Anonymous committed d32409e

Submitter: Andres March

refactoring. DOES NOT COMPILE

Comments (0)

Files changed (5)

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

  */
 package com.opensymphony.oscache.base;
 
-import com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache;
-import com.opensymphony.oscache.base.events.*;
-import com.opensymphony.oscache.base.persistence.PersistenceListener;
-import com.opensymphony.oscache.util.StringUtil;
+import java.util.List;
+import java.util.Properties;
+
+import javax.swing.event.EventListenerList;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.*;
-
-import javax.swing.event.EventListenerList;
+import com.opensymphony.oscache.base.events.CacheEntryEventListener;
+import com.opensymphony.oscache.base.events.CacheEventListener;
+import com.opensymphony.oscache.base.events.CacheMapAccessEventListener;
+import com.opensymphony.oscache.base.persistence.PersistenceListener;
+import com.opensymphony.oscache.util.StringUtil;
 
 /**
  * An AbstractCacheAdministrator defines an abstract cache administrator, implementing all

src/core/java/com/opensymphony/oscache/base/algorithm/FIFOCache.java

  */
 package com.opensymphony.oscache.base.algorithm;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.opensymphony.oscache.base.CacheImpl;
 
 /**
  * FIFO (First In First Out) based queue algorithm for the cache.
  * @author        <a href="mailto:abergevin@pyxis-tech.com">Alain Bergevin</a>
  * @author        <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
  */
-public class FIFOCache extends AbstractConcurrentReadCache {
+public class FIFOCache extends CacheImpl {
     /**
      * A queue containing all cache keys
      */
      * @param capacity The maximum cache capacity.
      */
     public FIFOCache(int capacity) {
-        this();
-        maxEntries = capacity;
+        super(capacity);
     }
 
     /**

src/core/java/com/opensymphony/oscache/base/algorithm/UnlimitedCache.java

  */
 package com.opensymphony.oscache.base.algorithm;
 
+import com.opensymphony.oscache.base.CacheImpl;
+
 
 /**
  * A simple unlimited cache that has no upper bound to the number of
  * @author <a href="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
  * @author <a href="mailto:abergevin@pyxis-tech.com">Alain Bergevin</a>
  */
-public final class UnlimitedCache extends AbstractConcurrentReadCache {
+public final class UnlimitedCache extends CacheImpl {
     /**
      * Creates an unlimited cache by calling the super class's constructor
      * with an <code>UNLIMITED</code> maximum number of entries.
      */
     public UnlimitedCache() {
-        super();
-        maxEntries = UNLIMITED;
+        super(-1);
     }
 
     /**

src/core/java/com/opensymphony/oscache/general/GeneralCacheAdministrator.java

  */
 package com.opensymphony.oscache.general;
 
-import com.opensymphony.oscache.base.*;
+import java.util.Date;
+import java.util.Properties;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.Date;
-import java.util.Properties;
+import com.opensymphony.oscache.base.AbstractCacheAdministrator;
+import com.opensymphony.oscache.base.Cache;
+import com.opensymphony.oscache.base.CacheEntry;
+import com.opensymphony.oscache.base.CacheImpl;
+import com.opensymphony.oscache.base.EntryRefreshPolicy;
 
 /**
  * A GeneralCacheAdministrator creates, flushes and administers the cache.
     private void createCache() {
         log.info("Creating new cache");
 
-        applicationCache = new CacheImpl(isMemoryCaching(), isUnlimitedDiskCache(), isOverflowPersistence(), isBlocking(), algorithmClass, cacheCapacity);
+        applicationCache = new CacheImpl(isMemoryCaching(), isUnlimitedDiskCache(), isOverflowPersistence(), isBlocking(), cacheCapacity);
 
         configureStandardListeners(applicationCache);
     }

src/core/java/com/opensymphony/oscache/web/ServletCache.java

  */
 package com.opensymphony.oscache.web;
 
-import com.opensymphony.oscache.base.Cache;
-import com.opensymphony.oscache.base.CacheEntry;
-import com.opensymphony.oscache.base.CacheImpl;
+import java.io.Serializable;
+
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.io.Serializable;
-
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.servlet.jsp.PageContext;
+import com.opensymphony.oscache.base.Cache;
+import com.opensymphony.oscache.base.CacheEntry;
+import com.opensymphony.oscache.base.CacheImpl;
 
 /**
  * A simple extension of Cache that implements a session binding listener,
  * @param scope The cache scope
  */
     public ServletCache(ServletCacheAdministrator admin, String algorithmClass, int limit, int scope) {
-        super(admin.isMemoryCaching(), admin.isUnlimitedDiskCache(), admin.isOverflowPersistence(), admin.isBlocking(), algorithmClass, limit);
+        super(admin.isMemoryCaching(), admin.isUnlimitedDiskCache(), admin.isOverflowPersistence(), admin.isBlocking(), limit);
         setScope(scope);
         this.admin = admin;
     }