net.sourceforge.stripes.config
Class RuntimeConfiguration

java.lang.Object
  extended by net.sourceforge.stripes.config.DefaultConfiguration
      extended by net.sourceforge.stripes.config.RuntimeConfiguration
All Implemented Interfaces:
Configuration

public class RuntimeConfiguration
extends DefaultConfiguration

Configuration class that uses the BootstrapPropertyResolver to look for configuration values, and when it cannot find a value, falls back on the DefaultConfiguration to supply default values. In general, the RuntimeConfiguration will operate in the following pattern:

Author:
Tim Fennell

Field Summary
static String ACTION_BEAN_CONTEXT_FACTORY
          The Configuration Key for looking up the name of an ActionBeanContextFactory class.
static String ACTION_BEAN_PROPERTY_BINDER
          The Configuration Key for looking up the name of the ActionResolver class.
static String ACTION_RESOLVER
          The Configuration Key for looking up the name of the ActionResolver class.
static String CORE_INTERCEPTOR_LIST
          The Configuration Key for looking up the comma separated list of core interceptor classes.
static String DEBUG_MODE
          The Configuration Key for enabling debug mode.
static String EXCEPTION_HANDLER
          The Configuration Key for looking up the name of the ExceptionHandler class
static String FORMATTER_FACTORY
          The Configuration Key for looking up the name of the FormatterFactory class.
static String INTERCEPTOR_LIST
          The Configuration Key for looking up the comma separated list of interceptor classes.
static String LOCALE_PICKER
          The Configuration Key for looking up the name of the LocalizationBundleFactory class.
static String LOCALIZATION_BUNDLE_FACTORY
          The Configuration Key for looking up the name of the LocalizationBundleFactory class.
static String MULTIPART_WRAPPER_FACTORY
          The Configuration Key for looking up the name of the MultipartWrapperFactory class
static String POPULATION_STRATEGY
          The Configuration Key for looking up the name of the PopulationStrategy class
static String TAG_ERROR_RENDERER_FACTORY
          The Configuration Key for looking up the name of the TagErrorRendererFactory class
static String TYPE_CONVERTER_FACTORY
          The Configuration Key for looking up the name of the TypeConverterFactory class.
static String VALIDATION_METADATA_PROVIDER
          The Configuration Key for looking up the name of the ValidationMetadataProvider class
 
Constructor Summary
RuntimeConfiguration()
           
 
Method Summary
 void init()
          Calls super.init() then adds Formatters and TypeConverters found in packages listed in BootstrapPropertyResolver.PACKAGES to their respective factories.
protected  ActionBeanContextFactory initActionBeanContextFactory()
          Looks for a class name in config and uses that to create the component.
protected  ActionBeanPropertyBinder initActionBeanPropertyBinder()
          Looks for a class name in config and uses that to create the component.
protected  ActionResolver initActionResolver()
          Looks for a class name in config and uses that to create the component.
protected  Map<LifecycleStage,Collection<Interceptor>> initCoreInterceptors()
          Looks for a list of class names separated by commas under the configuration key CORE_INTERCEPTOR_LIST.
protected  Boolean initDebugMode()
          Looks for a true/false value in config.
protected  ExceptionHandler initExceptionHandler()
          Looks for a class name in config and uses that to create the component.
protected  FormatterFactory initFormatterFactory()
          Looks for a class name in config and uses that to create the component.
protected
<T extends ConfigurableComponent>
T
initializeComponent(Class<T> componentType, String propertyName)
          Internal utility method that is used to implement the main pattern of this class: lookup the name of a class based on a property name, instantiate the named class and initialize it.
protected  Map<LifecycleStage,Collection<Interceptor>> initInterceptors()
          Looks for a list of class names separated by commas under the configuration key INTERCEPTOR_LIST.
protected  Map<LifecycleStage,Collection<Interceptor>> initInterceptors(List classes)
          Splits a comma-separated list of class names and maps each LifecycleStage to the interceptors in the list that intercept it.
protected  LocalePicker initLocalePicker()
          Looks for a class name in config and uses that to create the component.
protected  LocalizationBundleFactory initLocalizationBundleFactory()
          Looks for a class name in config and uses that to create the component.
