本文整理了Java中org.eclipse.jetty.server.Server.isStopped()
方法的一些代码示例,展示了Server.isStopped()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.isStopped()
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:isStopped
暂无
代码示例来源:origin: jphp-group/jphp
@Signature
public boolean isStopped() {
return server.isStopped();
}
代码示例来源:origin: 4thline/cling
@Override
synchronized public void stopIfRunning() {
if (!server.isStopped() && !server.isStopping()) {
log.info("Stopping Jetty server...");
try {
server.stop();
} catch (Exception ex) {
log.severe("Couldn't stop Jetty server: " + ex);
throw new RuntimeException(ex);
} finally {
resetServer();
}
}
}
代码示例来源:origin: SonarSource/sonarqube
@Override
public void stop() {
try {
if (!server.isStopped()) {
server.stop();
writeTimeToFile("terminatedAt");
}
} catch (Exception e) {
throw new IllegalStateException("Fail to stop Jetty", e);
}
}
代码示例来源:origin: kingthy/TVRemoteIME
@Override
synchronized public void stopIfRunning() {
if (!server.isStopped() && !server.isStopping()) {
log.info("Stopping Jetty server...");
try {
server.stop();
} catch (Exception ex) {
log.severe("Couldn't stop Jetty server: " + ex);
throw new RuntimeException(ex);
} finally {
resetServer();
}
}
}
代码示例来源:origin: io.github.factoryfx/jettyFactory
public boolean isStopped() {
return server.isStopped();
}
代码示例来源:origin: lintool/warcbase
public boolean isStopped() {
return server.isStopped();
}
代码示例来源:origin: io.nflow/nflow-jetty
public boolean isStopped() {
return server.isStopped();
}
代码示例来源:origin: io.lighty.modules/lighty-restconf-nb-community
public void startServer() {
if ((this.jettyServer != null) && !this.jettyServer.isStopped()) {
return;
}
try {
this.jettyServer = this.lightyServerBuilder.build();
this.jettyServer.start();
LOG.info("Jetty started");
} catch (final Exception e) {
LOG.error("Failed to start jetty: ", e);
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: kumuluz/kumuluzee
@Override
public void stopServer() {
if (server == null)
throw new IllegalStateException("Jetty has to be initialized before stopping it");
if (server.isStopped() || server.isStopping())
throw new IllegalStateException("Jetty is already stopped");
try {
server.stop();
} catch (Exception e) {
log.severe(e.getMessage());
throw new KumuluzServerException(e.getMessage(), e.getCause());
}
}
代码示例来源:origin: benmfaul/XRTB
/**
* Stop the RTBServer, this will cause an interrupted exception in the run()
* method.
*/
public void halt() {
try {
me.interrupt();
} catch (Exception error) {
System.err.println("Interrupt failed.");
}
try {
server.stop();
while (!server.isStopped())
Thread.sleep(1);
} catch (Exception error) {
error.printStackTrace();
}
try {
logger.error("System shutdown");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
代码示例来源:origin: org.fourthline.cling/cling-core
@Override
synchronized public void stopIfRunning() {
if (!server.isStopped() && !server.isStopping()) {
log.info("Stopping Jetty server...");
try {
server.stop();
} catch (Exception ex) {
log.severe("Couldn't stop Jetty server: " + ex);
throw new RuntimeException(ex);
} finally {
resetServer();
}
}
}
代码示例来源:origin: BetterCloud/vault-java-driver
public static void shutdownMockVault(final Server server) throws Exception {
int attemptCount = 0;
while (!server.isStopped() && attemptCount < 5) {
attemptCount++;
server.stop();
Thread.sleep(1000);
}
}
代码示例来源:origin: apache/juneau
@Override /* Thread */
public void run() {
try {
if (server == null || server.isStopping() || server.isStopped())
return;
listener.onStopServer(JettyMicroservice.this);
out(mb2, "StoppingServer");
server.stop();
out(mb2, "ServerStopped");
listener.onPostStopServer(JettyMicroservice.this);
} catch (Exception e) {
logger.log(Level.WARNING, e.getLocalizedMessage(), e);
}
}
};
代码示例来源:origin: org.apache.juneau/juneau-microservice-server
@Override /* Thread */
public void run() {
try {
if (server == null || server.isStopping() || server.isStopped())
return;
onStopServer();
out(mb2, "StoppingServer");
server.stop();
out(mb2, "ServerStopped");
onPostStopServer();
} catch (Exception e) {
logger.log(Level.WARNING, e.getLocalizedMessage(), e);
}
}
};
代码示例来源:origin: org.apache.edgent/edgent-console-server
/**
* Checks to see if the server is in a "stopping" or "stopped" state
* @return a boolean: true if the server is stopping or stopped, false otherwise
*/
public boolean isServerStopped() {
if (getJettyServer().isStopping() || getJettyServer().isStopped()) {
return true;
}
else {
return false;
}
}
/**
代码示例来源:origin: apache/incubator-edgent
/**
* Checks to see if the server is in a "stopping" or "stopped" state
* @return a boolean: true if the server is stopping or stopped, false otherwise
*/
public boolean isServerStopped() {
if (getJettyServer().isStopping() || getJettyServer().isStopped()) {
return true;
}
else {
return false;
}
}
/**
代码示例来源:origin: ombre42/jrobotremoteserver
if (!server.isStopped()) // old behavior
throw new IllegalStateException("Cannot add a library once the server is started");
if (connector.getPort() != 0 && connector.getPort() != port) {
代码示例来源:origin: it.tidalwave.northernwind.rca/it-tidalwave-northernwind-rca-embeddedserver
/*******************************************************************************************************************
*
******************************************************************************************************************/
@Test(dependsOnMethods = "start_must_properly_boot_the_webserver")
public void stop_must_properly_shut_the_webserver_down()
throws InterruptedException
{
// when
nonSpringUnderTest.start();
Thread.sleep(2000);
nonSpringUnderTest.stop();
// then
assertThat(nonSpringUnderTest.server, is(not(nullValue())));
assertThat(nonSpringUnderTest.server.isStopped(), is(true));
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
loop: while (!getServer().isStopped())
代码示例来源:origin: jenkinsci/winstone
loop: while (!getServer().isStopped())
内容来源于网络,如有侵权,请联系作者删除!