Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.configuration.web
Class CayenneFilter

    java.lang.Object
      org.apache.cayenne.configuration.web.CayenneFilter

All Implemented Interfaces:
  javax.servlet.Filter

Direct Known Subclasses:
  WebApplicationContextFilter

    public class CayenneFilter

extends java.lang.Object
implements javax.servlet.Filter

A filter that creates a Cayenne server runtime, possibly including custom modules. By default runtime includes `ServerModule` and `WebModule`. Any custom modules are loaded after the two standard ones to allow custom service overrides. Filter initialization parameters:

- configuration-location - (optional) a name of Cayenne configuration XML file that will be used to load Cayenne stack. If missing, the filter name will be used to derive the location. ".xml" extension will be appended to the filter name to get the location, so a filter named "cayenne-foo" will result in location "cayenne-foo.xml".
- extra-modules - (optional) a comma or space-separated list of class names, with each class implementing `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.)

Since:
  3.1

Field Summary
`protected javax.servlet.ServletContext` | `servletContext`

Constructor Summary
`CayenneFilter()`

Method Summary
`void` | `destroy()`
`void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)`
`void` | `init(javax.servlet.FilterConfig config)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### servletContext

    protected javax.servlet.ServletContext servletContext

Constructor Detail

### CayenneFilter

    public CayenneFilter()

Method Detail

### init

    public void init(javax.servlet.FilterConfig config)
              throws javax.servlet.ServletException

  Specified by:
    `init` in interface `javax.servlet.Filter`
  Throws:
    `javax.servlet.ServletException`

### destroy

    public void destroy()

  Specified by:
    `destroy` in interface `javax.servlet.Filter`

### doFilter

    public void doFilter(javax.servlet.ServletRequest request,
                         javax.servlet.ServletResponse response,
                         javax.servlet.FilterChain chain)
                  throws java.io.IOException,
                         javax.servlet.ServletException

  Specified by:
    `doFilter` in interface `javax.servlet.Filter`
  Throws:
    `java.io.IOException`
    `javax.servlet.ServletException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.