server = null;
    public void stop() {        mainThread = null;                getLogger().info("Shutting down Helma");        appManager.stopAll();        if (http != null) {            try {                http.stop();                http.destroy();            } catch (InterruptedException irx) {                // http.stop() interrupted by another thread. ignore.            }        }                if (helmaLogging) {            Logging.shutdown();        }                try {            Runtime.getRuntime().removeShutdownHook(shutdownhook);        } catch (Exception x) {            // invalid shutdown hook or already shutting down. ignore.        }                server = null;    }