The purpose of this valve is to load a property file and make the information
available on the request as an attribute. The name of the attribute is the
key that is passed into the constructor.
There are 3 different ways to use this object: 1. Provide a key and a
PropertiesConfiguration object 2. Provide a key and a path to a properties
file 3. Provide a string which is used for both the key and as an environment
lookup to find the path to a properties file.
The PropertiesConfiguration object is put on the request and can be consumed
by anyone downstream of this valve
Multiple valves can be configured via Spring and put into the pipeline if
more than one property file is needed.
Spring configuration samples are shown below: /apps/jetspeed/etc/jetspeed-production.propertiesphp-propertiesphp-properties/apps/jetspeed/etc/jetspeed-production.propertiesapp.props
For this last one, an environment variable with the name "app.props" would
contain the file path to the properties file.
public PropertyLoaderValve(String p_sKey,
org.apache.commons.configuration.PropertiesConfiguration p_oPropertiesConfiguration)
PropertyLoaderValve
public PropertyLoaderValve(String p_sKey,
String p_sPropertyFilePath)
PropertyLoaderValve
public PropertyLoaderValve(String p_sEnvironmentKey)
Parameters:
p_sEnvironmentKey - -
This value will be used both as the storage key and as the
name to use when looking up an environment variable. The
environment variable should contain the file path of the
properties file to be loaded
Method Detail
initialize
public void initialize()
throws org.apache.jetspeed.pipeline.PipelineException
Specified by:
initialize in interface org.apache.jetspeed.pipeline.valve.Valve
Throws:
org.apache.jetspeed.pipeline.PipelineException
invoke
public void invoke(org.apache.jetspeed.request.RequestContext p_oRequest,
org.apache.jetspeed.pipeline.valve.ValveContext p_oContext)
throws org.apache.jetspeed.pipeline.PipelineException
Specified by:
invoke in interface org.apache.jetspeed.pipeline.valve.Valve