Class WebServer

java.lang.Object
ch.rswk.util.web.test.WebServer
All Implemented Interfaces:
Closeable, AutoCloseable

public class WebServer extends Object implements Closeable
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • CIPHER_SUITES

      public static final Set<String> CIPHER_SUITES
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      See Also:
    • KEYSTORE_PW

      public static final String KEYSTORE_PW
      See Also:
    • PROTOCOLS

      public static final Set<String> PROTOCOLS
    • SERVER_DOMAIN

      public static final String SERVER_DOMAIN
      See Also:
    • KEYSTORE_FILE

      public static final String KEYSTORE_FILE
      See Also:
    • KEYSTORE

      public static final Path KEYSTORE
    • SSL_CONTEXT_FACTORY

      public static final org.eclipse.jetty.util.ssl.SslContextFactory.Server SSL_CONTEXT_FACTORY
    • CERT_FILE

      public static final String CERT_FILE
      See Also:
    • KEY_FILE

      public static final String KEY_FILE
      See Also:
    • SERVER_URL

      public static final String SERVER_URL
      See Also:
    • port

      private final int port
    • resourceRoot

      private final Path resourceRoot
    • server

      private org.eclipse.jetty.server.Server server
  • Constructor Details

    • WebServer

      public WebServer(int port, Path resourceRoot, @Nullable org.eclipse.jetty.servlet.ServletHolder servletHolder, @Nullable String servletPath)
  • Method Details

    • setupServer

      private void setupServer(@Nullable org.eclipse.jetty.servlet.ServletHolder servletHolder, @Nullable String servletPath)
    • addConnector

      private void addConnector()
    • start

      public void start() throws Exception
      Throws:
      Exception
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • stop

      public void stop() throws Exception
      Throws:
      Exception
    • getUri

      public String getUri()
    • newSslContextFactory

      private static org.eclipse.jetty.util.ssl.SslContextFactory.Server newSslContextFactory()