Java Doc for DTMManagerDefault.java in  » XML » xalan » org » apache » xml » dtm » ref » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xml.dtm.ref 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xml.dtm.DTMManager
      org.apache.xml.dtm.ref.DTMManagerDefault

All known Subclasses:   org.apache.xalan.xsltc.dom.XSLTCDTMManager,
DTMManagerDefault
public class DTMManagerDefault extends DTMManager (Code)
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
protected  DefaultHandlerm_defaultHandler
     The default implementation of ContentHandler, DTDHandler and ErrorHandler.
 intm_dtm_offsets
     Map from DTM identifier numbers to offsets.
protected  DTMm_dtms
     Map from DTM identifier numbers to DTM objects that this manager manages. One DTM may have several prefix numbers, if extended node indexing is in use; in that case, m_dtm_offsets[] will used to control which prefix maps to which section of the DTM. This array grows as necessary; see addDTM(). This array grows as necessary; see addDTM().
protected  XMLReaderManagerm_readerManager
     The cache for XMLReader objects to be used if the user did not supply an XMLReader for a SAXSource or supplied a StreamSource.

Constructor Summary
public  DTMManagerDefault()
    

Method Summary
public synchronized  voidaddDTM(DTM dtm, int id)
     Add a DTM to the DTM table.
public synchronized  voidaddDTM(DTM dtm, int id, int offset)
     Add a DTM to the DTM table.
Parameters:
  dtm - Should be a valid reference to a DTM.
Parameters:
  id - Integer DTM ID to be bound to this DTM.
Parameters:
  offset - Integer addressing offset.
public synchronized  DTMIteratorcreateDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
    
public synchronized  DTMIteratorcreateDTMIterator(String xpathString, PrefixResolver presolver)
    
public synchronized  DTMIteratorcreateDTMIterator(int node)
    
public synchronized  DTMIteratorcreateDTMIterator(Object xpathCompiler, int pos)
    
public synchronized  DTMcreateDocumentFragment()
    
public synchronized  DTMgetDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)
     Get an instance of a DTM, loaded with the content from the specified source.
public synchronized  DTMgetDTM(int nodeHandle)
     Return the DTM object containing a representation of this node.
public synchronized  intgetDTMHandleFromNode(org.w3c.dom.Node node)
     Given a W3C DOM node, try and return a DTM handle. Note: calling this may be non-optimal, and there is no guarantee that the node will be found in any particular DTM.
Parameters:
  node - Non-null reference to a DOM node.
public synchronized  intgetDTMIdentity(DTM dtm)
     Given a DTM, find the ID number in the DTM tables which addresses the start of the document.
public  ExpandedNameTablegetExpandedNameTable(DTM dtm)
     return the expanded name table.
public synchronized  intgetFirstFreeDTMID()
     Get the first free DTM ID available.
public synchronized  XMLReadergetXMLReader(Source inputSource)
     This method returns the SAX2 parser to use with the InputSource obtained from this URI. It may return null if any SAX2-conformant XML parser can be used, or if getInputSource() will also return null.
public synchronized  booleanrelease(DTM dtm, boolean shouldHardDelete)
     Release the DTMManager's reference(s) to a DTM, making it unmanaged. This is typically done as part of returning the DTM to the heap after we're done with it.
Parameters:
  dtm - the DTM to be released.
Parameters:
  shouldHardDelete - If false, this call is a suggestion rather than anorder, and we may not actually release the DTM.
public synchronized  voidreleaseXMLReader(XMLReader reader)
     Indicates that the XMLReader object is no longer in use for the transform. Note that the getXMLReader method may return an XMLReader that was specified on the SAXSource object by the application code.

Field Detail
m_defaultHandler
protected DefaultHandler m_defaultHandler(Code)
The default implementation of ContentHandler, DTDHandler and ErrorHandler.



m_dtm_offsets
int m_dtm_offsets(Code)
Map from DTM identifier numbers to offsets. For small DTMs with a single identifier, this will always be 0. In overflow addressing, where additional identifiers are allocated to access nodes beyond the range of a single Node Handle, this table is used to map the handle's node field into the actual node identifier. This array grows as necessary; see addDTM(). This array grows as necessary; see addDTM(). Growth is uncommon... but access needs to be blindingly fast since it's used in node addressing. (And at the moment, that includes accessing it from DTMDefaultBase, which is why this is not Protected or Private.)



