org.mortbay.jetty.Server.isStarted()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.mortbay.jetty.Server.isStarted()方法的一些代码示例,展示了Server.isStarted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.isStarted()方法的具体详情如下:
包路径:org.mortbay.jetty.Server
类名称:Server
方法名:isStarted

Server.isStarted介绍

暂无

代码示例

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: apache/tajo

/**
 * Test for the availability of the web server
 * 
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Test for the availability of the web server
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: org.apache.tajo/tajo-core

/**
 * Test for the availability of the web server
 * 
 * @return true if the web server is started, false otherwise
 */
public boolean isAlive() {
 return webServer != null && webServer.isStarted();
}

代码示例来源:origin: com.twitter.common/net-http

public synchronized boolean isStarted() {
 return (server != null) && server.isStarted();
}

代码示例来源:origin: net.disy.legato/legato-testing

public boolean isStarted() {
 return server.isStarted();
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public boolean isStarted()
{
  return (httpServer != null) && httpServer.isStarted();
}

代码示例来源:origin: it.unimi.dsi/mg4j-big

/** Returns the port assigned to the server.
 * 
 * @return the port assigned to the server.
 */

public static int getPort() {
  if ( port == 0 ) {
    if ( ! SERVER.isStarted() ) throw new IllegalStateException( "The server is not started yet" );
    port = SERVER.getConnectors()[ 0 ].getLocalPort();
  }
  return port;
}

代码示例来源:origin: it.unimi.di/mg4j

/** Returns the port assigned to the server.
 * 
 * @return the port assigned to the server.
 */

public static int getPort() {
  if ( port == 0 ) {
    if ( ! SERVER.isStarted() ) throw new IllegalStateException( "The server is not started yet" );
    port = SERVER.getConnectors()[ 0 ].getLocalPort();
  }
  return port;
}

代码示例来源:origin: net.disy.legato/legato-testing

private void waitUntilStarted() {
 while (!server.isFailed() && !server.isStarted()) {
  try {
   Thread.sleep(1000);
  }
  catch (final InterruptedException ignored) {
   break;
  }
 }
 if (server.isFailed()) {
  throw new IllegalStateException("Server has failed.");
 }
}

代码示例来源:origin: it.unimi.di/mg4j-big

/** Returns the port assigned to the server.
 * 
 * @return the port assigned to the server.
 */

public static int getPort() {
  if ( port == 0 ) {
    if ( ! SERVER.isStarted() ) throw new IllegalStateException( "The server is not started yet" );
    port = SERVER.getConnectors()[ 0 ].getLocalPort();
  }
  return port;
}

代码示例来源:origin: it.unimi.dsi/mg4j

/** Returns the port assigned to the server.
 * 
 * @return the port assigned to the server.
 */

public static int getPort() {
  if ( port == 0 ) {
    if ( ! SERVER.isStarted() ) throw new IllegalStateException( "The server is not started yet" );
    port = SERVER.getConnectors()[ 0 ].getLocalPort();
  }
  return port;
}

代码示例来源:origin: org.mortbay.jetty/jetty-servlet-tester

/** Create a Socket connector.
 * This methods adds a socket connector to the server
 * @param locahost if true, only listen on local host, else listen on all interfaces.
 * @return A URL to access the server via the socket connector.
 * @throws Exception
 */
public LocalConnector createLocalConnector()
throws Exception
{
  synchronized (this)
  {
    LocalConnector connector = new LocalConnector();
    _server.addConnector(connector);
    
    if (_server.isStarted())
      connector.start();
    
    return connector;
  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

/**
 * @param contextPath The _contextPath to set.
 */
public void setContextPath(String contextPath)
{
  if (contextPath!=null && contextPath.length()>1 && contextPath.endsWith("/"))
    throw new IllegalArgumentException("ends with /");
  _contextPath = contextPath;
  
  if (getServer()!=null && (getServer().isStarting() || getServer().isStarted()))
  {
    Handler[] contextCollections = getServer().getChildHandlersByClass(ContextHandlerCollection.class);
    for (int h=0;contextCollections!=null&& h<contextCollections.length;h++)
      ((ContextHandlerCollection)contextCollections[h]).mapContexts();
  }
}

代码示例来源:origin: net.disy.legato/legato-testing

public void stop() throws Exception {
 if (server.isStopped()) {
  // Nothing to do
 }
 else if (server.isStarting()) {
  waitUntilStarted();
  doStop();
 }
 else if (server.isStarted()) {
  doStop();
 }
 else if (server.isStopping()) {
  waitUntilStopped();
 }
 else if (server.isFailed()) {
  throw new IllegalStateException("Could not stop a server which has failed.");
 }
 else {
  doStop();
 }
}

相关文章