Example usage for com.liferay.portal.util ShutdownUtil shutdown

List of usage examples for com.liferay.portal.util ShutdownUtil shutdown

Introduction

In this page you can find the example usage for com.liferay.portal.util ShutdownUtil shutdown.

Prototype

public static void shutdown(long milliseconds, String message) 

Source Link

Usage

From source file:com.liferay.portlet.admin.action.EditServerAction.java

License:Open Source License

protected void shutdown(ActionRequest actionRequest) throws Exception {
    long minutes = ParamUtil.getInteger(actionRequest, "minutes") * Time.MINUTE;
    String message = ParamUtil.getString(actionRequest, "message");

    if (minutes <= 0) {
        ShutdownUtil.cancel();//w  w  w .ja v a2 s .co  m
    } else {
        ShutdownUtil.shutdown(minutes, message);
    }
}

From source file:com.liferay.portlet.admin.action.ServerAction.java

License:Open Source License

private void _shutdown(ActionRequest req) throws Exception {
    long minutes = ParamUtil.getInteger(req, "shutdown_minutes") * Time.MINUTE;
    String message = ParamUtil.getString(req, "shutdown_message");

    if (minutes <= 0) {
        ShutdownUtil.cancel();//  w  w  w.  j  a  v  a 2  s. c om
    } else {
        ShutdownUtil.shutdown(minutes, message);
    }
}

From source file:com.liferay.server.admin.web.internal.portlet.action.EditServerMVCActionCommand.java

License:Open Source License

protected void shutdown(ActionRequest actionRequest) throws Exception {
    if (ShutdownUtil.isInProcess()) {
        ShutdownUtil.cancel();//from w w  w.  j  a  va2 s.c  om
    } else {
        long minutes = ParamUtil.getInteger(actionRequest, "minutes") * Time.MINUTE;

        if (minutes <= 0) {
            SessionErrors.add(actionRequest, "shutdownMinutes");
        } else {
            String message = ParamUtil.getString(actionRequest, "message");

            ShutdownUtil.shutdown(minutes, message);
        }
    }
}