Now is also a Runnable to be regisestered as shutdown hook if necessary
This commit is contained in:
parent
59c3584f52
commit
164064e98b
|
@ -7,7 +7,7 @@ import com.liferay.portal.kernel.events.SimpleAction;
|
|||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
|
||||
public class ShutdownAction extends SimpleAction {
|
||||
public class ShutdownAction extends SimpleAction implements Runnable {
|
||||
|
||||
protected static final Log log = LogFactoryUtil.getLog(ShutdownAction.class);
|
||||
|
||||
|
@ -15,6 +15,7 @@ public class ShutdownAction extends SimpleAction {
|
|||
|
||||
public ShutdownAction() {
|
||||
eventPublisher = new ActionEventPublisher();
|
||||
// Runtime.getRuntime().addShutdownHook(new Thread(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,4 +26,13 @@ public class ShutdownAction extends SimpleAction {
|
|||
eventPublisher.publish(SimpleActionEvent.newShutdownEvent(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
this.run(null);
|
||||
} catch (ActionException e) {
|
||||
// Left intentionally as it is
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue