Search in sources :

Example 1 with Handler

use of org.apache.hbase.thirdparty.org.eclipse.jetty.server.Handler in project hbase by apache.

the class HttpServer method start.

/**
 * Start the server. Does not wait for the server to start.
 */
public void start() throws IOException {
    try {
        try {
            openListeners();
            webServer.start();
        } catch (IOException ex) {
            LOG.info("HttpServer.start() threw a non Bind IOException", ex);
            throw ex;
        } catch (MultiException ex) {
            LOG.info("HttpServer.start() threw a MultiException", ex);
            throw ex;
        }
        // Make sure there is no handler failures.
        Handler[] handlers = webServer.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            if (handlers[i].isFailed()) {
                throw new IOException("Problem in starting http server. Server handlers failed");
            }
        }
        // Make sure there are no errors initializing the context.
        Throwable unavailableException = webAppContext.getUnavailableException();
        if (unavailableException != null) {
            // Have to stop the webserver, or else its non-daemon threads
            // will hang forever.
            webServer.stop();
            throw new IOException("Unable to initialize WebAppContext", unavailableException);
        }
    } catch (IOException e) {
        throw e;
    } catch (InterruptedException e) {
        throw (IOException) new InterruptedIOException("Interrupted while starting HTTP server").initCause(e);
    } catch (Exception e) {
        throw new IOException("Problem starting http server", e);
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) Handler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Handler) GzipHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.gzip.GzipHandler) ServletContextHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler) RequestLogHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.RequestLogHandler) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) ServletException(javax.servlet.ServletException) URISyntaxException(java.net.URISyntaxException) MultiException(org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException) FileNotFoundException(java.io.FileNotFoundException) BindException(java.net.BindException) InterruptedIOException(java.io.InterruptedIOException) HadoopIllegalArgumentException(org.apache.hadoop.HadoopIllegalArgumentException) IOException(java.io.IOException)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InterruptedIOException (java.io.InterruptedIOException)1 BindException (java.net.BindException)1 URISyntaxException (java.net.URISyntaxException)1 ServletException (javax.servlet.ServletException)1 HadoopIllegalArgumentException (org.apache.hadoop.HadoopIllegalArgumentException)1 Handler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.Handler)1 RequestLogHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.RequestLogHandler)1 GzipHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.gzip.GzipHandler)1 ServletContextHandler (org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler)1 MultiException (org.apache.hbase.thirdparty.org.eclipse.jetty.util.MultiException)1