Merged V3.0 to HEAD

11905: Merged V2.2 to V3.0
      11782: Fix security in RunAs using public APIs (ETWOTWO-816).
   11907: ETHREEOH-846
   11908: More work on Shutdown Backstop
   11909: Speculative fix for EHTREEOH-782.
   11912: ETHREEOH-746   	 Unable to view contents of previous versions of wiki page
   11915: ETHREEOH-746   	 Unable to view contents of previous versions of wiki page
   11916: Upgrade from YUI 2.5.2 to YUI 2.6.0 - Second stage (Paginators, DocLib Tree, Resizer widget)
   11917: ETHREEOH-874 and ETHREEOH-875
   11918: ETHREEOH-860

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12487 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-12-18 13:10:42 +00:00
parent 99cfed1a4b
commit 6608333df2
6 changed files with 125 additions and 12 deletions

View File

@@ -54,6 +54,11 @@ public class ShutdownBackstop extends AbstractLifecycleBean
*/
private int timeout = 10000;
/**
* is the backstop enabled?
*/
private boolean enabled = true;
protected final static Log log = LogFactory.getLog(ShutdownBackstop.class);
public void setTimeout(int timeout) {
@@ -79,11 +84,22 @@ public class ShutdownBackstop extends AbstractLifecycleBean
@Override
protected void onShutdown(ApplicationEvent event)
{
log.info("Shutdown backstop timer started");
Thread selfDestructThread = new ShutdownBackstopThread(timeout);
selfDestructThread.start();
if(isEnabled())
{
log.info("Shutdown backstop timer started");
Thread selfDestructThread = new ShutdownBackstopThread(timeout);
selfDestructThread.start();
}
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public boolean isEnabled() {
return enabled;
}
/**
* This is a dangerous class! It will kill the JVM after sleeping
* for timeout ms.