org.apache.xalan.xsltc.dom
Class DocumentCache

java.lang.Object
  extended by org.apache.xalan.xsltc.dom.DocumentCache
All Implemented Interfaces:
DOMCache

public final class DocumentCache
extends java.lang.Object
implements DOMCache


Nested Class Summary
 class DocumentCache.CachedDocument
           
 
Field Summary
private  int _count
           
private  int _current
           
private  XSLTCDTMManager _dtmManager
           
private  javax.xml.parsers.SAXParser _parser
           
private  org.xml.sax.XMLReader _reader
           
private  java.util.Hashtable _references
           
private  int _size
           
private  java.lang.String[] _URIs
           
private static int REFRESH_INTERVAL
           
 
Constructor Summary
DocumentCache(int size)
          DocumentCache constructor
DocumentCache(int size, XSLTCDTMManager dtmManager)
          DocumentCache constructor
 
Method Summary
private  long getLastModified(java.lang.String uri)
          Returns the time-stamp for a document's last update
 void getStatistics(java.io.PrintWriter out)
          Outputs the cache statistics
private  void insertDocument(java.lang.String uri, DocumentCache.CachedDocument doc)
           
private  DocumentCache.CachedDocument lookupDocument(java.lang.String uri)
           
private  void replaceDocument(java.lang.String uri, DocumentCache.CachedDocument doc)
           
 DOM retrieveDocument(java.lang.String baseURI, java.lang.String href, Translet trs)
          Returns a document either by finding it in the cache or downloading it and putting it in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_size

private int _size

_references

private java.util.Hashtable _references

_URIs

private java.lang.String[] _URIs

_count

private int _count

_current

private int _current

_parser

private javax.xml.parsers.SAXParser _parser

_reader

private org.xml.sax.XMLReader _reader

_dtmManager

private XSLTCDTMManager _dtmManager

REFRESH_INTERVAL

private static final int REFRESH_INTERVAL
See Also:
Constant Field Values
Constructor Detail

DocumentCache

public DocumentCache(int size)
              throws org.xml.sax.SAXException
DocumentCache constructor

Throws:
org.xml.sax.SAXException

DocumentCache

public DocumentCache(int size,
                     XSLTCDTMManager dtmManager)
              throws org.xml.sax.SAXException
DocumentCache constructor

Throws:
org.xml.sax.SAXException
Method Detail

getLastModified

private final long getLastModified(java.lang.String uri)
Returns the time-stamp for a document's last update


lookupDocument

private DocumentCache.CachedDocument lookupDocument(java.lang.String uri)

insertDocument

private void insertDocument(java.lang.String uri,
                            DocumentCache.CachedDocument doc)

replaceDocument

private void replaceDocument(java.lang.String uri,
                             DocumentCache.CachedDocument doc)

retrieveDocument

public DOM retrieveDocument(java.lang.String baseURI,
                            java.lang.String href,
                            Translet trs)
Returns a document either by finding it in the cache or downloading it and putting it in the cache.

Specified by:
retrieveDocument in interface DOMCache
Parameters:
baseURI - The base URI used by the document call.
href - The href argument passed to the document function.
trs - A reference to the translet requesting the document

getStatistics

public void getStatistics(java.io.PrintWriter out)
Outputs the cache statistics