Home » openjdk-7 » java » net » [javadoc | source]
java.net
class: NegativeCache [javadoc | source]
java.lang.Object
   java.util.AbstractMap<K, V>
      java.util.HashMap<K, V>
         java.util.LinkedHashMap<K, V>
            java.net.NegativeCache

All Implemented Interfaces:
    Map, Cloneable, Serializable

This class is used to maintain the negative name lookup cache, which caches host names which could not be resolved, as a security feature.
Fields inherited from java.util.HashMap:
DEFAULT_INITIAL_CAPACITY,  MAXIMUM_CAPACITY,  DEFAULT_LOAD_FACTOR,  table,  size,  threshold,  loadFactor,  modCount
Fields inherited from java.util.AbstractMap:
keySet,  values
Constructor:
 NegativeCache(int initialCapacity,
    float loadFactor,
    boolean accessOrder) 
Method from java.net.NegativeCache Summary:
checkCacheExists,   getFailedMessage,   put,   removeEldestEntry
Methods from java.util.LinkedHashMap:
addEntry,   clear,   containsValue,   createEntry,   get,   init,   newEntryIterator,   newKeyIterator,   newValueIterator,   removeEldestEntry,   transfer
Methods from java.util.HashMap:
addEntry,   capacity,   clear,   clone,   containsKey,   containsValue,   createEntry,   entrySet,   get,   getEntry,   hash,   indexFor,   init,   isEmpty,   keySet,   loadFactor,   newEntryIterator,   newKeyIterator,   newValueIterator,   put,   putAll,   remove,   removeEntryForKey,   removeMapping,   resize,   size,   transfer,   values
Methods from java.util.AbstractMap:
clear,   clone,   containsKey,   containsValue,   entrySet,   equals,   get,   hashCode,   isEmpty,   keySet,   put,   putAll,   remove,   size,   toString,   values
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.NegativeCache Detail:
 static synchronized  void checkCacheExists() 
    This method checks if we have created the cache and if not creates it
 static synchronized String getFailedMessage(String hostName) 
    Returns the message of the negative cache if the entry has not yet expired.
 static synchronized  void put(String hostName,
    String failedMessage) 
    Adds the host name and the corresponding name lookup fail message to the cache.
 protected boolean removeEldestEntry(Entry<K, V> eldest) 
    Returns whether the eldest entry should be removed. It is removed if the size has grown beyond the maximum size allowed for the cache. A {@code LinkedHashMap} is created such that the least recently used entry is deleted.