public interface RequestIntegration
Provides notification services for request/response based containers.
To use acquire an instance from the RequestIntegrationFactory.
The life-cycle of executing requests on any servers should be the following:
fireRawRequest(RebelServletContext, Object, Object)false is received do the following:fireBeforeRequest(RebelServletContext).fireRequestFinally(RebelServletContext) (even if an error occurred).RequestIntegrationFactory,
RequestListener,
Plugin| Modifier and Type | Method and Description |
|---|---|
void |
addRequestListener(org.zeroturnaround.javarebel.RebelServletContext context,
RequestListener listener)
Add a request listener for a web application.
|
void |
addRequestListener(RequestListener listener)
Add a global request listener.
|
void |
fireBeforeRequest(org.zeroturnaround.javarebel.RebelServletContext context)
This must be called before the server handles an HTTP request.
|
boolean |
fireRawRequest(org.zeroturnaround.javarebel.RebelServletContext context,
Object request,
Object response)
This must be called before the server handles an HTTP request
to give a chance to request listeners to fully manage this request.
|
void |
fireRequestFinally(org.zeroturnaround.javarebel.RebelServletContext context)
This must be called at the end of the request (even if an exception occurred).
|
void |
removeRequestListener(org.zeroturnaround.javarebel.RebelServletContext context,
RequestListener listener)
Remove a request listener of a web application.
|
void |
removeRequestListener(RequestListener listener)
Remove a global or a web application(s) specific request listener.
|
boolean fireRawRequest(org.zeroturnaround.javarebel.RebelServletContext context,
Object request,
Object response)
The request and response objects must be valid
and ready to be used for rendering content, redirecting the request etc.
This method must be invoked before any javax.servlet.Filter or
javax.servlet.Servlet is invoked.
If true is returned the server itself must not manage
this request. In this case fireBeforeRequest(RebelServletContext)
and fireRequestFinally(RebelServletContext) must not be called also.
context - the servlet context of this web application.request - an instance of javax.servlet.http.HttpServletRequest.response - an instance of javax.servlet.http.HttpServletResponse.void fireBeforeRequest(org.zeroturnaround.javarebel.RebelServletContext context)
It must be also invoked before any javax.servlet.Filter or
javax.servlet.Servlet is invoked.
However the environment of the given web application must be active.
E.g. Thread.currentThread().getContextClassLoader() must
return the application class loader.
In secure environments the corresponding AccessControlContext
must be set etc.
This must only be called if no request listener has managed this request.
context - the servlet context of this web application.void fireRequestFinally(org.zeroturnaround.javarebel.RebelServletContext context)
This must only be called if no request listener has managed this request.
context - the servlet context of this web application.void addRequestListener(org.zeroturnaround.javarebel.RebelServletContext context,
RequestListener listener)
context - the servlet context of this web application.void removeRequestListener(org.zeroturnaround.javarebel.RebelServletContext context,
RequestListener listener)
context - the servlet context of this web application.void addRequestListener(RequestListener listener)
Global request listeners are invoked before web application specific listeners.
void removeRequestListener(RequestListener listener)
Copyright © 2017. All rights reserved.