Package com.xpn.xwiki.web
Class XWikiContextInitializationFilter
- java.lang.Object
-
- com.xpn.xwiki.web.XWikiContextInitializationFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class XWikiContextInitializationFilter extends Object implements javax.servlet.Filter
This filter can be used to initialize the XWiki context before processing a request.- Since:
- 13.4RC1
- Version:
- $Id: 0070b2bfd5fee385eefdb338f96d7182b58d946a $
-
-
Constructor Summary
Constructors Constructor Description XWikiContextInitializationFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanupComponents()
We must ensure we clean the ThreadLocal variables located in the Container and Execution components as otherwise we will have a potential memory leak.void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
void
init(javax.servlet.FilterConfig filterConfig)
protected void
initializeContainerComponent(XWikiContext context)
protected void
initializeXWikiContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
Initializes the XWiki context.
-
-
-
Method Detail
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
initializeXWikiContext
protected void initializeXWikiContext(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException
Initializes the XWiki context.- Parameters:
request
- the request being processedresponse
- the response- Throws:
javax.servlet.ServletException
- if the initialization fails
-
initializeContainerComponent
protected void initializeContainerComponent(XWikiContext context) throws javax.servlet.ServletException
- Parameters:
context
- the XWiki context- Throws:
javax.servlet.ServletException
- if the container component initialization fails
-
cleanupComponents
protected void cleanupComponents()
We must ensure we clean the ThreadLocal variables located in the Container and Execution components as otherwise we will have a potential memory leak.
-
-