public class DelegateRequestHandler extends RequestHandlerBase
Base class to implement handler delegation chain
Destroyable.Util| Modifier and Type | Field and Description |
|---|---|
protected RequestHandler |
handler_ |
logger| Modifier | Constructor and Description |
|---|---|
protected |
DelegateRequestHandler(RequestHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
CORS.Spec |
corsSpec()
Get CORS specification that specifically applied to this request handler
|
CSRF.Spec |
csrfSpec()
Get CSRF specification that applied to this request handler
|
boolean |
express(ActionContext context)
Indicate the handler logic is fast enough to be put into network layer’s io thread and does not require to dispatch to worker thread.
|
void |
handle(ActionContext context)
Invoke handler upon an action context
|
protected RequestHandler |
handler() |
void |
prepareAuthentication(ActionContext context)
Setting up handler for authentication.
|
RequestHandler |
realHandler() |
protected void |
releaseResources() |
boolean |
requireResolveContext()
Returns if the handler require framework to resolve context.
|
boolean |
sessionFree()
Returns if the handler is session free or not.
|
boolean |
supportPartialPath()
Indicate if this request handler support partial path lookup.
|
java.lang.String |
toString() |
apply, destroy, isDestroyed, noContextResoving, scope, setExpress, setSessionFree, wrapprotected RequestHandler handler_
protected DelegateRequestHandler(RequestHandler handler)
public boolean express(ActionContext context)
RequestHandlerIndicate the handler logic is fast enough to be put into network layer’s io thread and does not require to dispatch to worker thread.
Note a handler that implements ExpressHandler should always return true for this method
express in interface RequestHandlerexpress in class RequestHandlerBasecontext - the action contexttrue if this handler support direct io thread processingpublic void handle(ActionContext context)
RequestHandlerInvoke handler upon an action context
context - the context datapublic boolean requireResolveContext()
RequestHandlerReturns if the handler require framework to resolve context. Usually it needs to resolve the context so that handler can access request params, session/flash etc. However some static handlers doesn’t require framework to do those things, e.g. StaticFileGetter
requireResolveContext in interface RequestHandlerrequireResolveContext in class RequestHandlerBasepublic boolean supportPartialPath()
RequestHandlerIndicate if this request handler support partial path lookup. Usually this method should return false. However for certain request handler like StaticFileGetter they need to support partial path lookup. Take the example of the following route mapping:
GET /public staticDir: /public which map url path /public to a StaticFileGetter with base dir set to /public, it needs to support all path starts with “/public”, like “/public/js/jquery.js” etc.supportPartialPath in interface RequestHandlersupportPartialPath in class RequestHandlerBasetrue if the request handler support partial path lookup or false otherwiseprotected RequestHandler handler()
public CORS.Spec corsSpec()
RequestHandlerGet CORS specification that specifically applied to this request handler
corsSpec in interface RequestHandlercorsSpec in class RequestHandlerBasepublic CSRF.Spec csrfSpec()
RequestHandlerGet CSRF specification that applied to this request handler
csrfSpec in interface RequestHandlercsrfSpec in class RequestHandlerBasepublic boolean sessionFree()
RequestHandlerReturns if the handler is session free or not. If a handler is session free then the framework will NOT resolve session
sessionFree in interface RequestHandlersessionFree in class RequestHandlerBasetrue if the handler is session freepublic void prepareAuthentication(ActionContext context)
RequestHandlerSetting up handler for authentication. For example, initialize the missing authentication handler, csrf failure handler.
context - the current action contextpublic RequestHandler realHandler()
realHandler in class RequestHandlerBaseprotected void releaseResources()
releaseResources in class RequestHandlerBasepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2017 ActFramework. All rights reserved.