You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by cz...@apache.org on 2004/02/10 19:39:52 UTC
cvs commit: avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/impl JaxpParser.java
cziegeler 2004/02/10 10:39:52
Modified: xmlutil/src/java/org/apache/excalibur/xml/impl
JaxpParser.java
Log:
release entity resolver
Revision Changes Path
1.2 +21 -2 avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java
Index: JaxpParser.java
===================================================================
RCS file: /home/cvs/avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JaxpParser.java 9 Nov 2003 12:47:42 -0000 1.1
+++ JaxpParser.java 10 Feb 2004 18:39:52 -0000 1.2
@@ -62,6 +62,7 @@
import javax.xml.parsers.SAXParserFactory;
import org.apache.avalon.excalibur.pool.Poolable;
+import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.parameters.ParameterException;
@@ -130,7 +131,7 @@
public final class JaxpParser
extends AbstractLogEnabled
implements SAXParser, DOMParser,
- Poolable, Component, Parameterizable, Serviceable, ErrorHandler
+ Poolable, Component, Parameterizable, Serviceable, Disposable, ErrorHandler
{
/** the SAX Parser factory */
private SAXParserFactory m_factory;
@@ -164,6 +165,9 @@
/** Should comments appearing between start/endDTD events be dropped ? */
private boolean m_dropDtdComments;
+ /** The serviec manager */
+ private ServiceManager m_manager;
+
/**
* Get the Entity Resolver from the component m_manager
*
@@ -172,6 +176,8 @@
public void service( final ServiceManager manager )
throws ServiceException
{
+ m_manager = manager;
+
if( manager.hasService( EntityResolver.ROLE ) )
{
m_resolver = (EntityResolver)manager.lookup( EntityResolver.ROLE );
@@ -179,6 +185,19 @@
{
getLogger().debug( "JaxpParser: Using EntityResolver: " + m_resolver );
}
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.avalon.framework.activity.Disposable#dispose()
+ */
+ public void dispose()
+ {
+ if ( m_manager != null )
+ {
+ m_manager.release( m_resolver );
+ m_manager = null;
+ m_resolver = null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org