Package org.apache.xml.utils
Class XMLReaderManager
- java.lang.Object
-
- org.apache.xml.utils.XMLReaderManager
-
public class XMLReaderManager extends java.lang.ObjectCreates XMLReader objects and caches them for re-use. This class follows the singleton pattern.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XMLReaderManagergetInstance()Retrieves the singleton reader managerorg.xml.sax.XMLReadergetXMLReader()Retrieves a cached XMLReader for this thread, or creates a new XMLReader, if the existing reader is in use.voidreleaseXMLReader(org.xml.sax.XMLReader reader)Mark the cached XMLReader as available.
-
-
-
Method Detail
-
getInstance
public static XMLReaderManager getInstance()
Retrieves the singleton reader manager
-
getXMLReader
public org.xml.sax.XMLReader getXMLReader() throws org.xml.sax.SAXExceptionRetrieves a cached XMLReader for this thread, or creates a new XMLReader, if the existing reader is in use. When the caller no longer needs the reader, it must release it with a call toreleaseXMLReader(org.xml.sax.XMLReader).- Throws:
org.xml.sax.SAXException
-
releaseXMLReader
public void releaseXMLReader(org.xml.sax.XMLReader reader)
Mark the cached XMLReader as available. If the reader was not actually in the cache, do nothing.- Parameters:
reader- The XMLReader that's being released.
-
-