/** * Returns true if the HTTP binding server is currently enabled. * * @return true if the HTTP binding server is currently enabled. */ public boolean isHttpBindEnabled() { return httpBindServer != null && httpBindServer.isRunning(); }
public boolean isRunning() { return _jettyServer.isRunning(); }
public static synchronized void start() throws Exception{ if(!(server.isStarted() || server.isRunning())){ server.start(); } }
@Signature public boolean isRunning() { return server.isRunning(); }
public static boolean isRunning(){ return server.isRunning() || server.isStarted(); }
try { CommonUtils.waitFor(this + " to start", () -> { if (mWebServer == null || !mWebServer.getServer().isRunning()) { return false;
@Override protected void resetInternal() { try { if (this.jettyServer.isRunning()) { this.jettyServer.setStopTimeout(5000); this.jettyServer.stop(); this.jettyServer.destroy(); } } catch (Exception ex) { throw new IllegalStateException(ex); } finally { this.jettyServer = null; this.contextHandler = null; } }
@Signature public boolean unlisten(Environment env, String value) { if (server.isRunning()) { env.exception("Unable to unlisten() for running server"); } String host = "0.0.0.0"; String port = "80"; if (value.contains(":")) { String[] strings = value.split("\\:"); host = strings[0]; if (strings.length > 1) { port = strings[1]; } } for (Connector connector : server.getConnectors()) { if (connector.getName().equals(host + ":" + port)) { server.removeConnector(connector); return true; } } return false; }
@Override public boolean waitForReady(int timeoutMs) { try { CommonUtils.waitFor(this + " to start", () -> isServing() && mWebServer != null && mWebServer.getServer().isRunning(), WaitForOptions.defaults().setTimeoutMs(timeoutMs)); return true; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } catch (TimeoutException e) { return false; } }
/** * Shuts down the Jetty server. * */ protected void shutdown() { // Remove listener for certificate events if (certificateListener != null) { CertificateManager.removeListener(certificateListener); } //noinspection ConstantConditions try { if (adminServer != null && adminServer.isRunning()) { adminServer.stop(); } } catch (Exception e) { Log.error("Error stopping admin console server", e); } if (contexts != null ) { try { contexts.stop(); contexts.destroy(); } catch ( Exception e ) { Log.error("Error stopping admin console server", e); } } adminServer = null; contexts = null; }
@Override public boolean waitForReady(int timeoutMs) { try { CommonUtils.waitFor(this + " to start", () -> isServing() && mWebServer != null && mWebServer.getServer().isRunning(), WaitForOptions.defaults().setTimeoutMs(timeoutMs)); return true; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } catch (TimeoutException e) { return false; } }
@Override public void stop() throws Exception { try { if (this.contextHandler.isRunning()) { this.contextHandler.stop(); } } finally { if (this.jettyServer.isRunning()) { this.jettyServer.setStopTimeout(5000); this.jettyServer.stop(); } } }
@Override public boolean waitForReady(int timeoutMs) { try { CommonUtils.waitFor(this + " to start", () -> isServing() && mRegistry.get(BlockWorker.class).getWorkerId() != null && mWebServer != null && mWebServer.getServer().isRunning(), WaitForOptions.defaults().setTimeoutMs(timeoutMs)); return true; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } catch (TimeoutException e) { return false; } }
@Override protected void stopInternal() throws Exception { try { if (this.contextHandler.isRunning()) { this.contextHandler.stop(); } } finally { try { if (this.jettyServer.isRunning()) { this.jettyServer.setStopTimeout(5000); this.jettyServer.stop(); this.jettyServer.destroy(); } } catch (Exception ex) { // ignore } } }
Throwables.propagate(ex); Preconditions.checkArgument(srv.isRunning()); sourceCounter.start(); super.start();
public boolean isRunning() { return server.isRunning(); }
public void startServer(final ConfigurationContext context) throws Exception { if (server != null && server.isRunning()) { getLogger().info("A WebSocket server is already running. {}", new Object[]{server}); return;
public static boolean isAlive() { return server.isRunning() || server.isStarted() || server.isStarting(); }
@PostConstruct public void start() throws Exception { server.start(); Preconditions.checkState(server.isRunning(), "server is not running"); }
@Override public void run() { long now=System.currentTimeMillis(); _dateField=new HttpField.CachedHttpField(HttpHeader.DATE,date.formatDate(now)); if (!isRunning()) this.cancel(); } },tick,1000);