protected  MultipartWrapperFactory initMultipartWrapperFactory()
          Looks for a class name in config and uses that to create the component.
protected  PopulationStrategy initPopulationStrategy()
          Looks for a class name in config and uses that to create the component.
protected  TagErrorRendererFactory initTagErrorRendererFactory()
          Looks for a class name in config and uses that to create the component.
protected  TypeConverterFactory initTypeConverterFactory()
          Looks for a class name in config and uses that to create the component.
protected  ValidationMetadataProvider initValidationMetadataProvider()
          Looks for a class name in config and uses that to create the component.
 
Methods inherited from class net.sourceforge.stripes.config.DefaultConfiguration
addInterceptor, getActionBeanContextFactory, getActionBeanPropertyBinder, getActionResolver, getBootstrapPropertyResolver, getExceptionHandler, getFormatterFactory, getInterceptors, getLocalePicker, getLocalizationBundleFactory, getMultipartWrapperFactory, getPopulationStrategy, getServletContext, getTagErrorRendererFactory, getTypeConverterFactory, getValidationMetadataProvider, isDebugMode, mergeInterceptorMaps, setBootstrapPropertyResolver, setDebugMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_MODE

public static final String DEBUG_MODE
The Configuration Key for enabling debug mode.

See Also:
Constant Field Values

ACTION_RESOLVER

public static final String ACTION_RESOLVER
The Configuration Key for looking up the name of the ActionResolver class.

See Also:
Constant Field Values

ACTION_BEAN_PROPERTY_BINDER

public static final String ACTION_BEAN_PROPERTY_BINDER
The Configuration Key for looking up the name of the ActionResolver class.

See Also:
Constant Field Values

ACTION_BEAN_CONTEXT_FACTORY

public static final String ACTION_BEAN_CONTEXT_FACTORY
The Configuration Key for looking up the name of an ActionBeanContextFactory class.

See Also:
Constant Field Values

TYPE_CONVERTER_FACTORY

public static final String TYPE_CONVERTER_FACTORY
The Configuration Key for looking up the name of the TypeConverterFactory class.

See Also:
Constant Field Values

LOCALIZATION_BUNDLE_FACTORY

public static final String LOCALIZATION_BUNDLE_FACTORY
The Configuration Key for looking up the name of the LocalizationBundleFactory class.

See Also:
Constant Field Values

LOCALE_PICKER

public static final String LOCALE_PICKER
The Configuration Key for looking up the name of the LocalizationBundleFactory class.

See Also:
Constant Field Values

FORMATTER_FACTORY

public static final String FORMATTER_FACTORY
The Configuration Key for looking up the name of the FormatterFactory class.

See Also:
Constant Field Values

TAG_ERROR_RENDERER_FACTORY

public static final String TAG_ERROR_RENDERER_FACTORY
The Configuration Key for looking up the name of the TagErrorRendererFactory class

See Also:
Constant Field Values

POPULATION_STRATEGY

public static final String POPULATION_STRATEGY
The Configuration Key for looking up the name of the PopulationStrategy class

See Also:
Constant Field Values

EXCEPTION_HANDLER

public static final String EXCEPTION_HANDLER
The Configuration Key for looking up the name of the ExceptionHandler class

See Also:
Constant Field Values

MULTIPART_WRAPPER_FACTORY

public static final String MULTIPART_WRAPPER_FACTORY
The Configuration Key for looking up the name of the MultipartWrapperFactory class

See Also:
Constant Field Values

VALIDATION_METADATA_PROVIDER

public static final String VALIDATION_METADATA_PROVIDER
The Configuration Key for looking up the name of the ValidationMetadataProvider class

See Also:
Constant Field Values

CORE_INTERCEPTOR_LIST

public static final String CORE_INTERCEPTOR_LIST
The Configuration Key for looking up the comma separated list of core interceptor classes.

See Also:
Constant Field Values

INTERCEPTOR_LIST

public static final String INTERCEPTOR_LIST
The Configuration Key for looking up the comma separated list of interceptor classes.

See Also:
Constant Field Values
Constructor Detail

RuntimeConfiguration

public RuntimeConfiguration()
Method Detail

initDebugMode

protected Boolean initDebugMode()
Looks for a true/false value in config.

