Search in sources :

Example 1 with RestartNotSupportedException

use of hudson.lifecycle.RestartNotSupportedException 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

RestartNotSupportedException (hudson.lifecycle.RestartNotSupportedException)1 ServiceRuntimeException (org.hudsonci.service.ServiceRuntimeException)1