m_dtms
protected DTM m_dtms(Code)
Map from DTM identifier numbers to DTM objects that this manager manages. One DTM may have several prefix numbers, if extended node indexing is in use; in that case, m_dtm_offsets[] will used to control which prefix maps to which section of the DTM. This array grows as necessary; see addDTM(). This array grows as necessary; see addDTM(). Growth is uncommon... but access needs to be blindingly fast since it's used in node addressing.



m_readerManager
protected XMLReaderManager m_readerManager(Code)
The cache for XMLReader objects to be used if the user did not supply an XMLReader for a SAXSource or supplied a StreamSource.




Constructor Detail
DTMManagerDefault
public DTMManagerDefault()(Code)
Constructor DTMManagerDefault




Method Detail
addDTM
public synchronized void addDTM(DTM dtm, int id)(Code)
Add a DTM to the DTM table. This convenience call adds it as the "base DTM ID", with offset 0. The other version of addDTM should be used if you want to add "extended" DTM IDs with nonzero offsets.
Parameters:
  dtm - Should be a valid reference to a DTM.
Parameters:
  id - Integer DTM ID to be bound to this DTM



addDTM
public synchronized void addDTM(DTM dtm, int id, int offset)(Code)
Add a DTM to the DTM table.
Parameters:
  dtm - Should be a valid reference to a DTM.
Parameters:
  id - Integer DTM ID to be bound to this DTM.
Parameters:
  offset - Integer addressing offset. The internal DTM Node ID isobtained 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<



createDTMIterator
public synchronized DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)(Code)
NEEDSDOC Method createDTMIterator NEEDSDOC @param whatToShow NEEDSDOC @param filter NEEDSDOC @param entityReferenceExpansion NEEDSDOC (createDTMIterator) @return



createDTMIterator
public synchronized DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)(Code)
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathString NEEDSDOC @param presolver NEEDSDOC (createDTMIterator) @return



createDTMIterator
public synchronized DTMIterator createDTMIterator(int node)(Code)
NEEDSDOC Method createDTMIterator NEEDSDOC @param node NEEDSDOC (createDTMIterator) @return



createDTMIterator
public synchronized DTMIterator createDTMIterator(Object xpathCompiler, int pos)(Code)
NEEDSDOC Method createDTMIterator NEEDSDOC @param xpathCompiler NEEDSDOC @param pos NEEDSDOC (createDTMIterator) @return



createDocumentFragment
public synchronized DTM createDocumentFragment()(Code)
Method createDocumentFragment NEEDSDOC (createDocumentFragment) @return



getDTM
public synchronized DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)(Code)
Get an instance of a DTM, loaded with the content from the specified source. If the unique flag is true, a new instance will always be returned. Otherwise it is up to the DTMManager to return a new instance or an instance that it already created and may be being used by someone else. A bit of magic in this implementation: If the source is null, unique is true, and incremental and doIndexing are both false, we return an instance of SAX2RTFDTM, which see. (I think more parameters will need to be added for error handling, and entity resolution, and more explicit control of the RTF situation).
Parameters:
  source - the specification of the source object.
Parameters:
  unique - true if the returned DTM must be unique, probably because itis going to be mutated.
Parameters:
  whiteSpaceFilter - Enables filtering of whitespace nodes, and maybe null.
Parameters:
  incremental - true if the DTM should be built incrementally, ifpossible.
Parameters:
  doIndexing - true if the caller considers it worth it to useindexing schemes. a non-null DTM reference.



getDTM
public synchronized DTM getDTM(int nodeHandle)(Code)
Return the DTM object containing a representation of this node.
Parameters:
  nodeHandle - DTM Handle indicating which node to retrieve a reference to the DTM object containing this node.



getDTMHandleFromNode
public synchronized int getDTMHandleFromNode(org.w3c.dom.Node node)(Code)
Given a W3C DOM node, try and return a DTM handle. Note: calling this may be non-optimal, and there is no guarantee that the node will be found in any particular DTM.
Parameters:
  node - Non-null reference to a DOM node. a valid DTM handle.



