net.sf.swan.xml.input.util
Class ReaderPool
java.lang.Object
|
+--net.sf.swan.xml.input.util.ReaderPool
- public class ReaderPool
- extends java.lang.Object
Utility for using XMLReaders
in a thread-safe
manner. Clients take
an XMLReader
from the pool when
one is needed and return it
when they are done.
If no free XMLReader
is available, this component invokes
create()
on itself to create a new instance. Subclasses may
override the create
method to initialize the XMLReader
in a manner appropriate to the application.
Method Summary |
protected org.xml.sax.XMLReader |
create()
|
void |
put(org.xml.sax.XMLReader freeSelector)
|
org.xml.sax.XMLReader |
take()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReaderPool
public ReaderPool()
ReaderPool
public ReaderPool(java.lang.String driver)
take
public org.xml.sax.XMLReader take()
throws org.xml.sax.SAXException
put
public void put(org.xml.sax.XMLReader freeSelector)
create
protected org.xml.sax.XMLReader create()
throws org.xml.sax.SAXException