Package one.nio.http
Class HttpServer
- java.lang.Object
-
- one.nio.server.Server
-
- one.nio.http.HttpServer
-
- All Implemented Interfaces:
ServerMXBean
- Direct Known Subclasses:
ManagementServer
public class HttpServer extends Server
-
-
Field Summary
-
Fields inherited from class one.nio.server.Server
acceptors, cleanup, closeSessions, port, selectors, startSync, useWorkers, workers
-
-
Constructor Summary
Constructors Constructor Description HttpServer(HttpServerConfig config, Object... routers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequestHandlers(Object router)HttpSessioncreateSession(Socket socket)protected RequestHandlerfindHandlerByHost(Request request)voidhandleDefault(Request request, HttpSession session)voidhandleRequest(Request request, HttpSession session)-
Methods inherited from class one.nio.server.Server
asyncExecute, getAcceptedSessions, getConnections, getKeepAlive, getQueueAvgBytes, getQueueAvgLength, getQueueMaxBytes, getQueueMaxLength, getRejectedSessions, getRequestsProcessed, getRequestsRejected, getSelectorAvgReady, getSelectorCount, getSelectorMaxReady, getSelectorOperations, getSelectorSessions, getWorkers, getWorkersActive, getWorkersUsed, incRequestsProcessed, incRequestsRejected, reconfigure, register, registerShutdownHook, reset, start, stop
-
-
-
-
Constructor Detail
-
HttpServer
public HttpServer(HttpServerConfig config, Object... routers) throws IOException
- Throws:
IOException
-
-
Method Detail
-
createSession
public HttpSession createSession(Socket socket) throws RejectedSessionException
- Overrides:
createSessionin classServer- Throws:
RejectedSessionException
-
handleRequest
public void handleRequest(Request request, HttpSession session) throws IOException
- Throws:
IOException
-
handleDefault
public void handleDefault(Request request, HttpSession session) throws IOException
- Throws:
IOException
-
addRequestHandlers
public void addRequestHandlers(Object router)
-
findHandlerByHost
protected RequestHandler findHandlerByHost(Request request)
-
-