|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.dtm.DTMManager org.apache.xml.dtm.ref.DTMManagerDefault
The default implementation for the DTMManager.
%REVIEW% There is currently a reentrancy issue, since the finalizer
for XRTreeFrag (which runs in the GC thread) wants to call
DTMManager.release(), and may do so at the same time that the main
transformation thread is accessing the manager. Our current solution is
to make most of the manager's methods synchronized
.
Early tests suggest that doing so is not causing a significant
performance hit in Xalan. However, it should be noted that there
is a possible alternative solution: rewrite release() so it merely
posts a request for release onto a threadsafe queue, and explicitly
process that queue on an infrequent basis during main-thread
activity (eg, when getDTM() is invoked). The downside of that solution
would be a greater delay before the DTM's storage is actually released
for reuse.
Field Summary | |
private static boolean |
DEBUG
Set this to true if you want a basic diagnostics. |
private static boolean |
DUMPTREE
Set this to true if you want a dump of the DTM after creation. |
(package private) int[] |
m_dtm_offsets
Map from DTM identifier numbers to offsets. |
protected DTM[] |
m_dtms
Map from DTM identifier numbers to DTM objects that this manager manages. |
private ExpandedNameTable |
m_expandedNameTable
The default table for exandedNameID lookups. |
Fields inherited from class org.apache.xml.dtm.DTMManager |
IDENT_DTM_DEFAULT, IDENT_DTM_NODE_BITS, IDENT_MAX_DTMS, IDENT_NODE_DEFAULT, m_incremental, m_xsf |
Constructor Summary | |
DTMManagerDefault()
Constructor DTMManagerDefault |
Method Summary | |
void |
addDTM(DTM dtm,
int id)
Add a DTM to the DTM table. |
void |
addDTM(DTM dtm,
int id,
int offset)
Add a DTM to the DTM table. |
DTM |
createDocumentFragment()
Method createDocumentFragment NEEDSDOC (createDocumentFragment) @return |
DTMIterator |
createDTMIterator(int node)
NEEDSDOC Method createDTMIterator NEEDSDOC @param node NEEDSDOC (createDTMIterator) @return |
DTMIterator |
createDTMIterator(int whatToShow,
DTMFilter filter,
boolean entityReferenceExpansion)
NEEDSDOC Method createDTMIterator NEEDSDOC @param whatToShow NEEDSDOC @param filter NEEDSDOC @param entityReferenceExpansion NEEDSDOC (createDTMIterator) @return |
DTMIterator |
createDTMIterator(Object xpathCompiler,
int pos)
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathCompiler NEEDSDOC @param pos NEEDSDOC (createDTMIterator) @return |
DTMIterator |
createDTMIterator(String xpathString,
PrefixResolver presolver)
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathString NEEDSDOC @param presolver NEEDSDOC (createDTMIterator) @return |
DTM |
getDTM(int nodeHandle)
Return the DTM object containing a representation of this node. |
DTM |
getDTM(javax.xml.transform.Source source,
boolean unique,
DTMWSFilter whiteSpaceFilter,
boolean incremental,
boolean doIndexing)
Get an instance of a DTM, loaded with the content from the specified source. |
int |
getDTMHandleFromNode(org.w3c.dom.Node node)
Given a W3C DOM node, try and return a DTM handle. |
int |
getDTMIdentity(DTM dtm)
Given a DTM, find the ID number in the DTM tables which addresses the start of the document. |
ExpandedNameTable |
getExpandedNameTable(DTM dtm)
return the expanded name table. |
int |
getFirstFreeDTMID()
Get the first free DTM ID available. |
org.xml.sax.XMLReader |
getXMLReader(javax.xml.transform.Source inputSource)
This method returns the SAX2 parser to use with the InputSource obtained from this URI. |
boolean |
release(DTM dtm,
boolean shouldHardDelete)
Release the DTMManager's reference(s) to a DTM, making it unmanaged. |
Methods inherited from class org.apache.xml.dtm.DTMManager |
getDTMIdentityMask, getIncremental, getNodeIdentityMask, getXMLStringFactory, newInstance, setIncremental, setXMLStringFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final boolean DUMPTREE
private static final boolean DEBUG
protected DTM[] m_dtms
int[] m_dtm_offsets
private ExpandedNameTable m_expandedNameTable
Constructor Detail |
public DTMManagerDefault()
Method Detail |
public void addDTM(DTM dtm, int id)
dtm
- Should be a valid reference to a DTM.id
- Integer DTM ID to be bound to this DTMpublic void addDTM(DTM dtm, int id, int offset)
dtm
- Should be a valid reference to a DTM.id
- Integer DTM ID to be bound to this DTM.offset
- Integer addressing offset. The internal DTM Node ID is
obtained by adding this offset to the node-number field of the
public DTM Handle. For the first DTM ID accessing each DTM, this is 0;
for overflow addressing it will be a multiple of 1<public int getFirstFreeDTMID()
public DTM getDTM(javax.xml.transform.Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)
getDTM
in class DTMManager
source
- the specification of the source object.unique
- true if the returned DTM must be unique, probably because it
is going to be mutated.whiteSpaceFilter
- Enables filtering of whitespace nodes, and may
be null.incremental
- true if the DTM should be built incrementally, if
possible.doIndexing
- true if the caller considers it worth it to use
indexing schemes.
public int getDTMHandleFromNode(org.w3c.dom.Node node)
getDTMHandleFromNode
in class DTMManager
node
- Non-null reference to a DOM node.
public org.xml.sax.XMLReader getXMLReader(javax.xml.transform.Source inputSource)
inputSource
- The value returned from the URIResolver.
public DTM getDTM(int nodeHandle)
getDTM
in class DTMManager
nodeHandle
- DTM Handle indicating which node to retrieve
public int getDTMIdentity(DTM dtm)
getDTMIdentity
in class DTMManager
dtm
- The DTM which (hopefully) contains this node.
public boolean release(DTM dtm, boolean shouldHardDelete)
release
in class DTMManager
dtm
- the DTM to be released.shouldHardDelete
- If false, this call is a suggestion rather than an
order, and we may not actually release the DTM. This is intended to
support intelligent caching of documents... which is not implemented
in this version of the DTM manager.
public DTM createDocumentFragment()
createDocumentFragment
in class DTMManager
public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
createDTMIterator
in class DTMManager
whatToShow
- This flag specifies which node types may appear in
the logical view of the tree presented by the iterator. See the
description of NodeFilter
for the set of possible
SHOW_
values.These flags can be combined using
OR
.filter
- The NodeFilter
to be used with this
DTMFilter
, or null
to indicate no filter.entityReferenceExpansion
- The value of this flag determines
whether entity reference nodes are expanded.
DTMIterator
.public DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)
createDTMIterator
in class DTMManager
xpathString
- Must be a valid string expressing a
UnionExpr.presolver
- An object that can resolve prefixes to namespace URLs.
DTMIterator
.public DTMIterator createDTMIterator(int node)
createDTMIterator
in class DTMManager
node
- The node handle that the DTMIterator will iterate to.
DTMIterator
.public DTMIterator createDTMIterator(Object xpathCompiler, int pos)
createDTMIterator
in class DTMManager
xpathCompiler
- ??? Somehow we need to pass in a subpart of the
expression. I hate to do this with strings, since the larger expression
has already been parsed.pos
- The position in the expression.
DTMIterator
.public ExpandedNameTable getExpandedNameTable(DTM dtm)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |