public final class Dispatcher extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Dispatcher.Router
Programmatic router.
|
| Modifier and Type | Field and Description |
|---|---|
static Handler |
endRequestHandler
End request handler, handle after all handlers.
|
static List<Handler> |
HANDLERS
Handlers.
|
static Handler |
startRequestHandler
Start request handler, handle before all handlers.
|
| Constructor and Description |
|---|
Dispatcher() |
| Modifier and Type | Method and Description |
|---|---|
static Dispatcher.Router |
delete(String uriTemplate,
ContextHandler handler)
HTTP DELETE routing.
|
static void |
error(String uriTemplate,
ContextHandler handler)
Error status routing.
|
static Dispatcher.Router |
get(String uriTemplate,
ContextHandler handler)
HTTP GET routing.
|
static RequestContext |
handle(Request request,
Response response)
Handle flow.
|
static void |
mapping()
Performs mapping for all routers.
|
static Dispatcher.Router |
post(String uriTemplate,
ContextHandler handler)
HTTP POST routing.
|
static Dispatcher.Router |
put(String uriTemplate,
ContextHandler handler)
HTTP PUT routing.
|
static void |
renderResponse(RequestContext context)
Renders HTTP response.
|
static Dispatcher.Router |
route()
Registers a new router.
|
static void |
webSocket(String uri,
WebSocketChannel webSocketChannel)
WebSocket channel routing.
|
public static Handler startRequestHandler
public static Handler endRequestHandler
public static RequestContext handle(Request request, Response response)
request - the specified requestresponse - the specified responsepublic static void renderResponse(RequestContext context)
context - RequestContextpublic static Dispatcher.Router delete(String uriTemplate, ContextHandler handler)
uriTemplate - the specified request URI templatehandler - the specified handlerpublic static Dispatcher.Router put(String uriTemplate, ContextHandler handler)
uriTemplate - the specified request URI templatehandler - the specified handlerpublic static Dispatcher.Router get(String uriTemplate, ContextHandler handler)
uriTemplate - the specified request URI templatehandler - the specified handlerpublic static Dispatcher.Router post(String uriTemplate, ContextHandler handler)
uriTemplate - the specified request URI templatehandler - the specified handlerpublic static Dispatcher.Router route()
public static void error(String uriTemplate, ContextHandler handler)
uriTemplate - the specified request URI templatehandler - the specified handlerpublic static void webSocket(String uri, WebSocketChannel webSocketChannel)
uri - the specified URIwebSocketChannel - the specified WebSocket channelpublic static void mapping()
Copyright © 2009–2019 B3log. All rights reserved.