DefaultScriptSessionManager creates non-daemon thread. see - http://java.sun.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html this will cause tomcat to hang. i believe this could be fixed by;
public class DaemonThreadFactory implements ThreadFactory {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
}
}
....
ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, new DaemonThreadFactory());
i'm not sure where all the changes that need to be made to implement this.
Also, the executor in PurgingDownloadManager stays around, and the field is protected so we can't shut it down from a listener.