Tabnine Logo
WebServer.setShutdownHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
setShutdownHandler
method
in
org.h2.server.web.WebServer

Best Java code snippets using org.h2.server.web.WebServer.setShutdownHandler (Showing top 7 results out of 315)

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[] { &quot;-trace&quot; }).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
  }
}
org.h2.server.webWebServersetShutdownHandler

Popular methods of WebServer

  • <init>
  • getSession
    Get the web session object for the given session id.
  • init
  • addSession
    Create a session with a given connection.
  • getAllowOthers
  • getFile
    Read the given file from the file system or from the resources.
  • getStartDateTime
  • setAllowChunked
  • setAllowOthers
  • createNewSession
    Create a new web session id and object.
  • generateSessionId
  • getConnection
  • generateSessionId,
  • getConnection,
  • getPort,
  • getSSL,
  • getSessions,
  • getSetting,
  • getSettingNames,
  • getSettings,
  • loadProperties,
  • readTranslations

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Permission (java.security)
    Legacy security code; do not use.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now