Commits

Anonymous committed 10f7426

Submitter: Andres March

added basic group support back in

  • Participants
  • Parent commits 95563b1
  • Branches amarch_sandbox

Comments (0)

Files changed (9)

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

  */
 package com.opensymphony.oscache.core;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.logging.Log;
 import com.opensymphony.oscache.events.CacheEntryEventListener;
 import com.opensymphony.oscache.events.CacheListener;
 import com.opensymphony.oscache.events.CacheMapAccessEventListener;
-import com.opensymphony.oscache.events.CacheMapAccessEventType;
 import com.opensymphony.oscache.util.StringUtil;
 
 /**
 	 */
 	protected int cacheCapacity = -1;
 
-	private List regions;
+	private Map regions;
 
 	/**
 	 * Create the AbstractCacheAdministrator. This will initialize all values
 	}
 
 	public Object get(String regionName, Object key) {
-		return getCache().get(key);
+		return getCache(regionName).get(key);
+	}
+
+	private Cache getCache(String regionName) {
+		
+		return (Cache) regions.get(regionName);
 	}
 
 	public Object get(String regionName, Object key, int refreshPeriod) {
-		return getCache().get(key, refreshPeriod);
+		return getCache(regionName).get(key, refreshPeriod);
 	}
 
 	public Object get(String regionName, Object key, int refreshPeriod,
 			String cronExpiry) {
 
-		Object value = getCache().get(key, refreshPeriod, cronExpiry);
+		Object value = getCache(regionName).get(key, refreshPeriod, cronExpiry);
 
 		return value;
 	}
 
-	protected void put(Object key, Object value) {
-		getCache().put(key, value);
+	protected void put(String regionName, Object key, Object value) {
+		getCache(regionName).put(key, value);
 
 	}
 
 	 * Retrieves an array containing instances all of the {@link CacheListener}
 	 * classes that are specified in the OSCache configuration file.
 	 */
-	protected CacheListener[] initCacheListeners() {
-		CacheListener[] listeners = null;
+	protected void initCacheListeners() {		
 
 		List classes = StringUtil.split(
 				config.getProperty(CACHE_LISTENERS_KEY), ',');
-		listeners = new CacheListener[classes.size()];
+		listeners = new ArrayList();
 
 		for (int i = 0; i < classes.size(); i++) {
 			String className = (String) classes.get(i);
 									+ className
 									+ "' does not implement CacheListener. Ignoring this listener.");
 				} else {
-					listeners[i] = (CacheListener) clazz.newInstance();
+					listeners.add(clazz.newInstance());
 				}
 			} catch (ClassNotFoundException e) {
 				log.error("CacheListener class '" + className
 								e);
 			}
 		}
-
-		return listeners;
 	}
 
 	/**
 			// Grab all the specified listeners and add them to the cache's
 			// listener list. Note that listeners that implement more than
 			// one of the event interfaces will be added multiple times.
-			CacheListener[] listeners = initCacheListeners();
+			initCacheListeners();
 
-			for (int i = 0; i < listeners.length; i++) {
+			for (int i = 0; i < listeners.size(); i++) {
 				// Pass through the configuration to those listeners that
 				// require it
-				if (listeners[i] instanceof LifecycleAware) {
+				if (listeners.get(i) instanceof LifecycleAware) {
 					try {
-						((LifecycleAware) listeners[i]).initialize(cache,
+						((LifecycleAware) listeners.get(i)).initialize(cache,
 								config);
 					} catch (InitializationException e) {
 						log.error("Could not initialize listener '"
-								+ listeners[i].getClass().getName()
+								+ listeners.get(i).getClass().getName()
 								+ "'. Listener ignored.", e);
 
 						continue;
 					}
 				}
-				cache.addCacheListener(listeners[i]);
+				cache.addCacheListener((CacheListener) listeners.get(i));
 
 			}
 		}
 			return;
 		}
 
-		Object[] listeners = initCacheListeners();
-
-		for (int i = listeners.length - 2; i >= 0; i -= 2) {
-			if (listeners[i + 1] instanceof LifecycleAware) {
-				try {
-					((LifecycleAware) listeners[i + 1]).finialize();
-				} catch (FinalizationException e) {
-					log.error("Listener could not be finalized", e);
-				}
-			}
-		}
+		
 	}
 
 	/**
 	 * Grabs a cache
 	 * 
 	 * @return The cache
+	 * @throws IllegalAccessException 
 	 */
