- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.handler.AbstractHandler
-
- org.eclipse.jetty.server.handler.AbstractHandlerContainer
-
- org.eclipse.jetty.server.handler.HandlerWrapper
-
- org.eclipse.jetty.server.Server
-
- is.codion.common.http.server.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
-
-
Constructor Summary
Constructors Constructor Description HttpServer()
Instantiates a new HttpServer, using system properties.HttpServer(HttpServerConfiguration configuration)
Instantiates a new HttpServer.
-
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 servervoid
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.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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
-
-
-
-
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 classorg.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
-
-