portal.xml.sax
Class PortalSAXEntityCache

java.lang.Object
  extended byjava.util.AbstractMap
      extended byorg.apache.commons.collections.map.AbstractHashedMap
          extended byorg.apache.commons.collections.map.AbstractLinkedMap
              extended byorg.apache.commons.collections.map.LRUMap
                  extended byportal.xml.sax.PortalSAXEntityCache
All Implemented Interfaces:
org.apache.commons.collections.BoundedMap, java.lang.Cloneable, org.apache.commons.collections.IterableMap, java.util.Map, org.apache.commons.collections.OrderedMap, java.io.Serializable

public class PortalSAXEntityCache
extends org.apache.commons.collections.map.LRUMap

Caches resolved entities such as XML schema or DTD documents.

Version:
$Revision: 1.2 $
Author:
Thomas Weckert
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Method Summary
 void addEntity(java.lang.String key, byte[] content)
          Adds the content of a resolved entity.
 java.lang.String getCacheKey(java.lang.String publicId, java.lang.String systemId)
          Creates a cache key for a specified public ID and system ID.
 byte[] getEntity(java.lang.String key)
          Returns the byte content of a resolved entity.
static PortalSAXEntityCache getSharedInstance()
           
 
Methods inherited from class org.apache.commons.collections.map.LRUMap
clone, get, isFull, isScanUntilRemovable, maxSize
 
Methods inherited from class org.apache.commons.collections.map.AbstractLinkedMap
clear, containsValue, firstKey, lastKey, mapIterator, nextKey, orderedMapIterator, previousKey
 
Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getSharedInstance

public static PortalSAXEntityCache getSharedInstance()

addEntity

public void addEntity(java.lang.String key,
                      byte[] content)
Adds the content of a resolved entity.

Parameters:
key - the key of the entity
content - the byte content of the entity

getEntity

public byte[] getEntity(java.lang.String key)
Returns the byte content of a resolved entity.

Parameters:
key - the key of the entity
Returns:
the byte content of a resolved entity

getCacheKey

public java.lang.String getCacheKey(java.lang.String publicId,
                                    java.lang.String systemId)
Creates a cache key for a specified public ID and system ID.

Parameters:
publicId - the public ID of the parsed XML file
systemId - the system ID of the parsed XML file
Returns:
a new cache key