org.marketcetera.util.auth
Class SpringContext

java.lang.Object
  extended by org.marketcetera.util.auth.Context<SpringSetter<?>>
      extended by org.marketcetera.util.auth.SpringContext

public class SpringContext
extends Context<SpringSetter<?>>

A context for Spring setters (SpringSetter). This context provides a Spring context, which is partially created via a Spring configuration file that instantiates a properties file bean like this one:

 <bean
  id="propertiesFiles"
  class="java.lang.String">
   <constructor-arg
    value="file:src/test/sample_data/auth/auth_user.properties" />
 </bean>
 
or this one
 <util:list id="propertiesFiles">
   <value>file:src/test/sample_data/auth/auth_pwd.properties</value>
 </util:list>
 
The Spring configuration file and the name of the bean are given as arguments to the constructors of this class. In both cases, one or more properties files are thus identified. The newly created context guides its setters to set holder data based on the property values contained in these files: each SpringSetter is associated with a property name, and sets its holder data to the property value.

Since:
0.5.0
Version:
$Id: SpringContext.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
SpringContext(boolean override, String configLocation, String propertiesFilesBean)
          Constructor mirroring superclass constructor.
SpringContext(I18NBoundMessage name, boolean override, String configLocation, String propertiesFilesBean)
          Constructor mirroring superclass constructor.
 
Method Summary
 String getConfigLocation()
          Returns the location of the Spring configuration file.
 String getPropertiesFilesBean()
          Returns the name of the properties file bean.
 void setValues()
          Sets the data of the holders associated with the receivers' setters.
 
Methods inherited from class org.marketcetera.util.auth.Context
add, getName, getOverride, getSetters, printUsage, shouldProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringContext

public SpringContext(I18NBoundMessage name,
                     boolean override,
                     String configLocation,
                     String propertiesFilesBean)
Constructor mirroring superclass constructor. The new context will use the given Spring configuration file and properties file bean.

Parameters:
configLocation - The location of the Spring configuration file.
propertiesFilesBean - The name of the properties file bean.
See Also:
Context.Context(I18NBoundMessage,boolean)

SpringContext

public SpringContext(boolean override,
                     String configLocation,
                     String propertiesFilesBean)
Constructor mirroring superclass constructor. The context name is set automatically to a default value. The new context will use the given Spring configuration file and properties file bean.

Parameters:
configLocation - The location of the Spring configuration file.
propertiesFilesBean - The name of the properties file bean.
See Also:
Context.Context(I18NBoundMessage,boolean)
Method Detail

getConfigLocation

public String getConfigLocation()
Returns the location of the Spring configuration file.

Returns:
The location.

getPropertiesFilesBean

public String getPropertiesFilesBean()
Returns the name of the properties file bean.

Returns:
The name.

setValues

public void setValues()
Description copied from class: Context
Sets the data of the holders associated with the receivers' setters. Setters may be unable/unwilling to set their holder data so, when this method returns, some holders may still have unset data.

Specified by:
setValues in class Context<SpringSetter<?>>


Copyright © 2012. All Rights Reserved.