info.magnolia.cms.beans.config
Class PropertiesInitializer

java.lang.Object
  extended by info.magnolia.cms.beans.config.PropertiesInitializer

Deprecated. since 4.5 - replaced by classes in the info.magnolia.init package.

public class PropertiesInitializer
extends Object

This class is responsible for loading the various "magnolia.properties" files, merging them, and substituting variables in their values.

Author:
pbracher, fgiust

Field Summary
static String CONTEXT_ATTRIBUTE_PLACEHOLDER_PREFIX
          Deprecated. Context attribute prefix, to obtain a property definition like ${contextAttribute/property}, that can refer to any context attribute.
static String CONTEXT_PARAM_PLACEHOLDER_PREFIX
          Deprecated. Context parameter prefix, to obtain a property definition like ${contextParam/property}, that can refer to any context parameter.
static String DEFAULT_INITIALIZATION_PARAMETER
          Deprecated. Default value for the MAGNOLIA_INITIALIZATION_FILE parameter.
static String ENV_PROPERTY_PLACEHOLDER_PREFIX
          Deprecated. System property prefix, to obtain a property definition like ${systemProperty/property}, that can refer to any System property.
static String PLACEHOLDER_PREFIX
          Deprecated. Placeholder prefix: "${".
static String PLACEHOLDER_SUFFIX
          Deprecated. Placeholder suffix: "}".
static String SYSTEM_PROPERTY_PLACEHOLDER_PREFIX
          Deprecated. System property prefix, to obtain a property definition like ${systemProperty/property}, that can refer to any System property.
 
Constructor Summary
PropertiesInitializer(ModuleRegistry moduleRegistry)
          Deprecated.  
 
Method Summary
static PropertiesInitializer getInstance()
          Deprecated. since 4.5, use IoC
 void loadAllModuleProperties()
          Deprecated.  
 void loadAllProperties(String propertiesFilesString, String rootPath)
          Deprecated.  
 void loadBeanProperties()
          Deprecated. since 4.5, replaced by a new ClasspathPropertySource("/mgnl-beans.properties").
protected  void loadModuleProperties(List<ModuleDefinition> moduleDefinitions)
          Deprecated. Load the properties defined in the module descriptors.
 boolean loadPropertiesFile(String rootPath, String location)
          Deprecated. Try to load a magnolia.properties file.
 void loadPropertiesFiles(String propertiesLocationString, String rootPath)
          Deprecated.  
 void overloadWithSystemProperties()
          Deprecated. Overload the properties with set system properties.
protected  String parseStringValue(String strVal, Set<String> visitedPlaceholders)
          Deprecated. since 4.5 this is now done by AbstractMagnoliaConfigurationProperties.parseStringValue(java.lang.String, java.util.Set).
static String processPropertyFilesString(javax.servlet.ServletContext context, String servername, String webapp, String propertiesFilesString, String contextPath)
          Deprecated. since 4.5, this is done by DefaultMagnoliaPropertiesResolver.DefaultMagnoliaPropertiesResolver(javax.servlet.ServletContext, info.magnolia.init.MagnoliaInitPaths). Note: when remove this class and method, this code will need to be cleaned up and moved to info.magnolia.init.DefaultMagnoliaPropertiesResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLACEHOLDER_PREFIX

public static final String PLACEHOLDER_PREFIX
Deprecated. 
Placeholder prefix: "${".

See Also:
Constant Field Values

PLACEHOLDER_SUFFIX

public static final String PLACEHOLDER_SUFFIX
Deprecated. 
Placeholder suffix: "}".

See Also:
Constant Field Values

CONTEXT_ATTRIBUTE_PLACEHOLDER_PREFIX

public static final String CONTEXT_ATTRIBUTE_PLACEHOLDER_PREFIX
Deprecated. 
Context attribute prefix, to obtain a property definition like ${contextAttribute/property}, that can refer to any context attribute.

See Also:
Constant Field Values

CONTEXT_PARAM_PLACEHOLDER_PREFIX

public static final String CONTEXT_PARAM_PLACEHOLDER_PREFIX
Deprecated. 
Context parameter prefix, to obtain a property definition like ${contextParam/property}, that can refer to any context parameter.

