Search in sources :

Example 6 with ServiceRuntimeException

use of org.hudsonci.service.ServiceRuntimeException in project hudson-2.x by hudson.

the class SystemServiceImpl method doRestart.

public void doRestart(boolean safely) {
    //securityService.checkPermission(Hudson.ADMINISTER);
    try {
        if (safely) {
            log.debug("Restarting (safely)");
            getHudson().safeRestart();
        } else {
            log.debug("Restarting");
            getHudson().restart();
        }
    } catch (RestartNotSupportedException ex) {
        throw new ServiceRuntimeException("Restart not supported", ex);
    }
}
Also used : RestartNotSupportedException(hudson.lifecycle.RestartNotSupportedException) ServiceRuntimeException(org.hudsonci.service.ServiceRuntimeException)

Aggregations

ServiceRuntimeException (org.hudsonci.service.ServiceRuntimeException)6 IOException (java.io.IOException)5 SystemIntegrityViolationException (org.hudsonci.service.SystemIntegrityViolationException)2 RestartNotSupportedException (hudson.lifecycle.RestartNotSupportedException)1 ServletException (javax.servlet.ServletException)1