Search in sources :

Example 1 with ReactorException

use of org.jvnet.hudson.reactor.ReactorException in project hudson-2.x by hudson.

the class Hudson method doReload.

/**
     * Reloads the configuration.
     */
@CLIMethod(name = "reload-configuration")
public synchronized HttpResponse doReload() throws IOException {
    checkPermission(ADMINISTER);
    // engage "loading ..." UI and then run the actual task in a separate thread
    WebAppController.get().install(new HudsonIsLoading());
    new Thread("Hudson config reload thread") {

        @Override
        public void run() {
            try {
                SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
                reload();
            } catch (IOException e) {
                LOGGER.log(Level.SEVERE, "Failed to reload Hudson config", e);
            } catch (ReactorException e) {
                LOGGER.log(Level.SEVERE, "Failed to reload Hudson config", e);
            } catch (InterruptedException e) {
                LOGGER.log(Level.SEVERE, "Failed to reload Hudson config", e);
            }
        }
    }.start();
    return HttpResponses.redirectViaContextPath("/");
}
Also used : ReactorException(org.jvnet.hudson.reactor.ReactorException) IOException(java.io.IOException) HudsonIsLoading(hudson.util.HudsonIsLoading) UDPBroadcastThread(hudson.UDPBroadcastThread) CLIMethod(hudson.cli.declarative.CLIMethod)

Aggregations

UDPBroadcastThread (hudson.UDPBroadcastThread)1 CLIMethod (hudson.cli.declarative.CLIMethod)1 HudsonIsLoading (hudson.util.HudsonIsLoading)1 IOException (java.io.IOException)1 ReactorException (org.jvnet.hudson.reactor.ReactorException)1