Class WebConfiguration
- java.lang.Object
-
- org.apache.cayenne.configuration.web.WebConfiguration
-
public class WebConfiguration extends 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
Constructors Constructor Description WebConfiguration(javax.servlet.FilterConfig filterConfiguration)WebConfiguration(javax.servlet.ServletConfig servletConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<org.apache.cayenne.di.Module>createModules(org.apache.cayenne.di.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.StringgetConfigurationLocation()Returns a non-null location of an XML Cayenne configuration, extracted from the filter or servlet configuration parameters.StringgetDataDomainName()If you are using multiple configuration files (cayenne-*.xml) this allows you to specify a name for the data domain other than the default name "cayenne" (seeServerRuntimeBuilder).Map<String,String>getOtherParameters()Returns servlet or filter init parameters, excluding those recognized by WebConfiguration.Map<String,String>getParameters()Returns a map of all init parameters from the underlying FilterConfig or ServletConfig object.
-
-
-
Method Detail
-
getConfigurationLocation
public String getConfigurationLocation()
Returns a non-null location of an XML Cayenne configuration, extracted from the filter or servlet configuration parameters.
-
getDataDomainName
public String getDataDomainName()
If you are using multiple configuration files (cayenne-*.xml) this allows you to specify a name for the data domain other than the default name "cayenne" (seeServerRuntimeBuilder). A specific data domain name is useful if you are setting database connection info using properties viaPropertyDataSourceFactory.- Since:
- 4.1
-
createModules
public Collection<org.apache.cayenne.di.Module> createModules(org.apache.cayenne.di.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 implementingModuleinterface. 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 Map<String,String> getParameters()
Returns a map of all init parameters from the underlying FilterConfig or ServletConfig object.
-
-