本文整理了Java中org.eclipse.jetty.server.Server.isRunning()
方法的一些代码示例,展示了Server.isRunning()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.isRunning()
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:isRunning
暂无
代码示例来源:origin: igniterealtime/Openfire
/**
* 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();
}
代码示例来源:origin: linkedin/kafka-monitor
public boolean isRunning() {
return _jettyServer.isRunning();
}
代码示例来源:origin: wiztools/rest-client
public static synchronized void start() throws Exception{
if(!(server.isStarted() || server.isRunning())){
server.start();
}
}
代码示例来源:origin: jphp-group/jphp
@Signature
public boolean isRunning() {
return server.isRunning();
}
代码示例来源:origin: wiztools/rest-client
public static boolean isRunning(){
return server.isRunning() || server.isStarted();
}
代码示例来源:origin: Alluxio/alluxio
try {
CommonUtils.waitFor(this + " to start", () -> {
if (mWebServer == null || !mWebServer.getServer().isRunning()) {
return false;
代码示例来源:origin: spring-projects/spring-framework
@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;
}
}
代码示例来源:origin: jphp-group/jphp
@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;
}
代码示例来源:origin: Alluxio/alluxio
@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;
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* 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;
}
代码示例来源:origin: Alluxio/alluxio
@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;
}
}
代码示例来源:origin: spring-projects/spring-framework
@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();
}
}
}
代码示例来源:origin: Alluxio/alluxio
@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;
}
}
代码示例来源:origin: spring-projects/spring-framework
@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
}
}
}
代码示例来源:origin: apache/flume
Throwables.propagate(ex);
Preconditions.checkArgument(srv.isRunning());
sourceCounter.start();
super.start();
代码示例来源:origin: apache/accumulo
public boolean isRunning() {
return server.isRunning();
}
代码示例来源:origin: apache/nifi
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;
代码示例来源:origin: yacy/yacy_grid_mcp
public static boolean isAlive() {
return server.isRunning() || server.isStarted() || server.isStarting();
}
代码示例来源:origin: com.ning.jetty/ning-service-skeleton-core
@PostConstruct
public void start() throws Exception
{
server.start();
Preconditions.checkState(server.isRunning(), "server is not running");
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public void run()
{
long now=System.currentTimeMillis();
_dateField=new HttpField.CachedHttpField(HttpHeader.DATE,date.formatDate(now));
if (!isRunning())
this.cancel();
}
},tick,1000);
内容来源于网络,如有侵权,请联系作者删除!