| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private Handler | |
| private Server |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Handler | |
| public ManagedSession | getManagedSession(Request request)
Implements org.
|
| public Server | getServer()
Implements abstract org. Implements org.
|
| public boolean | handle(Request
the HTTP request to handle request, Response the HTTP response to handle response, Callback the callback to complete when the handling is complete callback)Implements org. Invoked to handle the passed HTTP request and response. |
| public Session. | |
| public void | setHandler(Handler
The handler)Handler to set as a childImplements org.
|
| public void | setServer(Server
the server)Server to associate to this HandlerImplements org. Set the |
| _handler | back to summary |
|---|---|
| private Handler _handler | |
| _server | back to summary |
|---|---|
| private Server _server | |
| SessionHandler | back to summary |
|---|---|
| public SessionHandler() | |
| getHandler | back to summary |
|---|---|
| public Handler getHandler() Implements org.
| |
| getManagedSession | back to summary |
|---|---|
| public ManagedSession getManagedSession(Request request) Implements org.
| |
| getServer | back to summary |
|---|---|
| public Server getServer() Implements abstract org. Implements org.
| |
| handle | back to summary |
|---|---|
| public boolean handle(Request request, Response response, Callback callback) throws Exception Implements org. Doc from org. Invoked to handle the passed HTTP request and response. The request is accepted by returning true, then handling must be concluded by completing the passed callback. The handling may be asynchronous, i.e. this method may return true and complete the given callback later, possibly from a different thread. If this method returns false, then the callback must not be invoked and any mutation on the response reversed. Exceptions thrown by this method may be subsequently handled by an error The simplest implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
callback.succeeded();
return true;
}
A HelloWorld implementation is:
public boolean handle(Request request, Response response, Callback callback)
{
response.write(true, ByteBuffer.wrap("Hello World\n".getBytes(StandardCharsets.UTF_8)), callback);
return true;
}
| |
| newSessionAPIWrapper | back to summary |
|---|---|
| public Session. Implements org.
| |
| setHandler | back to summary |
|---|---|
| public void setHandler(Handler handler) Implements org.
| |
| setServer | back to summary |
|---|---|
| public void setServer(Server server) Implements org. Doc from org. Set the | |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private Response | |
| private final AtomicReference |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ManagedSession | |
| public Session | getSession(boolean
True if the session should be created for the request. create)Overrides org. Implements org. Get a |
| public boolean | |
| pack-priv void |
| _requestedSessionId | back to summary |
|---|---|
| private String _requestedSessionId | |
| _response | back to summary |
|---|---|
| private Response _response | |
| _session | back to summary |
|---|---|
| private final AtomicReference<ManagedSession> _session | |
| SessionRequest | back to summary |
|---|---|
| public SessionRequest(Request request) | |
| getManagedSession | back to summary |
|---|---|
| pack-priv ManagedSession getManagedSession() | |
| getSession | back to summary |
|---|---|
| public Session getSession(boolean create) Overrides org. Implements org. Doc from org. Get a | |
| process | back to summary |
|---|---|
| public boolean process(Request. | |
| setManagedSession | back to summary |
|---|---|
| pack-priv void setManagedSession(ManagedSession session) | |