org.openrdf.server.metadata.cache
Class CacheIndex

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,WeakReference<CachedRequest>>
              extended by org.openrdf.server.metadata.cache.CacheIndex
All Implemented Interfaces:
Serializable, Cloneable, Map<String,WeakReference<CachedRequest>>

public class CacheIndex
extends LinkedHashMap<String,WeakReference<CachedRequest>>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
CacheIndex(File dir, int maxCapacity)
           
 
Method Summary
 CachedRequest findCachedRequest(String url)
           
 int getMaxCapacity()
           
 void invalidate(String... locations)
           
protected  boolean removeEldestEntry(Map.Entry<String,WeakReference<CachedRequest>> eldest)
           
 void setMaxCapacity(int maxCapacity)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

CacheIndex

public CacheIndex(File dir,
                  int maxCapacity)
Method Detail

getMaxCapacity

public int getMaxCapacity()

setMaxCapacity

public void setMaxCapacity(int maxCapacity)

invalidate

public void invalidate(String... locations)
                throws IOException,
                       InterruptedException
Throws:
IOException
InterruptedException

findCachedRequest

public CachedRequest findCachedRequest(String url)
                                throws IOException
Throws:
IOException

removeEldestEntry

protected boolean removeEldestEntry(Map.Entry<String,WeakReference<CachedRequest>> eldest)
Overrides:
removeEldestEntry in class LinkedHashMap<String,WeakReference<CachedRequest>>


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.