org.h2.server.web.WebServer.isStopped()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(125)

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

WebServer.isStopped介绍

暂无

代码示例

代码示例来源:origin: com.h2database/h2

try {
  Server.openBrowser(url);
  while (!webServer.isStopped()) {
    Thread.sleep(1000);

代码示例来源:origin: org.wowtools/h2

/**
 * Start a web server and a browser that uses the given connection. The
 * current transaction is preserved. This is specially useful to manually
 * inspect the database when debugging. This method return as soon as the
 * user has disconnected.
 *
 * @param conn the database connection (the database must be open)
 */
public static void startWebServer(Connection conn) throws SQLException {
  WebServer webServer = new WebServer();
  Server web = new Server(webServer, new String[] { "-webPort", "0" });
  web.start();
  Server server = new Server();
  server.web = web;
  webServer.setShutdownHandler(server);
  String url = webServer.addSession(conn);
  try {
    Server.openBrowser(url);
    while (!webServer.isStopped()) {
      Thread.sleep(1000);
    }
  } catch (Exception e) {
    // ignore
  }
}

代码示例来源:origin: com.eventsourcing/h2

/**
 * Start a web server and a browser that uses the given connection. The
 * current transaction is preserved. This is specially useful to manually
 * inspect the database when debugging. This method return as soon as the
 * user has disconnected.
 *
 * @param conn the database connection (the database must be open)
 */
public static void startWebServer(Connection conn) throws SQLException {
  WebServer webServer = new WebServer();
  Server web = new Server(webServer, new String[] { "-webPort", "0" });
  web.start();
  Server server = new Server();
  server.web = web;
  webServer.setShutdownHandler(server);
  String url = webServer.addSession(conn);
  try {
    Server.openBrowser(url);
    while (!webServer.isStopped()) {
      Thread.sleep(1000);
    }
  } catch (Exception e) {
    // ignore
  }
}

相关文章