/** * @return true if server is serving */ public boolean isServing() { return mStarted && !mServer.isShutdown() || !mServer.isTerminated(); } }
@Override public boolean isRunning() { return this.server != null && !this.server.isShutdown(); }
@Override public boolean isRunning() { return this.server != null && !this.server.isShutdown(); }
@Override public void run() { LOGGER.info("JVM is shutting down"); if (!server.isShutdown()) { Daemon.this.stop(); } } });
public void stop() { if (server != null && !server.isShutdown()) { server.shutdown(); try { server.awaitTermination(); } catch (InterruptedException e) { LOG.error("Failed to await termination of gateway", e); } finally { server = null; } } if (brokerClient != null) { brokerClient.close(); brokerClient = null; } } }