/**
 * 
 */
package hudson.plugins.selenium.callables.hub;

import hudson.plugins.selenium.HubHolder;
import hudson.remoting.Callable;

/**
 * @author Richard Lavoie
 * 
 */
public class StopHubCallable implements Callable<Void, Exception> {

    /*
     * (non-Javadoc)
     * @see hudson.remoting.Callable#call()
     */
    public Void call() throws Exception {
        HubHolder.hub.getRegistry().stop();
        HubHolder.hub.stop();
        HubHolder.hub = null;
        return null;
    }

}

@@ -1,15 +1,14 @@
 /**%0A *
- 
 %0A */%0Apac
@@ -52,16 +52,50 @@
 s.hub;%0A%0A
+import java.util.logging.Logger;%0A%0A
 import h
@@ -194,17 +194,16 @@
 avoie%0A *
- 
 %0A */%0Apub
@@ -268,16 +268,105 @@
 ion%3E %7B%0A%0A
+%09private static final Logger LOGGER = Logger.getLogger(StopHubCallable.class.getName());%0A
     /*%0A 
@@ -479,16 +479,138 @@
 ption %7B%0A
+%09    if (HubHolder.hub == null)%7B%0A%09%09    LOGGER.warning(%22Hub is not running. Nothing to stop.%22);%0A%09%09    return null;%0A%09    %7D%0A%0A
         

Fix Exception when trying to restart hub while it is not running