Class LfsStore.AppServer

  • Enclosing class:
    LfsStore

    static class LfsStore.AppServer
    extends java.lang.Object
    Tiny web application server for testing
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.jetty.server.ServerConnector connector  
      private org.eclipse.jetty.server.handler.ContextHandlerCollection contexts  
      private org.eclipse.jetty.server.Server server  
      private java.net.URI uri  
    • Constructor Summary

      Constructors 
      Constructor Description
      AppServer​(int port)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) org.eclipse.jetty.servlet.ServletContextHandler addContext​(java.lang.String path)
      Create a new servlet context within the server.
      private void assertNotRunning()  
      (package private) java.net.URI getURI()  
      (package private) void start()  
      (package private) void stop()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • server

        private final org.eclipse.jetty.server.Server server
      • connector

        private final org.eclipse.jetty.server.ServerConnector connector
      • contexts

        private final org.eclipse.jetty.server.handler.ContextHandlerCollection contexts
      • uri

        private java.net.URI uri
    • Constructor Detail

      • AppServer

        AppServer​(int port)
    • Method Detail

      • addContext

        org.eclipse.jetty.servlet.ServletContextHandler addContext​(java.lang.String path)
        Create a new servlet context within the server.

        This method should be invoked before the server is started, once for each context the caller wants to register.

        Parameters:
        path - path of the context; use "/" for the root context if binding to the root is desired.
        Returns:
        the context to add servlets into.
      • start

        void start()
            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        void stop()
           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getURI

        java.net.URI getURI()
      • assertNotRunning

        private void assertNotRunning()