Overrides:
initDebugMode in class DefaultConfiguration

initActionResolver

protected ActionResolver initActionResolver()
Looks for a class name in config and uses that to create the component.

Overrides:
initActionResolver in class DefaultConfiguration

initActionBeanPropertyBinder

protected ActionBeanPropertyBinder initActionBeanPropertyBinder()
Looks for a class name in config and uses that to create the component.

Overrides:
initActionBeanPropertyBinder in class DefaultConfiguration

initActionBeanContextFactory

protected ActionBeanContextFactory initActionBeanContextFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initActionBeanContextFactory in class DefaultConfiguration

initTypeConverterFactory

protected TypeConverterFactory initTypeConverterFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initTypeConverterFactory in class DefaultConfiguration

initLocalizationBundleFactory

protected LocalizationBundleFactory initLocalizationBundleFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initLocalizationBundleFactory in class DefaultConfiguration

initLocalePicker

protected LocalePicker initLocalePicker()
Looks for a class name in config and uses that to create the component.

Overrides:
initLocalePicker in class DefaultConfiguration

initFormatterFactory

protected FormatterFactory initFormatterFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initFormatterFactory in class DefaultConfiguration

initTagErrorRendererFactory

protected TagErrorRendererFactory initTagErrorRendererFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initTagErrorRendererFactory in class DefaultConfiguration

initPopulationStrategy

protected PopulationStrategy initPopulationStrategy()
Looks for a class name in config and uses that to create the component.

Overrides:
initPopulationStrategy in class DefaultConfiguration

initExceptionHandler

protected ExceptionHandler initExceptionHandler()
Looks for a class name in config and uses that to create the component.

Overrides:
initExceptionHandler in class DefaultConfiguration

initMultipartWrapperFactory

protected MultipartWrapperFactory initMultipartWrapperFactory()
Looks for a class name in config and uses that to create the component.

Overrides:
initMultipartWrapperFactory in class DefaultConfiguration

initValidationMetadataProvider

protected ValidationMetadataProvider initValidationMetadataProvider()
Looks for a class name in config and uses that to create the component.

Overrides:
initValidationMetadataProvider in class DefaultConfiguration

initCoreInterceptors

protected Map<LifecycleStage,Collection<Interceptor>> initCoreInterceptors()
Looks for a list of class names separated by commas under the configuration key CORE_INTERCEPTOR_LIST. White space surrounding the class names is trimmed, the classes instantiated and then stored under the lifecycle stage(s) they should intercept.

Overrides:
initCoreInterceptors in class DefaultConfiguration
Returns:
a Map of LifecycleStage to Collection of Interceptor

initInterceptors

protected Map<LifecycleStage,Collection<Interceptor>> initInterceptors()
Looks for a list of class names separated by commas under the configuration key INTERCEPTOR_LIST. White space surrounding the class names is trimmed, the classes instantiated and then stored under the lifecycle stage(s) they should intercept.

Overrides:
initInterceptors in class DefaultConfiguration
Returns:
a Map of LifecycleStage to Collection of Interceptor

initInterceptors

protected Map<LifecycleStage,Collection<Interceptor>> initInterceptors(List classes)
Splits a comma-separated list of class names and maps each LifecycleStage to the interceptors in the list that intercept it. Also automatically finds Interceptors in packages listed in BootstrapPropertyResolver.PACKAGES if searchExtensionPackages is true.

Returns:
a Map of LifecycleStage to Collection of Interceptor

initializeComponent

protected <T extends ConfigurableComponent> T initializeComponent(Class<T> componentType,
                                                                  String propertyName)
Internal utility method that is used to implement the main pattern of this class: lookup the name of a class based on a property name, instantiate the named class and initialize it.

Parameters:
componentType - a Class object representing a subclass of ConfigurableComponent
propertyName - the name of the property to look up for the class name
Returns:
an instance of the component, or null if one was not configured.

init

public void init()
Calls super.init() then adds Formatters and TypeConverters found in packages listed in BootstrapPropertyResolver.PACKAGES to their respective factories.

Specified by:
init in interface Configuration
Overrides:
init in class DefaultConfiguration


? Copyright 2005-2006, Stripes Development Team.