@ApplicationScoped public final class RequestHandlerProxy extends RequestHandlerBase
Modifier and Type | Class and Description |
---|---|
static class |
RequestHandlerProxy.GroupAfterInterceptor |
static class |
RequestHandlerProxy.GroupExceptionInterceptor |
static class |
RequestHandlerProxy.GroupFinallyInterceptor |
static class |
RequestHandlerProxy.GroupInterceptorWithResult |
Destroyable.Util
Modifier and Type | Field and Description |
---|---|
static RequestHandlerProxy.GroupAfterInterceptor |
GLOBAL_AFTER_INTERCEPTOR |
static RequestHandlerProxy.GroupInterceptorWithResult |
GLOBAL_BEFORE_INTERCEPTOR |
static RequestHandlerProxy.GroupExceptionInterceptor |
GLOBAL_EXCEPTION_INTERCEPTOR |
static RequestHandlerProxy.GroupFinallyInterceptor |
GLOBAL_FINALLY_INTERCEPTOR |
Constructor and Description |
---|
RequestHandlerProxy(String actionMethodName,
App app) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Handler.Visitor visitor) |
String |
action() |
ControllerAction |
actionHandler() |
org.osgl.mvc.result.BadRequest |
badRequestOnMethod(String message) |
String |
contentSecurityPolicy()
Get
Content-Security-Policy that applied to this request handler |
String |
controller() |
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 |
disableContentSecurityPolicy() |
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
|
static <T extends Handler> |
insertInterceptor(List<T> list,
T i) |
org.osgl.mvc.result.NotFound |
notFoundOnMethod(String message) |
void |
prepareAuthentication(ActionContext context)
Setting up handler for authentication.
|
protected void |
registerAfterInterceptor(AfterInterceptor interceptor) |
protected void |
registerBeforeInterceptor(BeforeInterceptor interceptor) |
protected void |
registerExceptionInterceptor(ExceptionInterceptor interceptor) |
protected void |
registerFinallyInterceptor(FinallyInterceptor interceptor) |
static void |
registerGlobalInterceptor(AfterInterceptor interceptor) |
static void |
registerGlobalInterceptor(BeforeInterceptor interceptor) |
static void |
registerGlobalInterceptor(ExceptionInterceptor interceptor) |
static void |
registerGlobalInterceptor(FinallyInterceptor interceptor) |
static void |
registerGlobalInterceptor(GroupInterceptorMetaInfo freeStyleInterceptor) |
static void |
registerGlobalInterceptor(InterceptorMethodMetaInfo interceptor,
InterceptorType type) |
static void |
registerGlobalInterceptors(Class<?> interceptorClass) |
static void |
releaseGlobalResources() |
protected void |
releaseResources() |
boolean |
sessionFree()
Returns if the handler is session free or not.
|
String |
toString() |
apply, destroy, isDestroyed, noContextResoving, realHandler, requireResolveContext, scope, setExpress, setSessionFree, supportPartialPath, wrap
public static final RequestHandlerProxy.GroupInterceptorWithResult GLOBAL_BEFORE_INTERCEPTOR
public static final RequestHandlerProxy.GroupAfterInterceptor GLOBAL_AFTER_INTERCEPTOR
public static final RequestHandlerProxy.GroupFinallyInterceptor GLOBAL_FINALLY_INTERCEPTOR
public static final RequestHandlerProxy.GroupExceptionInterceptor GLOBAL_EXCEPTION_INTERCEPTOR
protected void releaseResources()
releaseResources
in class RequestHandlerBase
public static void releaseGlobalResources()
public String controller()
public String action()
public ControllerAction actionHandler()
public org.osgl.mvc.result.NotFound notFoundOnMethod(String message)
public org.osgl.mvc.result.BadRequest badRequestOnMethod(String message)
public void handle(ActionContext context)
RequestHandler
Invoke handler upon an action context
context
- the context datapublic boolean sessionFree()
RequestHandler
Returns if the handler is session free or not. If a handler is session free then the framework will NOT resolve session
sessionFree
in interface RequestHandler
sessionFree
in class RequestHandlerBase
true
if the handler is session freepublic void prepareAuthentication(ActionContext context)
RequestHandler
Setting up handler for authentication. For example, initialize the missing authentication handler, csrf failure handler.
context
- the current action contextpublic boolean express(ActionContext context)
RequestHandler
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.
Note a handler that implements ExpressHandler
should always return true
for this method
express
in interface RequestHandler
express
in class RequestHandlerBase
context
- the action contexttrue
if this handler support direct io thread processingprotected final void registerBeforeInterceptor(BeforeInterceptor interceptor)
protected final void registerAfterInterceptor(AfterInterceptor interceptor)
protected final void registerExceptionInterceptor(ExceptionInterceptor interceptor)
protected final void registerFinallyInterceptor(FinallyInterceptor interceptor)
public void accept(Handler.Visitor visitor)
public CSRF.Spec csrfSpec()
RequestHandler
Get CSRF specification that applied to this request handler
csrfSpec
in interface RequestHandler
csrfSpec
in class RequestHandlerBase
public String contentSecurityPolicy()
RequestHandler
Get Content-Security-Policy
that applied to this request handler
contentSecurityPolicy
in interface RequestHandler
contentSecurityPolicy
in class RequestHandlerBase
Content-Security-Policy
that applied to this request handlerpublic boolean disableContentSecurityPolicy()
disableContentSecurityPolicy
in interface RequestHandler
disableContentSecurityPolicy
in class RequestHandlerBase
public CORS.Spec corsSpec()
RequestHandler
Get CORS specification that specifically applied to this request handler
corsSpec
in interface RequestHandler
corsSpec
in class RequestHandlerBase
public static void registerGlobalInterceptor(GroupInterceptorMetaInfo freeStyleInterceptor)
public static void registerGlobalInterceptor(InterceptorMethodMetaInfo interceptor, InterceptorType type)
public static void registerGlobalInterceptor(BeforeInterceptor interceptor)
public static void registerGlobalInterceptor(AfterInterceptor interceptor)
public static void registerGlobalInterceptor(FinallyInterceptor interceptor)
public static void registerGlobalInterceptor(ExceptionInterceptor interceptor)
public static void registerGlobalInterceptors(Class<?> interceptorClass)
Copyright © 2014–2018 ActFramework. All rights reserved.