Class ComponentConfigurationPropertiesResolverBaseImpl
java.lang.Object
org.apache.fulcrum.yaafi.framework.configuration.ComponentConfigurationPropertiesResolverBaseImpl
- All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable,org.apache.avalon.framework.context.Contextualizable,org.apache.avalon.framework.logger.LogEnabled,ComponentConfigurationPropertiesResolver
- Direct Known Subclasses:
ComponentConfigurationPropertiesResolverImpl
public abstract class ComponentConfigurationPropertiesResolverBaseImpl
extends Object
implements ComponentConfigurationPropertiesResolver, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable
Base class to expand the value and all attributes. This class is intentend
to be sub-classed if you hook up your own configuration mechanism.
- Author:
- Siegfried Goeschl
-
Field Summary
Fields inherited from interface org.apache.fulcrum.yaafi.framework.configuration.ComponentConfigurationPropertiesResolver
COMPONENT_CONFIG_PROPERTIES_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAvalonContext(Properties properties) Add the Avalon context variables.voidconfigure(org.apache.avalon.framework.configuration.Configuration configuration) voidcontextualize(org.apache.avalon.framework.context.Context context) protected InputStreamcreateInputStream(String location) Creates an InputStream using a Locator.voidenableLogging(org.apache.avalon.framework.logger.Logger logger) protected Fileprotected org.apache.avalon.framework.configuration.Configurationprotected org.apache.avalon.framework.context.Contextprotected Stringprotected org.apache.avalon.framework.logger.Loggerprotected PropertiesloadProperties(String fileLocation) Set properties from a file locationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.fulcrum.yaafi.framework.configuration.ComponentConfigurationPropertiesResolver
resolve
-
Constructor Details
-
ComponentConfigurationPropertiesResolverBaseImpl
public ComponentConfigurationPropertiesResolverBaseImpl()
-
-
Method Details
-
enableLogging
public void enableLogging(org.apache.avalon.framework.logger.Logger logger) - Specified by:
enableLoggingin interfaceorg.apache.avalon.framework.logger.LogEnabled- Parameters:
logger- the logger instance- See Also:
-
contextualize
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException - Specified by:
contextualizein interfaceorg.apache.avalon.framework.context.Contextualizable- Parameters:
context- the Context to add- Throws:
org.apache.avalon.framework.context.ContextException- See Also:
-
configure
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException - Specified by:
configurein interfaceorg.apache.avalon.framework.configuration.Configurable- Parameters:
configuration- the configuration object to use- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- See Also:
-
getLogger
protected org.apache.avalon.framework.logger.Logger getLogger()- Returns:
- Returns the logger.
-
getContext
protected org.apache.avalon.framework.context.Context getContext()- Returns:
- Returns the context.
-
getApplicationRootDir
- Returns:
- the home directory of the application
-
getConfiguration
protected org.apache.avalon.framework.configuration.Configuration getConfiguration()- Returns:
- Returns the configuration.
-
getLocation
- Returns:
- Returns the componentConfigurationPropertiesLocation.
-
createInputStream
Creates an InputStream using a Locator.- Parameters:
location- the location of the file- Returns:
- the InputStrem or null if the resource was not found
- Throws:
IOException- if file not found
-
addAvalonContext
protected void addAvalonContext(Properties properties) throws org.apache.avalon.framework.context.ContextException Add the Avalon context variables.- Parameters:
properties- properties to be set- Throws:
org.apache.avalon.framework.context.ContextException- if context not found
-
loadProperties
Set properties from a file location- Parameters:
fileLocation- file location of properties properties to be set- Returns:
- the properties
- Throws:
Exception- if unable to parse the properties file
-