com.opensymphony.oscache.base.algorithm
public class: FIFOCache [javadoc |
source]
java.lang.Object
com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
com.opensymphony.oscache.base.algorithm.FIFOCache
FIFO (First In First Out) based queue algorithm for the cache.
No synchronization is required in this class since the
AbstractConcurrentReadCache already takes care of any
synchronization requirements.
- version:
$ - Revision: 427 $
- author:
< - a href="mailto:mike@atlassian.com">Mike Cannon-Brookes
- author:
< - a href="mailto:abergevin@pyxis-tech.com">Alain Bergevin
- author:
< - a href="mailto:chris@swebtec.com">Chris Miller
| Method from com.opensymphony.oscache.base.algorithm.FIFOCache Detail: |
protected void itemPut(Object key) {
if (!list.contains(key)) {
list.add(key);
}
}
An object was put in the cache. This implementation just adds
the key to the end of the list if it doesn't exist in the list
already. |
protected void itemRemoved(Object key) {
list.remove(key);
}
Remove specified key since that object has been removed from the cache. |
protected void itemRetrieved(Object key) {
}
An object was retrieved from the cache. This implementation
does noting since this event has no impact on the FIFO algorithm. |
protected Object removeItem() {
Iterator it = list.iterator();
Object toRemove = it.next();
it.remove();
return toRemove;
}
An item needs to be removed from the cache. The FIFO implementation
removes the first element in the list (ie, the item that has been in
the cache for the longest time). |