getDTMIdentity
public synchronized int getDTMIdentity(DTM dtm)(Code)
Given a DTM, find the ID number in the DTM tables which addresses the start of the document. If overflow addressing is in use, other DTM IDs may also be assigned to this DTM.
Parameters:
  dtm - The DTM which (hopefully) contains this node. The DTM ID (as the high bits of a NodeHandle, not as ourinternal index), or -1 if the DTM doesn't belong to this manager.



getExpandedNameTable
public ExpandedNameTable getExpandedNameTable(DTM dtm)(Code)
return the expanded name table. NEEDSDOC @param dtm NEEDSDOC ($objectName$) @return



getFirstFreeDTMID
public synchronized int getFirstFreeDTMID()(Code)
Get the first free DTM ID available. %OPT% Linear search is inefficient!



getXMLReader
public synchronized XMLReader getXMLReader(Source inputSource)(Code)
This method returns the SAX2 parser to use with the InputSource obtained from this URI. It may return null if any SAX2-conformant XML parser can be used, or if getInputSource() will also return null. The parser must be free for use (i.e., not currently in use for another parse(). After use of the parser is completed, the releaseXMLReader(XMLReader) must be called.
Parameters:
  inputSource - The value returned from the URIResolver. a SAX2 XMLReader to use to resolve the inputSource argument. non-null XMLReader reference ready to parse.



release
public synchronized boolean release(DTM dtm, boolean shouldHardDelete)(Code)
Release the DTMManager's reference(s) to a DTM, making it unmanaged. This is typically done as part of returning the DTM to the heap after we're done with it.
Parameters:
  dtm - the DTM to be released.
Parameters:
  shouldHardDelete - If false, this call is a suggestion rather than anorder, and we may not actually release the DTM. This is intended to support intelligent caching of documents... which is not implementedin this version of the DTM manager. true if the DTM was released, false if shouldHardDelete was setand we decided not to.



releaseXMLReader
public synchronized void releaseXMLReader(XMLReader reader)(Code)
Indicates that the XMLReader object is no longer in use for the transform. Note that the getXMLReader method may return an XMLReader that was specified on the SAXSource object by the application code. Such a reader should still be passed to releaseXMLReader, but the reader manager will only re-use XMLReaders that it created.
Parameters:
  reader - The XMLReader to be released.



Fields inherited from org.apache.xml.dtm.DTMManager
final public static int IDENT_DTM_DEFAULT(Code)(Java Doc)
final public static int IDENT_DTM_NODE_BITS(Code)(Java Doc)
final public static int IDENT_MAX_DTMS(Code)(Java Doc)
final public static int IDENT_NODE_DEFAULT(Code)(Java Doc)
public boolean m_incremental(Code)(Java Doc)
public boolean m_source_location(Code)(Java Doc)
protected XMLStringFactory m_xsf(Code)(Java Doc)

Methods inherited from org.apache.xml.dtm.DTMManager
abstract public DTMIterator createDTMIterator(Object xpathCompiler, int pos)(Code)(Java Doc)
abstract public DTMIterator createDTMIterator(String xpathString, PrefixResolver presolver)(Code)(Java Doc)
abstract public DTMIterator createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)(Code)(Java Doc)
abstract public DTMIterator createDTMIterator(int node)(Code)(Java Doc)
abstract public DTM createDocumentFragment()(Code)(Java Doc)
abstract public DTM getDTM(javax.xml.transform.Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing)(Code)(Java Doc)
abstract public DTM getDTM(int nodeHandle)(Code)(Java Doc)
abstract public int getDTMHandleFromNode(org.w3c.dom.Node node)(Code)(Java Doc)
abstract public int getDTMIdentity(DTM dtm)(Code)(Java Doc)
public int getDTMIdentityMask()(Code)(Java Doc)
public boolean getIncremental()(Code)(Java Doc)
public int getNodeIdentityMask()(Code)(Java Doc)
public boolean getSource_location()(Code)(Java Doc)
public XMLStringFactory getXMLStringFactory()(Code)(Java Doc)
public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException(Code)(Java Doc)
abstract public boolean release(DTM dtm, boolean shouldHardDelete)(Code)(Java Doc)
public void setIncremental(boolean incremental)(Code)(Java Doc)
public void setSource_location(boolean sourceLocation)(Code)(Java Doc)
public void setXMLStringFactory(XMLStringFactory xsf)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.