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 WebConfiguration

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

    public class WebConfiguration

extends java.lang.Object

A class that provides access to common Cayenne web configuration parameters retrieved either from a FilterConfig or a ServletConfig configuration.

Since:
  3.1

Constructor Summary
`WebConfiguration(javax.servlet.FilterConfig filterConfiguration)`
`WebConfiguration(javax.servlet.ServletConfig servletConfiguration)`

Method Summary
`java.util.Collection<Module>` | `createModules(Module... standardModules)` Creates and returns a collection of modules made of provided standard modules and extra custom modules specified via an optional "extra-modules" init parameter.
`java.lang.String` | `getConfigurationLocation()` Returns a non-null location of an XML Cayenne configuration, extracted from the filter or servlet configuration parameters.
`java.util.Map<java.lang.String,java.lang.String>` | `getOtherParameters()` Returns servlet or filter init parameters, excluding those recognized by WebConfiguration.
`java.util.Map<java.lang.String,java.lang.String>` | `getParameters()` Returns a map of all init parameters from the underlying FilterConfig or ServletConfig object.

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

Constructor Detail

### WebConfiguration

    public WebConfiguration(javax.servlet.ServletConfig servletConfiguration)

### WebConfiguration

    public WebConfiguration(javax.servlet.FilterConfig filterConfiguration)

Method Detail

### getConfigurationLocation

    public java.lang.String getConfigurationLocation()

  Returns a non-null location of an XML Cayenne configuration, extracted from the filter or servlet configuration parameters.

### createModules

    public java.util.Collection<Module> createModules(Module... standardModules)
                                               throws javax.servlet.ServletException

  Creates and returns a collection of modules made of provided standard modules and extra custom modules specified via an optional "extra-modules" init parameter. The value of the parameter is expected to be a comma or space-separated list of class names, with each class implementing `Module` interface. Each custom module must have a no-arg constructor. If a module of this type is already in the modules collection, such module is skipped.

  Throws:
    `javax.servlet.ServletException`

### getParameters

    public java.util.Map<java.lang.String,java.lang.String> getParameters()

  Returns a map of all init parameters from the underlying FilterConfig or ServletConfig object.

### getOtherParameters

    public java.util.Map<java.lang.String,java.lang.String> getOtherParameters()

  Returns servlet or filter init parameters, excluding those recognized by WebConfiguration. Namely 'configuration-location' and 'extra-modules' parameters are removed from the returned map.

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.