-	public Cache getCache() {
-		return (Cache) regions.get(0);
+	public Cache getCache() throws IllegalAccessException {
+		if (regions.size() != 1) throw new IllegalAccessException("More than 1 region configured.  Please use getCache(String regionName)");
+		return (Cache) regions.get("DEFAULT_REGION");
 	}
 }

File src/core/java/com/opensymphony/oscache/core/BaseCache.java

 
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
-import com.opensymphony.oscache.algorithm.UnlimitedEvictionAlgorithm;
 import com.opensymphony.oscache.events.CacheEntryEvent;
 import com.opensymphony.oscache.events.CacheEvent;
+import com.opensymphony.oscache.events.CacheGroupEvent;
 import com.opensymphony.oscache.events.CacheListener;
+import com.opensymphony.oscache.events.CachewideEvent;
 import com.opensymphony.oscache.util.FastCronParser;
 
 /**
  */
 public abstract class BaseCache implements Cache {
 
-	private EvictionAlgorithm policy;
+	private EvictionAlgorithm algorithm;
 
 	private String name;
 
 	private List listeners;
 
 	/**
-	 * Initialises the base cache. Valid properties are:
-	 * <ul>
-	 * <li>{@link #MIN_THREADS_PARAM} - the minimun number of threads to pool</li>
-	 * <li>{@link #MAX_THREADS_PARAM} - the maximum number of threads to pool</li>
-	 * </ul>
-	 * 
-	 * @param props
-	 *            any configuration parameters that the cache requires.
-	 * @param policy
-	 *            the eviction policy for the cache to use. If <code>null</code>
-	 *            is specified, the cache will default to using the
-	 *            {@link UnlimitedEvictionAlgorithm}.
+	 * Date of last complete cache flush.
 	 */
-	public void init(Properties props, EvictionAlgorithm policy) {
-		if (policy == null)
-			this.policy = new UnlimitedEvictionAlgorithm();
-		else {
-			this.policy = policy;
-		}
+	private Date flushDateTime = null;
 
-		init(props);
-	}
-
-	/**
-	 * Passes though the configuration parameters to a concrete implentation so
-	 * it can perform any additional configuration that might be necessary.
-	 * 
-	 * @param props
-	 *            the cache configuration parameters.
-	 */
-	protected abstract void init(Properties props);
+	private Map groupMap;
 
 	/**
 	 * Clears the entire cache. This will result in a
 	 *         be found and could not be loaded.
 	 */
 	public synchronized Object get(Object key) {
+		return get(key, 0);
+	}
+
+	/**
+	 * Retrieves an object from the cache.
+	 * 
+	 * @param key
+	 *            the key of the object to retrieve.
+	 * @return the cached object, or <code>null</code> if the object could not
+	 *         be found and could not be loaded.
+	 */
+	public synchronized Object get(Object key, int refreshPeriod) {
 		return get(key, 0, null);
 	}
-
+	
 	/**
 	 * Retrieves an object from the cache.
 	 * 
 				remove(key);
 				content = null;
 			} else {
-				policy.get(key, cacheEntry);
+				algorithm.get(key, cacheEntry);
 
 			}
 		}
 	public synchronized Object remove(Object key) {
 		CacheEntry result = removeInternal(key);
 		if (result != null) {
-			policy.remove(key, result);
+			algorithm.remove(key, result);
 			fireEvent(result, CacheEvent.REMOVE);
 		}
 		return result;
 	public synchronized Object put(Object key, Object value) {
 		CacheEntry newEntry = new CacheEntry(key, value);
 		CacheEntry oldEntry = putInternal(newEntry);
-		policy.put(key, newEntry);
+		algorithm.put(key, newEntry);
 
-		// Remove an entry from the cache if the eviction policy says we need to
-		Object evictionKey = policy.evict();
+		// Remove an entry from the cache if the eviction algorithm says we need to
+		Object evictionKey = algorithm.evict();
 		if (evictionKey != null) {
-			removeInternal(evictionKey);
+			remove(evictionKey);
+		}		
+
+		addGroupMappings(newEntry);
+
+		// fire off a notification message
+		if (oldEntry == null) {
+			fireEvent(newEntry, CacheEvent.ADD);
+		} else {
+			fireEvent(newEntry, CacheEvent.UPDATE);
 		}
 
-	    // fire off a notification message
-	    if (oldEntry == null)
-	    {
-	      fireEvent(newEntry, CacheEvent.ADD);
-	    } else {
-	      fireEvent(newEntry, CacheEvent.UPDATE);
-	    }
-
-	    return  newEntry.getValue();
+		return oldEntry.getValue();
 	}
 
+
 	/**
-	 * Get an entry from this cache or create one if it doesn't exist.
+	 * Get an entry from this cache.
 	 * 
 	 * @param key
 	 *            The key of the cache entry
 	 * @return CacheEntry for the specified key.
 	 */
 	public synchronized CacheEntry getEntry(Object key) {
-		return getEntry(key, null, null);
-	}
-
-	/**
-	 * Get an entry from this cache or create one if it doesn't exist.
-	 * 
-	 * @param key
-	 *            The key of the cache entry
-	 * @param policy
-	 *            Object that implements refresh policy logic
-	 * @param origin
-	 *            The origin of request (optional)
-	 * @return CacheEntry for the specified key.
-	 */
-	public synchronized CacheEntry getEntry(Object key,
-			EntryRefreshPolicy policy, String origin) {
 		CacheEntry cacheEntry = getInternal(key);
 
 		return cacheEntry;
 		synchronized (LISTENER_LOCK) {
 			if (listeners != null)
 				return listeners.remove(listener);
-			else
-				return false;
+			return false;
 		}
 	}
+	
+	/**
+     * Flushes all unexpired objects that belong to the supplied group. On
+     * completion this method fires a <tt>CacheEntryEvent.GROUP_FLUSHED</tt>
+     * event.
+     *
+     * @param group The group to flush
+     */
+    public void removeGroup(String group) {
+        // Flush all objects in the group
+        Set groupEntries = (Set) groupMap.get(group);
+
+        if (groupEntries != null) {
+            Iterator itr = groupEntries.iterator();
+            Object key;
+            CacheEntry entry;
+
+            while (itr.hasNext()) {
+            		key = itr.next();
+                entry = getEntry(key);
+
+                if ((entry != null) && !entry.needsRefresh(CacheEntry.INDEFINITE_EXPIRY)) {
+                    remove(key);
+                }
+            }
+        }
+        fireEvent(new CacheGroupEvent(this, group));
+        
+    }
 
 	/**
 	 * Indicates whether or not the cache entry is stale.
 	 */
 	protected boolean isStale(CacheEntry cacheEntry, int refreshPeriod,
 			String cronExpiry) {
-		boolean result = cacheEntry.needsRefresh(refreshPeriod);
+		boolean result = cacheEntry.needsRefresh(refreshPeriod)
+				|| isFlushed(cacheEntry);
 
 		if ((cronExpiry != null) && (cronExpiry.length() > 0)) {
 			try {
 
 		return result;
 	}
-	
-	 /**
-	   * Fires a cache event.
-	   *
-	   * @param key       the key of the object that the event relates to.
-	   * @param value     the object that the event relates to.
-	   * @param eventType the type of event that occurred. See {@link CacheEvent}
-	   *                  for the possible event types.
-	   */
-	  protected void fireEvent(CacheEntry entry, int eventType)
-	  {
-	    synchronized (LISTENER_LOCK)
-	    {
-	      if (listeners != null)
-	      {
-	    	  CacheEntryEvent event = new CacheEntryEvent(this, entry, eventType);
-	        int i = 0;
-	        for (int size = listeners.size(); i < size; i++)
-	        {
-	          CacheListener listener = (CacheListener) listeners.get(i);
-	          listener.onChange(event);
-	        }
-	      }
-	    }
-	  }
 
+	/**
+	 * Checks if the cache was flushed more recently than the CacheEntry
+	 * provided. Used to determine whether to refresh the particular CacheEntry.
+	 * 
+	 * @param cacheEntry
+	 *            The cache entry which we're seeing whether to refresh
+	 * @return Whether or not the cache has been flushed more recently than this
+	 *         cache entry was updated.
+	 */
+	public boolean isFlushed(CacheEntry cacheEntry) {
+		if (flushDateTime != null) {
+			long lastUpdate = cacheEntry.getLastUpdate();
+
+			return (flushDateTime.getTime() >= lastUpdate);
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * Fires a cache event.
+	 * 
+	 * @param key
+	 *            the key of the object that the event relates to.
+	 * @param value
+	 *            the object that the event relates to.
+	 * @param eventType
+	 *            the type of event that occurred. See {@link CacheEvent} for
+	 *            the possible event types.
+	 */
+	protected void fireEvent(CacheEntry entry, int eventType) {
+		CacheEntryEvent event = new CacheEntryEvent(this, entry, eventType);
+		fireEvent(event);
+	}
+
+	/**
+	 * Fires a cache event.
+	 * 
+	 * @param key
+	 *            the key of the object that the event relates to.
+	 * @param value
+	 *            the object that the event relates to.
+	 * @param eventType
+	 *            the type of event that occurred. See {@link CacheEvent} for
+	 *            the possible event types.
+	 */
+	protected void fireEvent(CacheEvent event) {
+		synchronized (LISTENER_LOCK) {
+			if (listeners != null) {
+				int i = 0;
+				for (int size = listeners.size(); i < size; i++) {
+					CacheListener listener = (CacheListener) listeners.get(i);
+					listener.onChange(event);
+				}
+			}
+		}
+	}
 
 	/**
 	 * Retrieves the name of this cache instance.
 	 */
 	protected abstract void clearInternal();
 
+	public void flushAll(Date date) {
+		flushDateTime = date;
+		fireEvent(new CachewideEvent(this, date));
+	}
+
+	/**
+	 * Add this entry's key to the groups specified by the entry's groups. 
+	 * 
+	 */
+	protected void addGroupMappings(CacheEntry entry) {
+		// Add this CacheEntry to the groups that it is now a member of
+		for (Iterator it = entry.getGroups().iterator(); it.hasNext();) {
+			String groupName = (String) it.next();
+	
+			if (groupMap == null) {
+				groupMap = new HashMap();
+			}
+	
+			Set group = (Set) groupMap.get(groupName);
+	
+			if (group == null) {
+				group = new HashSet();
+				groupMap.put(groupName, group);
+			}
+	
+			group.add(entry.getKey());
+		}
+	}
+
 }

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

 	 */
 	public abstract void setCapacity(int capacity);
 
+	
+	/**
+	 * Retrieves an object from the cache.
+	 * 
+	 * @param key
+	 *            the key of the object to retrieve.
+	 * @return the cached object, or <code>null</code> if the object could not
+	 *         be found and could not be loaded.
+	 */
+	public abstract Object get(Object key, int refreshPeriod,
+			String cronExpiry);
+	
+	/**
+	 * Retrieves an object from the cache.
+	 * 
+	 * @param key
+	 *            the key of the object to retrieve.
+	 * @return the cached object, or <code>null</code> if the object could not
+	 *         be found and could not be loaded.
+	 */
+	public abstract Object get(Object key, int refreshPeriod);
+	
 	/**
 	 * Retrieve an object from the cache specifying its key.
 	 * 
 	 */
 	public abstract void flushAll(Date date);
 
-	/**
-	 * Flush all entries in the cache on the given date/time.
-	 * 
-	 * @param date
-	 *            The date at which all cache entries will be flushed.
-	 * @param origin
-	 *            The origin of this flush request (optional)
-	 */
-	public abstract void flushAll(Date date, String origin);
-
 
 	/**
 	 * Completely clears the cache.

File src/core/java/com/opensymphony/oscache/core/CacheEntry.java

 import java.io.IOException;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * A CacheEntry instance represents one entry in the cache. It holds the object that
  * The time this emtry was last updated.
  */
     private long lastUpdate = NOT_YET;
+    
+    /**
+     * The set of cache groups that this cache entry belongs to, if any.
+     */
+    private Set groups = null;
 
     
 
         state = STATE_VALID;
     }
 
+	/**
+	 * @return Returns the content.
+	 */
+	public Object getContent() {
+		return content;
+	}
+
+	/**
+	 * @param content The content to set.
+	 */
+	public void setContent(Object content) {
+		this.content = content;
+	}
+
+	/**
+	 * @return Returns the groups.
+	 */
+	public Set getGroups() {
+		if (groups == null) groups = new HashSet();
+		return groups;
+	}
+
+	/**
+	 * @param groups The groups to set.
+	 */
+	public void setGroups(Set groups) {
+		this.groups = groups;
+	}
+
+	/**
+	 * @return Returns the policy.
+	 */
+	public EntryRefreshPolicy getPolicy() {
+		return policy;
+	}
+
+	/**
+	 * @param policy The policy to set.
+	 */
+	public void setPolicy(EntryRefreshPolicy policy) {
+		this.policy = policy;
+	}
+
 }

File src/core/java/com/opensymphony/oscache/core/MemoryCache.java

 package com.opensymphony.oscache.core;
 
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-
 /**
  * Provides an interface to the cache itself. Creating an instance of this class
  * will create a cache that behaves according to its construction parameters.
 			.getLog(MemoryCache.class);
 
 	/**
-	 * Date of last complete cache flush.
-	 */
-	private Date flushDateTime = null;
-
-	/**
 	 * The actual cache map. This is where the cached objects are held.
 	 */
 	private Map store = new HashMap();
-	
-	private int capacity; 
+
+	private int capacity;
 
 	/**
 	 * 
 
 		// TODO Auto-generated constructor stub
 	}
-	
+
 	/**
 	 * 
 	 */
 
 		this.capacity = capacity;
 	}
-	
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.opensymphony.oscache.core.CacheAPI#flushAll(java.util.Date)
-	 */
-	public void flushAll(Date date) {
-		flushAll(date, null);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.opensymphony.oscache.core.CacheAPI#flushAll(java.util.Date,
-	 *      java.lang.String)
-	 */
-	public void flushAll(Date date, String origin) {
-		flushDateTime = date;
-	}
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.opensymphony.oscache.core.CacheAPI#putInCache(java.lang.String,
-	 *      java.lang.Object)
-	 */
-	public CacheEntry put(Object key, CacheEntry cacheEntry) {
-		return put(key, cacheEntry, null);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.opensymphony.oscache.core.CacheAPI#putInCache(java.lang.String,
-	 *      java.lang.Object, com.opensymphony.oscache.core.EntryRefreshPolicy)
-	 */
-	public CacheEntry put(Object key, CacheEntry cacheEntry, EntryRefreshPolicy policy) {
-		return put(key, cacheEntry, null, null);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.opensymphony.oscache.core.CacheAPI#putInCache(java.lang.String,
-	 *      java.lang.Object, java.lang.String[],
-	 *      com.opensymphony.oscache.core.EntryRefreshPolicy, java.lang.String)
-	 */
-	public CacheEntry put(Object key, CacheEntry cacheEntry, EntryRefreshPolicy policy,
-			String origin) {
-		
-			return (CacheEntry) store.put(key, cacheEntry);
-	}
-
-	
-
-	
 
 	/**
 	 * Completely clears the cache.
 		store.clear();
 	}
 
-
 	/**
 	 * @return Returns the capacity.
 	 */
 	}
 
 	/**
-	 * @param capacity The capacity to set.
+	 * @param capacity
+	 *            The capacity to set.
 	 */
 	public void setCapacity(int capacity) {
 		this.capacity = capacity;
 	}
 
 	public synchronized int size() {
-		// TODO Auto-generated method stub
 		return store.size();
 	}
 
 		return store.entrySet();
 	}
 
