org.mmbase.applications.media.cache
Class URLCache

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.mmbase.util.LRUHashtable
              extended byorg.mmbase.cache.Cache
                  extended byorg.mmbase.applications.media.cache.URLCache
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable, SizeMeasurable

public class URLCache
extends Cache

A cache for URLS requested in the MediaFragment builder. This cache can easily be extended in such a way it can cache more requests.

Author:
Rob Vermeulen (VPRO), Michiel Meeuwissen (NOS)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mmbase.util.LRUHashtable
LRUHashtable.LRUEntry, LRUHashtable.LRUEntrySet, LRUHashtable.LRUEntrySetIterator
 
Field Summary
 
Fields inherited from class org.mmbase.cache.Cache
maxEntrySize
 
Method Summary
static URLCache getCache()
           
 java.lang.String getDescription()
          Gives a description for this cache type.
 java.lang.String getName()
          Returns a name for this cache type.
 void nodeChange(java.lang.String nodeNumber)
          Invalidates cache entries based on the node that changes
 void put(java.lang.String key, java.lang.String result, java.util.Set objects)
          put an entry in the cache
static java.lang.String toKey(MMObjectNode mediaFragment, java.util.Map info)
          creates a key based of the media fragment number and the user information
 
Methods inherited from class org.mmbase.cache.Cache
get, getByteSize, getByteSize, getCache, getCaches, getDefaultMaxEntrySize, getMaxEntrySize, getTotalByteSize, isActive, main, put, putCache, putCache, setActive
 
Methods inherited from class org.mmbase.util.LRUHashtable
clear, clone, elements, entrySet, getCount, getHits, getMisses, getOrderedElements, getOrderedElements, getOrderedEntries, getOrderedEntries, getPuts, getRatio, getSize, getStats, keySet, remove, setSize, size, toString, toString, values
 
Methods inherited from class java.util.Hashtable
contains, containsKey, containsValue, equals, hashCode, isEmpty, keys, putAll, rehash
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getCache

public static URLCache getCache()

toKey

public static java.lang.String toKey(MMObjectNode mediaFragment,
                                     java.util.Map info)
creates a key based of the media fragment number and the user information

Parameters:
mediaFragment - fragment to be cached
info - user information to be cached
Returns:
key to be cached

put

public void put(java.lang.String key,
                java.lang.String result,
                java.util.Set objects)
put an entry in the cache

Parameters:
key - cache key
result - cache result
objects - the objects that can invalidate the cache

nodeChange

public void nodeChange(java.lang.String nodeNumber)
Invalidates cache entries based on the node that changes

Parameters:
nodeNumber - number of node that changes

getName

public java.lang.String getName()
Description copied from class: Cache
Returns a name for this cache type. Default it is the class name, but this normally will be overriden.

Overrides:
getName in class Cache

getDescription

public java.lang.String getDescription()
Description copied from class: Cache
Gives a description for this cache type. This can be used in cache overviews.

Overrides:
getDescription in class Cache


MMBase build 1.7.1.20041002