Package com.avoka.fc.core.servlet
Class DataContextFilter
- java.lang.Object
-
- com.avoka.fc.core.servlet.DataContextFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
The DataContextFilter logger.protected ServletContext
servletContext
-
Constructor Summary
Constructors Constructor Description DataContextFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroy the DataContextFilter.void
doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)
This filter binds the session DataContext to the current thread, and removes the DataContext from the thread once the chained request has completed.void
init(FilterConfig config)
Initialize the Cayenne runtime.
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
The DataContextFilter logger.
-
servletContext
protected ServletContext servletContext
-
-
Method Detail
-
init
public void init(FilterConfig config) throws ServletException
Initialize the Cayenne runtime.- Specified by:
init
in interfaceFilter
- Parameters:
config
- the filter configuration- Throws:
ServletException
- if an initialization error occurs- See Also:
Filter.init(FilterConfig)
-
destroy
public void destroy()
Destroy the DataContextFilter.- Specified by:
destroy
in interfaceFilter
- See Also:
Filter.destroy()
-
doFilter
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException
This filter binds the session DataContext to the current thread, and removes the DataContext from the thread once the chained request has completed.- Specified by:
doFilter
in interfaceFilter
- Parameters:
servletRequest
- the servlet requestservletResponse
- the servlet responsechain
- the filter chain- Throws:
IOException
- if an I/O error occursServletException
- if a servlet error occurs- See Also:
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
-
-