-	/**
-	 * This method does nothing since there is nothing left to configure.
-	 */
-	protected void init(Properties props) {
-	}
-
-
 	public synchronized boolean isEmpty() {
 		return store.isEmpty();
 	}
 		return (CacheEntry) store.remove(key);
 	}
 
-
 }

File src/core/java/com/opensymphony/oscache/events/CacheGroupEvent.java

  * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
  */
 public final class CacheGroupEvent extends CacheEvent {
-    /**
-     * The cache where the entry resides.
-     */
-    private Cache map = null;
-
-    /**
+    
+    private static final int GROUP_FLUSHED = 0;
+	/**
      * The group that the event applies to.
      */
     private String group = null;
      * @param group   The cache group that the event applies to.
      */
     public CacheGroupEvent(Cache map, String group) {
-        this(map, group, null);
+        super(map, CacheGroupEvent.GROUP_FLUSHED);
+        this.group = group;
     }
 
-    /**
-     * Constructs a cache group event
-     *
-     * @param map     The cache map of the cache entry
-     * @param group   The cache group that the event applies to.
-     * @param origin  An optional tag that can be attached to the event to
-     * specify the event's origin. This is useful to prevent events from being
-     * fired recursively in some situations, such as when an event handler
-     * causes another event to be fired.
-     */
-    public CacheGroupEvent(Cache map, String group, String origin) {
-        super(origin);
-        this.map = map;
-        this.group = group;
-    }
 
     /**
      * Retrieve the cache group that the event applies to.
         return group;
     }
 
-    /**
-     * Retrieve the cache map where the group resides.
-     */
-    public Cache getMap() {
-        return map;
-    }
 
     public String toString() {
         return "groupName=" + group;

File src/core/java/com/opensymphony/oscache/events/CachewideEvent.java

  * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
  */
 public final class CachewideEvent extends CacheEvent {
-    /**
-     * The cache where the event occurred.
-     */
-    private Cache cache = null;
+    
 
     /**
      * The date/time for when the flush is scheduled
      */
     private Date date = null;
+    
+    /**
+     * Get an event type for a cache flush event.
+     */
+    public static int CACHE_FLUSHED = 2048;
 
     /**
      * Constructs a cachewide event with the specified origin.
      * @param cache   The cache map that the event occurred on.
      * @param date    The date/time that this cachewide event is scheduled for
      * (eg, the date that the cache is to be flushed).
-     * @param origin  An optional tag that can be attached to the event to
-     * specify the event's origin. This is useful to prevent events from being
-     * fired recursively in some situations, such as when an event handler
-     * causes another event to be fired.
      */
-    public CachewideEvent(Cache cache, Date date, String origin) {
-        super(origin);
+    public CachewideEvent(Cache cache, Date date) {
+       
+        super(cache, CACHE_FLUSHED);
         this.date = date;
-        this.cache = cache;
     }
-
-    /**
-     * Retrieve the cache map that the event occurred on.
-     */
-    public Cache getCache() {
-        return cache;
-    }
-
+    
     /**
      * Retrieve the date/time that the cache flush is scheduled for.
      */

File src/core/java/com/opensymphony/oscache/events/CachewideEventType.java

-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.oscache.events;
-
-
-/**
- * This is an enumeration holding all the events that can
- * occur at the cache-wide level.
- *
- * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
- */
-public class CachewideEventType {
-    /**
-     * Get an event type for a cache flush event.
-     */
-    public static CachewideEventType CACHE_FLUSHED = new CachewideEventType();
-
-    /**
-     * Private constructor to ensure that no object of this type are
-     * created externally.
-     */
-    private CachewideEventType() {
-    }
-}

File src/core/java/com/opensymphony/oscache/events/ScopeEvent.java

     public Date getDate() {
         return date;
     }
-
-    /**
-     * Retrieve the type of the event.
-     */
-    public ScopeEventType getEventType() {
-        return eventType;
-    }
-
+    
     /**
      * Retrieve the scope that applies to the event.
      */