本文整理了Java中org.h2.server.web.WebServer.setShutdownHandler()
方法的一些代码示例,展示了WebServer.setShutdownHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServer.setShutdownHandler()
方法的具体详情如下:
包路径:org.h2.server.web.WebServer
类名称:WebServer
方法名:setShutdownHandler
暂无
代码示例来源:origin: com.h2database/h2
/**
* Create a new web server, but does not start it yet. Example:
*
* <pre>
* Server server = Server.createWebServer("-trace").start();
* </pre>
* Supported options are:
* -webPort, -webSSL, -webAllowOthers, -webDaemon,
* -trace, -ifExists, -baseDir, -properties.
* See the main method for details.
*
* @param args the argument list
* @return the server
*/
public static Server createWebServer(String... args) throws SQLException {
WebServer service = new WebServer();
Server server = new Server(service, args);
service.setShutdownHandler(server);
return server;
}
代码示例来源:origin: com.h2database/h2
Server server = new Server();
server.web = web;
webServer.setShutdownHandler(server);
String url = webServer.addSession(conn);
try {
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Create a new web server, but does not start it yet. Example:
*
* <pre>
* Server server = Server.createWebServer(
* new String[] { "-trace" }).start();
* </pre>
*
* @param args
* @return the server
*/
public static Server createWebServer(String[] args) throws SQLException {
WebServer service = new WebServer();
Server server = new Server(service, args);
service.setShutdownHandler(server);
return server;
}
代码示例来源:origin: org.wowtools/h2
/**
* Create a new web server, but does not start it yet. Example:
*
* <pre>
* Server server = Server.createWebServer("-trace").start();
* </pre>
* Supported options are:
* -webPort, -webSSL, -webAllowOthers, -webDaemon,
* -trace, -ifExists, -baseDir, -properties.
* See the main method for details.
*
* @param args the argument list
* @return the server
*/
public static Server createWebServer(String... args) throws SQLException {
WebServer service = new WebServer();
Server server = new Server(service, args);
service.setShutdownHandler(server);
return server;
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Create a new web server, but does not start it yet. Example:
*
* <pre>
* Server server = Server.createWebServer("-trace").start();
* </pre>
* Supported options are:
* -webPort, -webSSL, -webAllowOthers, -webDaemon,
* -trace, -ifExists, -baseDir, -properties.
* See the main method for details.
*
* @param args the argument list
* @return the server
*/
public static Server createWebServer(String... args) throws SQLException {
WebServer service = new WebServer();
Server server = new Server(service, args);
service.setShutdownHandler(server);
return server;
}
代码示例来源: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
}
}
内容来源于网络,如有侵权,请联系作者删除!