public class HttpServer extends AbstractModule<HttpServerConfig>
Wrapper module for the HTTP server engine (Jetty for now)
Modifier and Type | Field and Description |
---|---|
static String |
TEST_MSG |
config, eventHandler, lastError, logger, startRequested, state, stateLock, statusMsg
Constructor and Description |
---|
HttpServer() |
Modifier and Type | Method and Description |
---|---|
void |
addServletSecurity(String pathSpec,
boolean requireAuth) |
void |
addServletSecurity(String pathSpec,
boolean requireAuth,
String... roles) |
protected void |
checkStarted() |
void |
cleanup()
Cleans up all ressources used by the module when deleted
All persistent resources created by the module should be cleaned
when this is called
|
void |
deployServlet(javax.servlet.http.HttpServlet servlet,
Map<String,String> initParams,
String... paths) |
void |
deployServlet(javax.servlet.http.HttpServlet servlet,
String path) |
static HttpServer |
getInstance() |
org.eclipse.jetty.server.Server |
getJettyServer() |
void |
start()
Starts the module synchronously with the current configuration.
Implementations of this method must block until the module is successfully started or send an exception. Module lifecycle events may not be generated when calling this method directly. init() should always be called before start(). |
void |
stop()
Stops the module.
All temporary resources created by the module should be cleaned when this is called (ex: memory, files, connections, etc.) Implementations of this method must block until the module is successfully stopped or send an exception. Module lifecycle events may not be generated when calling this method directly. stop() can be called right after init() even if start() hasn't been called. |
void |
undeployServlet(javax.servlet.http.HttpServlet servlet) |
void |
updateConfig(HttpServerConfig config)
Updates the module's configuration dynamically.
The module must honor this new configuration unless an error is detected. |
canInit, canStart, canStop, clearError, clearStatus, getConfiguration, getCurrentError, getCurrentState, getLocalID, getLogger, getName, getStatusMessage, init, init, isInitialized, isStarted, loadState, notifyConnectionStatus, registerListener, reportError, reportError, reportStatus, requestInit, requestStart, requestStop, saveState, setConfiguration, setState, toString, unregisterListener, waitForState
public static final String TEST_MSG
public static HttpServer getInstance()
public void updateConfig(HttpServerConfig config) throws SensorHubException
IModule
updateConfig
in interface IModule<HttpServerConfig>
updateConfig
in class AbstractModule<HttpServerConfig>
SensorHubException
public void start() throws SensorHubException
IModule
SensorHubException
public void stop() throws SensorHubException
IModule
SensorHubException
protected void checkStarted()
public void deployServlet(javax.servlet.http.HttpServlet servlet, String path)
public void deployServlet(javax.servlet.http.HttpServlet servlet, Map<String,String> initParams, String... paths)
public void undeployServlet(javax.servlet.http.HttpServlet servlet)
public void addServletSecurity(String pathSpec, boolean requireAuth)
public void addServletSecurity(String pathSpec, boolean requireAuth, String... roles)
public void cleanup() throws SensorHubException
IModule
SensorHubException
public org.eclipse.jetty.server.Server getJettyServer()
Copyright © 2016 Sensia Software LLC. All rights reserved.