Package com.helger.xservlet.handler
Class XServletAsyncHandler
- java.lang.Object
-
- com.helger.xservlet.handler.XServletAsyncHandler
-
- All Implemented Interfaces:
IXServletBasicHandler,IXServletHandler
public final class XServletAsyncHandler extends Object implements IXServletHandler
A specialIXServletHandlerthat allows to run requests asynchronously.- Since:
- 9.0.0
- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description XServletAsyncHandler(com.helger.servlet.async.ServletAsyncSpec aAsyncSpec, IXServletHandler aNestedHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.helger.servlet.async.IAsyncServletRunnergetAsyncServletRunner()voidonRequest(javax.servlet.http.HttpServletRequest aHttpRequest, javax.servlet.http.HttpServletResponse aHttpResponse, com.helger.http.EHttpVersion eHttpVersion, com.helger.commons.http.EHttpMethod eHttpMethod, com.helger.web.scope.IRequestWebScope aRequestScope)Handle the servlet action for a certain request and response.voidonServletDestroy()Called upon Servlet destruction.voidonServletInit(com.helger.commons.collection.impl.ICommonsMap<String,String> aInitParams)Called upon Servlet initializationstatic voidsetAsyncServletRunner(com.helger.servlet.async.IAsyncServletRunner aAsyncServletRunner)Set the async runner to be used.StringtoString()
-
-
-
Constructor Detail
-
XServletAsyncHandler
public XServletAsyncHandler(@Nonnull com.helger.servlet.async.ServletAsyncSpec aAsyncSpec, @Nonnull IXServletHandler aNestedHandler)
-
-
Method Detail
-
setAsyncServletRunner
public static void setAsyncServletRunner(@Nonnull com.helger.servlet.async.IAsyncServletRunner aAsyncServletRunner)
Set the async runner to be used.- Parameters:
aAsyncServletRunner- The runner to be used. May not benull.
-
getAsyncServletRunner
@Nonnull public static com.helger.servlet.async.IAsyncServletRunner getAsyncServletRunner()
- Returns:
- The global async runner. Never
null.
-
onServletInit
public void onServletInit(@Nonnull com.helger.commons.collection.impl.ICommonsMap<String,String> aInitParams) throws javax.servlet.ServletException
Description copied from interface:IXServletBasicHandlerCalled upon Servlet initialization- Specified by:
onServletInitin interfaceIXServletBasicHandler- Parameters:
aInitParams- The init parameters. Nevernullbut maybe empty.- Throws:
javax.servlet.ServletException- if something goes wrong
-
onServletDestroy
public void onServletDestroy()
Description copied from interface:IXServletBasicHandlerCalled upon Servlet destruction. May not throw an exception!- Specified by:
onServletDestroyin interfaceIXServletBasicHandler
-
onRequest
public void onRequest(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest, @Nonnull javax.servlet.http.HttpServletResponse aHttpResponse, @Nonnull com.helger.http.EHttpVersion eHttpVersion, @Nonnull com.helger.commons.http.EHttpMethod eHttpMethod, @Nonnull com.helger.web.scope.IRequestWebScope aRequestScope) throws javax.servlet.ServletException, IOException
Description copied from interface:IXServletHandlerHandle the servlet action for a certain request and response.- Specified by:
onRequestin interfaceIXServletHandler- Parameters:
aHttpRequest- HTTP servlet request. Nevernull.aHttpResponse- HTTP servlet response. Nevernull.eHttpVersion- HTTP version. Nevernull.eHttpMethod- HTTP method. Nevernull.aRequestScope- Request scope. Nevernull.- Throws:
javax.servlet.ServletException- On business errorIOException- On IO error
-
-