Class HttpServer

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.HandlerContainer, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    EntityServletServer

    public class HttpServer
    extends org.eclipse.jetty.server.Server
    A Jetty based http file server
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes

        org.eclipse.jetty.util.Attributes.Wrapper
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

        org.eclipse.jetty.util.component.Dumpable.DumpableContainer
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

        _handler
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addHandler​(org.eclipse.jetty.server.Handler handler)
      Adds a handler to this http server
      void addServerStartedListener​(EventListener listener)
      Adds a startup listener.
      void addServerStoppedListener​(EventListener listener)
      Adds a shutdown listener.
      void setHandler​(org.eclipse.jetty.server.Handler handler)  
      void startServer()
      Starts this server.
      void stopServer()
      Stops this server.
      • Methods inherited from class org.eclipse.jetty.server.Server

        addBeanToAllConnectors, addConnector, clearAttributes, doStart, doStop, dump, getAttribute, getAttributeNames, getAttributeNameSet, getConnectors, getDateField, getErrorHandler, getRequestLog, getSessionIdManager, getStopAtShutdown, getStopTimeout, getThreadPool, getURI, getVersion, handle, handleAsync, handleOptions, isDryRun, isDumpAfterStart, isDumpBeforeStop, join, main, removeAttribute, removeConnector, setAttribute, setConnectors, setDryRun, setDumpAfterStart, setDumpBeforeStop, setErrorHandler, setRequestLog, setSessionIdManager, setStopAtShutdown, setStopTimeout, start, toString
      • Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

        destroy, expandChildren, getHandler, getHandlers, handle, insertHandler
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer

        expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        doError, getServer
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addEventListener, addManaged, contains, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        getCachedBeans, getEventListeners
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

        isDumpable
      • Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

        addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
    • Constructor Detail

      • HttpServer

        public HttpServer()
        Instantiates a new HttpServer, using system properties.
      • HttpServer

        public HttpServer​(HttpServerConfiguration configuration)
        Instantiates a new HttpServer.
        Parameters:
        configuration - the server configuration.
    • Method Detail

      • startServer

        public final void startServer()
                               throws Exception
        Starts this server.
        Throws:
        Exception - in case of an exception
      • stopServer

        public final void stopServer()
                              throws Exception
        Stops this server.
        Throws:
        Exception - in case of an exception
      • addServerStartedListener

        public final void addServerStartedListener​(EventListener listener)
        Adds a startup listener.
        Parameters:
        listener - a listener notified when this server is started.
      • addServerStoppedListener

        public final void addServerStoppedListener​(EventListener listener)
        Adds a shutdown listener.
        Parameters:
        listener - a listener notified when this server is stopped.
      • setHandler

        public final void setHandler​(org.eclipse.jetty.server.Handler handler)
        Overrides:
        setHandler in class org.eclipse.jetty.server.handler.HandlerWrapper
      • addHandler

        protected final void addHandler​(org.eclipse.jetty.server.Handler handler)
        Adds a handler to this http server
        Parameters:
        handler - the handler to add