synchronized public boolean release(DTM dtm, boolean shouldHardDelete)
  {
    if(DEBUG)
    {
      System.out.println("Releasing "+
			 (shouldHardDelete ? "HARD" : "soft")+
			 " dtm="+
			 // Following shouldn't need a nodeHandle, but does...
			 // and doesn't seem to report the intended value
			 dtm.getDocumentBaseURI()
			 );
    }

    if (dtm instanceof SAX2DTM)
    {
      ((SAX2DTM) dtm).clearCoRoutine();
    }

		// Multiple DTM IDs may be assigned to a single DTM. 
		// The Right Answer is to ask which (if it supports
		// extension, the DTM will need a list anyway). The 
		// Wrong Answer, applied if the DTM can't help us,
		// is to linearly search them all; this may be very
		// painful.
		//
		// %REVIEW% Should the lookup move up into the basic DTM API?
		if(dtm instanceof DTMDefaultBase)
		{
			org.apache.xml.utils.SuballocatedIntVector ids=((DTMDefaultBase)dtm).getDTMIDs();
			for(int i=ids.size()-1;i>=0;--i)
				m_dtms[ids.elementAt(i)>>>DTMManager.IDENT_DTM_NODE_BITS]=null;
		}
		else
		{
			int i = getDTMIdentity(dtm);
		    if (i >= 0)
			{
				m_dtms[i >>> DTMManager.IDENT_DTM_NODE_BITS] = null;
			}
		}

    dtm.documentRelease();
    return true;
  }
synchronized public boolean release ( DTM dtm , boolean shouldHardDelete ) { if ( DEBUG ) { System . out . println ( "Releasing " + ( shouldHardDelete ? "HARD" : "soft" ) + " dtm=" + dtm . getDocumentBaseURI ( ) ) ; } if ( dtm instanceof SAX2DTM ) { ( ( SAX2DTM ) dtm ) . clearCoRoutine ( ) ; } if ( dtm instanceof DTMDefaultBase ) { org . apache . xml . utils . SuballocatedIntVector ids = ( ( DTMDefaultBase ) dtm ) . getDTMIDs ( ) ; for ( int i = ids . size ( ) - 1 ; i >= 0 ; -- i ) m_dtms [ ids . elementAt ( i ) > > > DTMManager . IDENT_DTM_NODE_BITS ] = null ; } else { int i = getDTMIdentity ( dtm ) ; if ( i >= 0 ) { m_dtms [ i > > > DTMManager . IDENT_DTM_NODE_BITS ] = null ; } } dtm . documentRelease ( ) ; return true ; }
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.

@param dtm the DTM to be released.

@param 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.

@return true if the DTM was released, false if shouldHardDelete was set
and we decided not to.