public abstract class RequestHandlerBase extends org.osgl.Osgl.F1<ActionContext,java.lang.Void> implements RequestHandler
Destroyable.Util| Modifier and Type | Field and Description |
|---|---|
protected org.osgl.logging.Logger |
logger |
| Constructor and Description |
|---|
RequestHandlerBase() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Void |
apply(ActionContext context) |
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
|
void |
destroy() |
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.
|
boolean |
isDestroyed() |
RequestHandlerBase |
noContextResoving() |
RequestHandler |
realHandler() |
protected void |
releaseResources() |
boolean |
requireResolveContext()
Returns if the handler require framework to resolve context.
|
java.lang.Class<? extends java.lang.annotation.Annotation> |
scope() |
boolean |
sessionFree()
Returns if the handler is session free or not.
|
RequestHandlerBase |
setExpress() |
RequestHandlerBase |
setSessionFree() |
boolean |
supportPartialPath()
Indicate if this request handler support partial path lookup.
|
static RequestHandlerBase |
wrap(SimpleRequestHandler handler) |
andThen, andThen, applyOrElse, compose, compose, compose, compose, compose, compose, curry, invert, lift, orElse, timesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandle, prepareAuthenticationpublic final java.lang.Void apply(ActionContext context) throws org.osgl.exception.NotAppliedException, org.osgl.Osgl.Break
apply in interface org.osgl.Osgl.Function<ActionContext,java.lang.Void>org.osgl.exception.NotAppliedExceptionorg.osgl.Osgl.Breakpublic RequestHandlerBase setExpress()
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 RequestHandlercontext - the action contexttrue if this handler support direct io thread processingpublic final java.lang.Class<? extends java.lang.annotation.Annotation> scope()
scope in interface Destroyablepublic 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 RequestHandlertrue if the request handler support partial path lookup or false otherwisepublic 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 RequestHandlerpublic RequestHandlerBase noContextResoving()
public RequestHandler realHandler()
public RequestHandlerBase setSessionFree()
public 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 RequestHandlertrue if the handler is session freepublic CORS.Spec corsSpec()
RequestHandlerGet CORS specification that specifically applied to this request handler
corsSpec in interface RequestHandlerpublic CSRF.Spec csrfSpec()
RequestHandlerGet CSRF specification that applied to this request handler
csrfSpec in interface RequestHandlerpublic void destroy()
destroy in interface Destroyablepublic boolean isDestroyed()
isDestroyed in interface Destroyableprotected void releaseResources()
public static RequestHandlerBase wrap(SimpleRequestHandler handler)
Copyright © 2014–2017 ActFramework. All rights reserved.