See Also:
Constant Field Values

SYSTEM_PROPERTY_PLACEHOLDER_PREFIX

public static final String SYSTEM_PROPERTY_PLACEHOLDER_PREFIX
Deprecated. 
System property prefix, to obtain a property definition like ${systemProperty/property}, that can refer to any System property.

See Also:
Constant Field Values

ENV_PROPERTY_PLACEHOLDER_PREFIX

public static final String ENV_PROPERTY_PLACEHOLDER_PREFIX
Deprecated. 
System property prefix, to obtain a property definition like ${systemProperty/property}, that can refer to any System property.

See Also:
Constant Field Values

DEFAULT_INITIALIZATION_PARAMETER

public static final String DEFAULT_INITIALIZATION_PARAMETER
Deprecated. 
Default value for the MAGNOLIA_INITIALIZATION_FILE parameter.

See Also:
Constant Field Values
Constructor Detail

PropertiesInitializer

@Inject
public PropertiesInitializer(ModuleRegistry moduleRegistry)
Deprecated. 
Method Detail

getInstance

public static PropertiesInitializer getInstance()
Deprecated. since 4.5, use IoC


loadAllProperties

public void loadAllProperties(String propertiesFilesString,
                              String rootPath)
Deprecated. 

loadAllModuleProperties

public void loadAllModuleProperties()
Deprecated. 

loadModuleProperties

protected void loadModuleProperties(List<ModuleDefinition> moduleDefinitions)
Deprecated. 
Load the properties defined in the module descriptors. They can get overridden later in the properties files in WEB-INF


loadPropertiesFiles

public void loadPropertiesFiles(String propertiesLocationString,
                                String rootPath)
Deprecated. 

loadBeanProperties

public void loadBeanProperties()
Deprecated. since 4.5, replaced by a new ClasspathPropertySource("/mgnl-beans.properties").

See Also:
DefaultMagnoliaConfigurationProperties

loadPropertiesFile

public boolean loadPropertiesFile(String rootPath,
                                  String location)
Deprecated. 
Try to load a magnolia.properties file.

Parameters:
rootPath -
location -
Returns:

overloadWithSystemProperties

public void overloadWithSystemProperties()
Deprecated. 
Overload the properties with set system properties.


processPropertyFilesString

public static String processPropertyFilesString(javax.servlet.ServletContext context,
                                                String servername,
                                                String webapp,
                                                String propertiesFilesString,
                                                String contextPath)
Deprecated. since 4.5, this is done by DefaultMagnoliaPropertiesResolver.DefaultMagnoliaPropertiesResolver(javax.servlet.ServletContext, info.magnolia.init.MagnoliaInitPaths). Note: when remove this class and method, this code will need to be cleaned up and moved to info.magnolia.init.DefaultMagnoliaPropertiesResolver

Returns the property files configuration string passed, replacing all the needed values: ${servername} will be reaplced with the name of the server, ${webapp} will be replaced with webapp name, ${systemProperty/*} will be replaced with the corresponding system property, ${env/*} will be replaced with the corresponding environment property, and ${contextAttribute/*} and ${contextParam/*} will be replaced with the corresponding attributes or parameters taken from servlet context. This can be very useful for all those application servers that has multiple instances on the same server, like WebSphere. Typical usage in this case: WEB-INF/config/${servername}/${contextAttribute/com.ibm.websphere.servlet.application.host}/magnolia.properties

Parameters:
context - Servlet context
servername - Server name
webapp - Webapp name
propertiesFilesString - a comma separated list of paths.
Returns:
Property file configuration string with everything replaced.

parseStringValue

protected String parseStringValue(String strVal,
                                  Set<String> visitedPlaceholders)
Deprecated. since 4.5 this is now done by AbstractMagnoliaConfigurationProperties.parseStringValue(java.lang.String, java.util.Set).

Parse the given String value recursively, to be able to resolve nested placeholders. Partly borrowed from org.springframework.beans.factory.config.PropertyPlaceholderConfigurer (original author: Juergen Hoeller)



Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.