Package net.shibboleth.shared.xml.impl
Class BasicParserPool.DocumentBuilderProxy
java.lang.Object
javax.xml.parsers.DocumentBuilder
net.shibboleth.shared.xml.impl.BasicParserPool.DocumentBuilderProxy
- Enclosing class:
- BasicParserPool
A proxy that prevents the manages document builders retrieved from the parser pool.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DocumentBuilderBuilder being proxied.private final ParserPoolPool that owns this parser.private booleanTrack accounting state of whether this builder has been returned to the owning pool. -
Constructor Summary
ConstructorsConstructorDescriptionDocumentBuilderProxy(DocumentBuilder target, BasicParserPool owner) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck whether the parser is in a valid and usable state, and if not, throw a runtime exception.protected ParserPoolGets the pool that owns this parser.protected DocumentBuilderGets the proxied document builder.booleanprotected booleanCheck accounting state as to whether this parser has been returned to the owning pool.booleanbooleanparse(InputStream is) parse(InputStream is, String systemId) parse(InputSource is) voidreset()voidvoidprotected voidsetReturned(boolean isReturned) Set accounting state as to whether this parser has been returned to the owning pool.
-
Field Details
-
builder
Builder being proxied. -
owningPool
Pool that owns this parser. -
returned
private boolean returnedTrack accounting state of whether this builder has been returned to the owning pool.
-
-
Constructor Details
-
Method Details
-
getDOMImplementation
- Specified by:
getDOMImplementationin classDocumentBuilder
-
getSchema
- Overrides:
getSchemain classDocumentBuilder
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAwarein classDocumentBuilder
-
isValidating
public boolean isValidating()- Specified by:
isValidatingin classDocumentBuilder
-
isXIncludeAware
public boolean isXIncludeAware()- Overrides:
isXIncludeAwarein classDocumentBuilder
-
newDocument
- Specified by:
newDocumentin classDocumentBuilder
-
parse
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
- Specified by:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
reset
public void reset()- Overrides:
resetin classDocumentBuilder
-
setEntityResolver
- Specified by:
setEntityResolverin classDocumentBuilder
-
setErrorHandler
- Specified by:
setErrorHandlerin classDocumentBuilder
-
getOwningPool
Gets the pool that owns this parser.- Returns:
- pool that owns this parser
-
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()Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.
-