public class CayenneFilter extends Object implements javax.servlet.Filter
ServerModule
and WebModule
. Any custom modules
are loaded after the two standard ones to allow custom service overrides. Filter
initialization parameters:
Module
interface. These are the custom modules loaded
after the two standard ones that allow users to override any Cayenne runtime aspects,
e.g. RequestHandler
. Each custom module must have a no-arg constructor.
CayenneFilter is a great utility to quickly start a Cayenne application. More advanced apps most likely will not use it, relying on their own configuration mechanism (such as Guice, Spring, etc.)
Modifier and Type | Field and Description |
---|---|
protected javax.servlet.ServletContext |
servletContext |
Constructor and Description |
---|
CayenneFilter() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAlreadyConfigured(javax.servlet.ServletContext context) |
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
protected Collection<Module> |
getAdditionalModules()
Subclasses may override this to specify additional modules that should be included when creating the CayenneRuntime
(in addition to those specified in the web.xml file).
|
void |
init(javax.servlet.FilterConfig config) |
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
protected Collection<Module> getAdditionalModules()
protected void checkAlreadyConfigured(javax.servlet.ServletContext context) throws javax.servlet.ServletException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
Copyright © 2001–2019 Apache Cayenne. All rights reserved.