org.opensaml.xml.parse
Class BasicParserPool.DocumentBuilderProxy

java.lang.Object
  extended by javax.xml.parsers.DocumentBuilder
      extended by org.opensaml.xml.parse.BasicParserPool.DocumentBuilderProxy
Enclosing class:
BasicParserPool

protected class BasicParserPool.DocumentBuilderProxy
extends DocumentBuilder

A proxy that prevents the manages document builders retrieved from the parser pool.


Field Summary
private  DocumentBuilder builder
          Builder being proxied.
private  ParserPool owningPool
          Pool that owns this parser.
private  long owningPoolVersion
          Version of the pool when this proxy was created.
private  boolean returned
          Track accounting state of whether this builder has been returned to the owning pool.
 
Constructor Summary
BasicParserPool.DocumentBuilderProxy(DocumentBuilder target, BasicParserPool owner, long version)
          Constructor.
 
Method Summary
protected  void checkValidState()
          Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.
protected  void finalize()
          
 DOMImplementation getDOMImplementation()
          
protected  ParserPool getOwningPool()
          Gets the pool that owns this parser.
protected  long getPoolVersion()
          Gets the version of the pool that owns this parser at the time of the proxy's creation.
protected  DocumentBuilder getProxiedBuilder()
          Gets the proxied document builder.
 Schema getSchema()
          
 boolean isNamespaceAware()
          
protected  boolean isReturned()
          Check accounting state as to whether this parser has been returned to the owning pool.
 boolean isValidating()
          
 boolean isXIncludeAware()
          
 Document newDocument()
          
 Document parse(File f)
          
 Document parse(InputSource is)
          
 Document parse(InputStream is)
          
 Document parse(InputStream is, String systemId)
          
 Document parse(String uri)
          
 void reset()
          
 void setEntityResolver(EntityResolver er)
          
 void setErrorHandler(ErrorHandler eh)
          
protected  void setReturned(boolean isReturned)
          Set accounting state as to whether this parser has been returned to the owning pool.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

private DocumentBuilder builder
Builder being proxied.


owningPool

private ParserPool owningPool
Pool that owns this parser.


owningPoolVersion

private long owningPoolVersion
Version of the pool when this proxy was created.


returned

private boolean returned
Track accounting state of whether this builder has been returned to the owning pool.

Constructor Detail

BasicParserPool.DocumentBuilderProxy

public BasicParserPool.DocumentBuilderProxy(DocumentBuilder target,
                                            BasicParserPool owner,
                                            long version)
Constructor.

Parameters:
target - document builder to proxy
owner - the owning pool
version - the owning pool's version
Method Detail

getDOMImplementation

public DOMImplementation getDOMImplementation()

Specified by:
getDOMImplementation in class DocumentBuilder

getSchema

public Schema getSchema()

Overrides:
getSchema in class DocumentBuilder

isNamespaceAware

public boolean isNamespaceAware()

Specified by:
isNamespaceAware in class DocumentBuilder

isValidating

public boolean isValidating()

Specified by:
isValidating in class DocumentBuilder

isXIncludeAware

public boolean isXIncludeAware()

Overrides:
isXIncludeAware in class DocumentBuilder

newDocument

public Document newDocument()

Specified by:
newDocument in class DocumentBuilder

parse

public Document parse(File f)
               throws SAXException,
                      IOException

Overrides:
parse in class DocumentBuilder
Throws:
SAXException
IOException

parse

public Document parse(InputSource is)
               throws SAXException,
                      IOException

Specified by:
parse in class DocumentBuilder
Throws:
SAXException
IOException

parse

public Document parse(InputStream is)
               throws SAXException,
                      IOException

Overrides:
parse in class DocumentBuilder
Throws:
SAXException
IOException

parse

public Document parse(InputStream is,
                      String systemId)
               throws SAXException,
                      IOException

Overrides:
parse in class DocumentBuilder
Throws:
SAXException
IOException

parse

public Document parse(String uri)
               throws SAXException,
                      IOException

Overrides:
parse in class DocumentBuilder
Throws:
SAXException
IOException

reset

public void reset()

Overrides:
reset in class DocumentBuilder

setEntityResolver

public void setEntityResolver(EntityResolver er)

Specified by:
setEntityResolver in class DocumentBuilder

setErrorHandler

public void setErrorHandler(ErrorHandler eh)

Specified by:
setErrorHandler in class DocumentBuilder

getOwningPool

protected ParserPool getOwningPool()
Gets the pool that owns this parser.

Returns:
pool that owns this parser

getPoolVersion

protected long getPoolVersion()
Gets the version of the pool that owns this parser at the time of the proxy's creation.

Returns:
version of the pool that owns this parser at the time of the proxy's creation

getProxiedBuilder

protected DocumentBuilder getProxiedBuilder()
Gets the proxied document builder.

Returns:
proxied document builder

isReturned

protected boolean isReturned()
Check accounting state as to whether this parser has been returned to the owning pool.

Returns:
true if parser has been returned to the owning pool, otherwise false

setReturned

protected void setReturned(boolean isReturned)
Set accounting state as to whether this parser has been returned to the owning pool.

Parameters:
isReturned - set true to indicate that parser has been returned to the owning pool

checkValidState

protected void checkValidState()
                        throws IllegalStateException
Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.

Throws:
IllegalStateException - thrown if the parser is in a state such that it can not be used

finalize

protected void finalize()
                 throws Throwable

Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 1999-2013. All Rights Reserved.