public class HttpServer extends org.eclipse.jetty.server.Server implements Server.AuxiliaryServer
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
Modifier and Type | Field and Description |
---|---|
static PropertyValue<java.lang.String> |
DOCUMENT_ROOT
Specifies the document root for file serving
. |
static PropertyValue<java.lang.String> |
HTTP_SERVER_KEYSTORE_PASSWORD
Specifies the password for the keystore used for securing http connections.
Value type: String Default value: null |
static PropertyValue<java.lang.String> |
HTTP_SERVER_KEYSTORE_PATH
Specifies the keystore to use for securing http connections.
Value type: String Default value: null |
static PropertyValue<java.lang.Integer> |
HTTP_SERVER_PORT
The port on which the http server is made available to clients.
Value type: Integer Default value: 8080 |
static PropertyValue<java.lang.Boolean> |
HTTP_SERVER_SECURE
Specifies whether https should be used.
Value type: Boolean Default value: true |
Constructor and Description |
---|
HttpServer(Server connectionServer)
Instantiates a new HttpServer on the given port.
|
HttpServer(Server connectionServer,
java.lang.String documentRoot,
java.lang.Integer port,
java.lang.Boolean useHttps)
Instantiates a new HttpServer on the given port.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addHandler(org.eclipse.jetty.server.Handler handler)
Adds a handler to this http server
|
protected Server |
getConnectionServer() |
void |
startServer()
Starts the server, returns when the server has completed the startup
|
void |
stopServer()
Stops the server, returns when the server has completed shutdown
|
addConnector, clearAttributes, doStart, doStop, dump, getAttribute, getAttributeNames, getConnectors, getDateField, getErrorHandler, getRequestLog, getSessionIdManager, getStopAtShutdown, getThreadPool, getURI, getVersion, handle, handleAsync, handleOptions, isDumpAfterStart, isDumpBeforeStop, join, main, removeAttribute, removeConnector, setAttribute, setConnectors, setDumpAfterStart, setDumpBeforeStop, setErrorHandler, setRequestLog, setSessionIdManager, setStopAtShutdown, setStopTimeout, start, toString
destroy, expandChildren, getHandler, getHandlers, handle, insertHandler, setHandler
doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
addBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final PropertyValue<java.lang.Integer> HTTP_SERVER_PORT
public static final PropertyValue<java.lang.Boolean> HTTP_SERVER_SECURE
public static final PropertyValue<java.lang.String> HTTP_SERVER_KEYSTORE_PATH
public static final PropertyValue<java.lang.String> HTTP_SERVER_KEYSTORE_PASSWORD
public static final PropertyValue<java.lang.String> DOCUMENT_ROOT
public HttpServer(Server connectionServer)
connectionServer
- the Server serving the connection requestspublic HttpServer(Server connectionServer, java.lang.String documentRoot, java.lang.Integer port, java.lang.Boolean useHttps)
connectionServer
- the Server serving the connection requestsdocumentRoot
- the document root, null to disable file servingport
- the port on which to serveuseHttps
- true if https should be usedpublic final void startServer() throws java.lang.Exception
startServer
in interface Server.AuxiliaryServer
java.lang.Exception
- in case of an exceptionpublic void stopServer() throws java.lang.Exception
stopServer
in interface Server.AuxiliaryServer
java.lang.Exception
- in case of an exceptionprotected final void addHandler(org.eclipse.jetty.server.Handler handler)
handler
- the handler to add