hilmer 2004/05/05 03:41:48 Modified: src/java/org/apache/james/dnsserver Tag: branch_2_1_fcs DNSServer.java Log: PR: James-280 Submitted by: Søren Hilmer Reviewed by: Søren Hilmer DNSServer did not implement Disposable, and thus did not have a chance to stop the dnsjava cachecleaner thread on shutdown. Revision Changes Path No revision No revision 1.9.4.20 +19 -1 james-server/src/java/org/apache/james/dnsserver/DNSServer.java Index: DNSServer.java =================================================================== RCS file: /home/cvs/james-server/src/java/org/apache/james/dnsserver/DNSServer.java,v retrieving revision 1.9.4.19 retrieving revision 1.9.4.20 diff -u -r1.9.4.19 -r1.9.4.20 --- DNSServer.java 2 May 2004 06:12:22 -0000 1.9.4.19 +++ DNSServer.java 5 May 2004 10:41:48 -0000 1.9.4.20 @@ -18,6 +18,7 @@ package org.apache.james.dnsserver; import org.apache.avalon.framework.activity.Initializable; +import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; @@ -50,7 +51,7 @@ */ public class DNSServer extends AbstractLogEnabled - implements Configurable, Initializable, + implements Configurable, Initializable, Disposable, org.apache.james.services.DNSServer, DNSServerMBean { /** @@ -588,4 +589,21 @@ throw new UnsupportedOperationException ("remove not supported by this iterator"); } } + + + /** + * The dispose operation is called at the end of a components lifecycle. + * Instances of this class use this method to release and destroy any + * resources that they own. + * + * This implementation shuts down org.xbill.DNS.Cache + * + * @throws Exception if an error is encountered during shutdown + */ + public void dispose() + { + //setting the clean interval to a negative value, will terminate + //the Cache cleaner thread. + cache.setCleanInterval (-1); + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]