Changeset e064b0a


Ignore:
Timestamp:
Aug 29, 2008 1:12:55 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ee4d68c
Parents:
c321251
Message:
  • Shutdown: Call the shutdown hooks before the router shutdown rather than after
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/Router.java

    rc321251 re064b0a  
    797797        _context.random().saveSeed();
    798798        I2PThread.removeOOMEventListener(_oomListener);
     799        // Run the shutdown hooks first in case they want to send some goodbye messages
     800        // Maybe we need a delay after this too?
     801        try {
     802            for (Iterator iter = _shutdownTasks.iterator(); iter.hasNext(); ) {
     803                Runnable task = (Runnable)iter.next();
     804                task.run();
     805            }
     806        } catch (Throwable t) {
     807            _log.log(Log.CRIT, "Error running shutdown task", t);
     808        }
    799809        try { _context.jobQueue().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the job queue", t); }
    800810        //try { _context.adminManager().shutdown(); } catch (Throwable t) { _log.log(Log.CRIT, "Error shutting down the admin manager", t); }       
     
    812822        RouterContext.listContexts().remove(_context);
    813823        dumpStats();
    814         try {
    815             for (Iterator iter = _shutdownTasks.iterator(); iter.hasNext(); ) {
    816                 Runnable task = (Runnable)iter.next();
    817                 task.run();
    818             }
    819         } catch (Throwable t) {
    820             _log.log(Log.CRIT, "Error running shutdown task", t);
    821         }
    822824        finalShutdown(exitCode);
    823825    }
Note: See TracChangeset for help on using the changeset viewer.