public class ResourceGetter extends FastRequestHandler
Unlike a FileGetter
, the StaticResourceGetter
read resource from jar packages
Destroyable.Util
DUMB, logger
Constructor and Description |
---|
ResourceGetter(java.lang.String base) |
Modifier and Type | Method and Description |
---|---|
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 void |
handle(java.lang.String path,
ActionContext context) |
protected void |
releaseResources() |
boolean |
supportPartialPath()
Indicate if this request handler support partial path lookup.
|
java.lang.String |
toString() |
csrfSpec, prepareAuthentication, requireResolveContext, sessionFree
apply, corsSpec, destroy, isDestroyed, noContextResoving, realHandler, scope, setExpress, setSessionFree, wrap
protected void releaseResources()
releaseResources
in class RequestHandlerBase
public 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 processingpublic void handle(ActionContext context)
RequestHandler
Invoke handler upon an action context
context
- the context dataprotected void handle(java.lang.String path, ActionContext context)
public boolean supportPartialPath()
RequestHandler
Indicate if this request handler support partial path lookup. Usually this method should return false
. However for certain request handler like FileGetter
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 RequestHandler
supportPartialPath
in class RequestHandlerBase
true
if the request handler support partial path lookup or false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2017 ActFramework. All rights reserved.