|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor
org.apache.cocoon.spring.configurator.impl.SettingsBeanFactoryPostProcessor
This is a bean factory post processor which handles all the settings stuff for Cocoon. It reads in all properties files and replaces references to them in the spring configuration files. In addition this bean acts as a factory bean providing the settings object.
The settings object is created by reading several property files and merging of the values. If there is more than one definition for a property, the last one wins. The property files are read in the following order:
readFromClasspath
is true: classpath*:/META-INF/cocoon/properties/*.properties
Default values for the core and each block - the files are read in alphabetical order.
Actually the files are read in two chunks, the first one containing all property files
from jar files, and the second one containing all property files from WEB-INF/classes.
readFromClasspath
is true: classpath*:/META-INF/cocoon/properties/[RUNNING_MODE]/*.properties
Default values for the core and each block for a specific running mode - the files are
read in alphabetical order.
Actually the files are read in two chunks, the first one containing all property files
from jar files, and the second one containing all property files from WEB-INF/classes.
readFromGlobalLocation
is true: /WEB-INF/cocoon/properties/*.properties
Default values for the core and each block - the files are read in alphabetical order.
Actually the files are read in two chunks, the first one containing all property files
from jar files, and the second one containing all property files from WEB-INF/classes.
readFromGlobalLocation
is true: /WEB-INF/cocoon/properties/[RUNNING_MODE]/*.properties
Default values for the core and each block for a specific running mode - the files are
read in alphabetical order.
Actually the files are read in two chunks, the first one containing all property files
from jar files, and the second one containing all property files from WEB-INF/classes.
AbstractSettingsBeanFactoryPostProcessor.directories
.
AbstractSettingsBeanFactoryPostProcessor.additionalProperties
Nested Class Summary |
Nested classes inherited from class org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor |
AbstractSettingsBeanFactoryPostProcessor.CocoonSettingsResolvingBeanDefinitionVisitor |
Field Summary | |
protected boolean |
readFromClasspath
Should we read the properties from the classpath? |
protected boolean |
readFromGlobalLocation
Should we read the properties from the global location? |
protected String |
runningMode
The running mode for the web application. |
Fields inherited from class org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor |
additionalProperties, beanFactory, directories, logger, resourceLoader, servletContext, settings |
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer |
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE |
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport |
XML_FILE_EXTENSION |
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
SettingsBeanFactoryPostProcessor()
|
Method Summary | |
protected org.apache.cocoon.configuration.MutableSettings |
createSettings()
Create a settings object. |
protected void |
dumpSystemProperties()
Dump System Properties. |
protected void |
forceLoad()
Handle the load-class settings. |
protected String |
getRunningMode()
Get the running mode. |
void |
init()
Initialize this processor. |
protected void |
preInit(org.apache.cocoon.configuration.MutableSettings s,
Properties properties)
This method can be used by subclasses to initialize the settings and/or the properties before createSettings() does it's work. |
void |
setReadFromClasspath(boolean readFromClasspath)
Set if we read property configurations from the classpath. |
void |
setReadFromGlobalLocation(boolean readFromGlobalLocation)
Set if we read property configurations from the global location. |
void |
setRunningMode(String mode)
Set the running mode. |
Methods inherited from class org.apache.cocoon.spring.configurator.impl.AbstractSettingsBeanFactoryPostProcessor |
createMutableSettingsInstance, dumpSettings, getNameForPropertyProvider, getObject, getObjectType, getParentSettings, getResourceLoader, getSystemProperty, getSystemProperty, isSingleton, postInit, processProperties, resolvePlaceholder, setAdditionalProperties, setBeanFactory, setDirectories, setResourceLoader, setServletContext |
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer |
parseStringValue, resolvePlaceholder, resolveSystemProperty, setBeanName, setIgnoreUnresolvablePlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName |
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer |
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder |
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport |
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String runningMode
protected boolean readFromClasspath
Constants.CLASSPATH_PROPERTIES_LOCATION
protected boolean readFromGlobalLocation
Constants.GLOBAL_PROPERTIES_LOCATION
Constructor Detail |
public SettingsBeanFactoryPostProcessor()
Method Detail |
public void setRunningMode(String mode)
mode
- The new running mode.public void setReadFromClasspath(boolean readFromClasspath)
readFromClasspath
- public void setReadFromGlobalLocation(boolean readFromGlobalLocation)
public void init() throws Exception
init
in class AbstractSettingsBeanFactoryPostProcessor
Exception
protected String getRunningMode()
AbstractSettingsBeanFactoryPostProcessor
getRunningMode
in class AbstractSettingsBeanFactoryPostProcessor
AbstractSettingsBeanFactoryPostProcessor.getRunningMode()
protected void preInit(org.apache.cocoon.configuration.MutableSettings s, Properties properties)
AbstractSettingsBeanFactoryPostProcessor
AbstractSettingsBeanFactoryPostProcessor.createSettings()
does it's work.
preInit
in class AbstractSettingsBeanFactoryPostProcessor
protected org.apache.cocoon.configuration.MutableSettings createSettings()
AbstractSettingsBeanFactoryPostProcessor
AbstractSettingsBeanFactoryPostProcessor.createMutableSettingsInstance()
.
AbstractSettingsBeanFactoryPostProcessor.preInit(MutableSettings, Properties)
.
PropertyProvider
if configured in the same application context (or its parent)
AbstractSettingsBeanFactoryPostProcessor.directories
.
AbstractSettingsBeanFactoryPostProcessor.additionalProperties
AbstractSettingsBeanFactoryPostProcessor.postInit(MutableSettings, Properties)
.
createSettings
in class AbstractSettingsBeanFactoryPostProcessor
protected void dumpSystemProperties()
protected void forceLoad()
load-class
settings. This overcomes
limits in many classpath issues. One of the more notorious
ones is a bug in WebSphere that does not load the URL handler
for the classloader://
protocol. In order to
overcome that bug, set org.apache.cocoon.classloader.load.classes.XY
property to
the com.ibm.servlet.classloader.Handler
value.
If you need to load more than one class, then add several
properties, all starting with
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |