[Jukebox-cvs] CVS update: J4/src/java/gnu/j4/service Idle.java MBeanServerWrapper.java PassiveServic
Brought to you by:
vtt
From: CVS B. <vt...@fr...> - 2000-11-02 08:51:00
|
User: vt Date: 00/11/01 23:57:47 Modified: src/java/gnu/j4/service Idle.java MBeanServerWrapper.java PassiveService.java ResourcePool.java Log: Checkpoint on the way to implement a shutdown(Throwable failureCause) call, as opposed to no-argument shutdown(). Point is, I want to know why the execute() died, if it did. Revision Changes Path 1.7 +4 -4 J4/src/java/gnu/j4/service/Idle.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/Idle.java?annotate=1.7&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/Idle.java?rev=1.7&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/Idle.java.diff?r1=1.7&r2=1.6&cvsroot=jukebox4 ----------------------------------- Index: Idle.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/service/Idle.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Idle.java 2000/03/03 04:20:22 1.6 +++ Idle.java 2000/11/02 06:57:47 1.7 @@ -27,10 +27,10 @@ * </dl> * * @author <a href="mailto:vt...@fr...">Vadim Tkachenko</a> - * @version $Id: Idle.java,v 1.6 2000/03/03 04:20:22 vt Exp $ + * @version $Id: Idle.java,v 1.7 2000/11/02 06:57:47 vt Exp $ */ -public final class Idle extends PassiveService implements EventListener -{ +public final class Idle extends PassiveService implements EventListener { + /** * Running instance. * @@ -142,7 +142,7 @@ * Clear the <code>instance</code> variable so we can start over. * @exception InterruptedException if the call had been interrupted. */ - protected void shutdown() throws InterruptedException { + protected void shutdown(Throwable failureCause) throws InterruptedException { instance = null; // complain( LOG_DEBUG,LOG_SERVICE,"shutting down" ); 1.3 +1 -1 J4/src/java/gnu/j4/service/MBeanServerWrapper.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/MBeanServerWrapper.java?annotate=1.3&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/MBeanServerWrapper.java?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/MBeanServerWrapper.java.diff?r1=1.3&r2=1.2&cvsroot=jukebox4 ----------------------------------- Index: MBeanServerWrapper.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/service/MBeanServerWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MBeanServerWrapper.java 2000/06/06 18:46:26 1.2 +++ MBeanServerWrapper.java 2000/11/02 06:57:47 1.3 @@ -120,7 +120,7 @@ complain(LOG_INFO, CH_MW, "initialized"); } - protected void shutdown() throws InterruptedException, Throwable { + protected void shutdown(Throwable failureCause) throws InterruptedException, Throwable { if ( server == null ) { 1.17 +22 -4 J4/src/java/gnu/j4/service/PassiveService.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/PassiveService.java?annotate=1.17&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/PassiveService.java?rev=1.17&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/PassiveService.java.diff?r1=1.17&r2=1.16&cvsroot=jukebox4 ----------------------------------- Index: PassiveService.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/service/PassiveService.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- PassiveService.java 2000/08/31 23:42:38 1.16 +++ PassiveService.java 2000/11/02 06:57:47 1.17 @@ -50,7 +50,7 @@ * target="_top">$500 million mistake</a>. * * @author Copyright © <a href="mailto:vt...@fr...">Vadim Tkachenko</a> 1995-2000 - * @version $Id: PassiveService.java,v 1.16 2000/08/31 23:42:38 vt Exp $ + * @version $Id: PassiveService.java,v 1.17 2000/11/02 06:57:47 vt Exp $ * @see ActiveService */ public abstract class PassiveService extends LogAware implements RunnableService { @@ -77,13 +77,31 @@ /** * Execute the shutdown sequence. * + * @param failureCause <code>null</code> if the {@link + * ActiveService#execute ActiveService#execute()} method has completed + * successfully. Otherwise, the exception that had caused it to + * interrupt. + * + * <p> + * + * This allows the shutdown procedure to react to the execution + * interruption cause accurately, because there's no other way to tell + * it <strong>why</strong> the execution has ended. + * + * <p> + * + * This is actually not applicable to this class, but since + * <code>shutdown()</code> is a basic method used by all descendants, it + * does belong here, where it is called with <code>null</code> + * parameter. + * * @return true if all the post-conditions are met. * @exception InterruptedException if this thread was interrupted. * * @exception Throwable to indicate the shutdown failure. Possibly * propagated from implementation. */ - protected abstract void shutdown() throws InterruptedException, Throwable; + protected abstract void shutdown(Throwable failureCause) throws InterruptedException, Throwable; /** * Clean up. @@ -100,7 +118,7 @@ complain(LOG_NOTICE, LOG_SERVICE, "finalizing enabled?"); try { - shutdown(); + shutdown(null); } catch (Throwable t) { complain(LOG_ERR, LOG_SERVICE, "Uncaught exception on shutdown():", t); } @@ -540,7 +558,7 @@ Throwable cause = null; try { - ((PassiveService)target).shutdown(); + ((PassiveService)target).shutdown(null); } catch (Throwable t) { cause = t; } 1.15 +2 -2 J4/src/java/gnu/j4/service/ResourcePool.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/ResourcePool.java?annotate=1.15&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/ResourcePool.java?rev=1.15&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/service/ResourcePool.java.diff?r1=1.15&r2=1.14&cvsroot=jukebox4 ----------------------------------- Index: ResourcePool.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/service/ResourcePool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ResourcePool.java 2000/03/19 09:33:54 1.14 +++ ResourcePool.java 2000/11/02 06:57:47 1.15 @@ -58,7 +58,7 @@ * some time. Will be implemented later, if it turns out to be reasonable. * * @author Copyright © <a href="mailto:vt...@fr...">Vadim Tkachenko</a> 1999 - * @version $Id: ResourcePool.java,v 1.14 2000/03/19 09:33:54 vt Exp $ + * @version $Id: ResourcePool.java,v 1.15 2000/11/02 06:57:47 vt Exp $ */ abstract public class ResourcePool extends PassiveService { @@ -466,7 +466,7 @@ * @exception InterruptedException if this thread was interrupted by * another thread. */ - protected void shutdown() throws InterruptedException { + protected void shutdown(Throwable failureCause) throws InterruptedException { } public String toString() { |