public class SimpleHttpServer extends AbstractHttpServer
HttpServer
that uses Simple Framework to handle requests.AbstractHttpServer.SimpleSecurityContext
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_THREAD_COUNT
Default number of threads to use for request processing.
|
protected int |
m_cThreads
The number of threads that should be used to serve requests.
|
protected org.simpleframework.transport.connect.Connection |
m_server
Simple HTTP server instance.
|
ATTR_SUBJECT, AUTH_BASIC, AUTH_CERT, AUTH_CERT_BASIC, AUTH_NONE, DEFAULT_ADDRESS, DEFAULT_IDENTITY_ASSERTER, DEFAULT_PORT, HEADER_AUTHORIZATION, HEADER_WWW_AUTHENTICATE, HTTP_BASIC_REALM, m_fStarted, m_identityAsserter, m_mapResourceConfig, m_nPort, m_sAddr, m_sAuthMethod, m_serviceParent, m_session, m_socketProvider
Constructor and Description |
---|
SimpleHttpServer()
Construct SimpleHttpServer instance.
|
SimpleHttpServer(int cThreads)
Construct SimpleHttpServer instance.
|
Modifier and Type | Method and Description |
---|---|
protected org.simpleframework.transport.connect.Connection |
createSimpleServer() |
protected Object |
instantiateContainer(org.glassfish.jersey.server.ResourceConfig config, org.glassfish.hk2.api.ServiceLocator locator)
Factory method for Jersey container instances.
|
protected void |
startInternal()
Start the server.
|
protected void |
stopInternal()
Stop the server.
|
authenticate, createContainer, dumpStats, getAverageRequestTime, getErrorCount, getHttpStatusCount, getIdentityAsserter, getLocalAddress, getLocalPort, getParentService, getRequestCount, getRequestsPerSecond, getResourceConfig, getSession, getSocketProvider, getSSLContext, getSSLParameters, getSubjectFromSession, handleRequest, incrementErrors, incrementRequestCount, isAuthMethodBasic, isAuthMethodCert, isAuthMethodNone, isSecure, logRequestTime, logStatusCount, resetStats, setAuthMethod, setIdentityAsserter, setLocalAddress, setLocalPort, setParentService, setResourceConfig, setResourceConfig, setSession, setSocketProvider, start, stop, toString
protected org.simpleframework.transport.connect.Connection m_server
protected final int m_cThreads
Simple uses two thread pools: one to read incoming requests and one to process them. This value applies to both pools, so the number of worker threads created internally by Simple will be double.
protected static final int DEFAULT_THREAD_COUNT
public SimpleHttpServer()
public SimpleHttpServer(int cThreads)
cThreads
- the number of threads to use for request processingprotected void startInternal() throws IOException
startInternal
in class AbstractHttpServer
IOException
- if an error occursprotected void stopInternal() throws IOException
stopInternal
in class AbstractHttpServer
IOException
- if an error occursprotected org.simpleframework.transport.connect.Connection createSimpleServer() throws javax.ws.rs.ProcessingException
javax.ws.rs.ProcessingException
protected Object instantiateContainer(org.glassfish.jersey.server.ResourceConfig config, org.glassfish.hk2.api.ServiceLocator locator)
AbstractHttpServer
instantiateContainer
in class AbstractHttpServer
config
- the resource configurationlocator
- the parent service locator