mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user