public class DefaultDispatcher extends Object implements WebDispatcher
Also handles some special static URIs if enabled, like /crossdomain.xml or /robots.txt.
If no other dispatcher jumps in, this will take care of handing the request by sending a HTTP/404.
| Constructor and Description |
|---|
DefaultDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
dispatch(WebContext ctx)
Invoked in order to handle the given request.
|
int |
getPriority()
Returns the priority to determine the position in the dispatcher list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdispatch, preparePreDispatchpublic int getPriority()
WebDispatcher
Dispatchers are sorted ascending (lower is better). The default priority is
PriorityCollector.DEFAULT_PRIORITY, the max. value is 998 as everything above
will be handled by the DefaultDispatcher.
getPriority in interface sirius.kernel.di.std.PriorizedgetPriority in interface WebDispatcherpublic boolean dispatch(WebContext ctx) throws Exception
WebDispatcherIf the dispatcher doesn't feel responsible for handling the request, it simply returns false. Otherwise if the request is being handled, true must be returned
Note that no blocking operation must be performed in this method. For any complex interaction, a new thread
should be forked using Tasks.executor(String). Note that even
Response.outputStream(io.netty.handler.codec.http.HttpResponseStatus, String) might
block sooner or later to limit heap memory usage - so fork a thread for any serious work besides checking
responsibilities for handling requests.
dispatch in interface WebDispatcherctx - the request to handleException - in case of an error when parsing or dispatching the requestCopyright © 2018. All rights reserved.