com.germinus.easyconf
Class AggregatedProperties

java.lang.Object
  extended by CompositeConfiguration
      extended by com.germinus.easyconf.AggregatedProperties

public class AggregatedProperties
extends CompositeConfiguration

Provides configuration properties from several sources making distintion from:

It also knows the source the a property to offer user information.

Author:
jferrer

Field Summary
private  CompositeConfiguration baseConf
           
private  boolean baseConfigurationLoaded
           
private  java.lang.String companyId
           
private  java.lang.String componentName
           
private  CompositeConfiguration globalConf
           
private  java.util.List loadedSources
           
private static Log log
           
private  Configuration prefixedSystemConfiguration
           
private  SystemConfiguration systemConfiguration
           
 
Constructor Summary
AggregatedProperties(java.lang.String companyId, java.lang.String componentName)
           
 
Method Summary
 void addBaseFileName(java.lang.String fileName)
           
private  Configuration addDatasourceProperties(java.lang.String datasourcePath)
           
private  Configuration addFileProperties(java.lang.String fileName, CompositeConfiguration loadedConf)
           
 void addGlobalFileName(java.lang.String fileName)
           
private  void addIncludedPropertiesSources(Configuration newConf, CompositeConfiguration loadedConf)
           
private  Configuration addJndiProperties(java.lang.String sourcePath)
           
private  Configuration addPropertiesSource(java.lang.String sourceName, CompositeConfiguration loadedConf)
          Read the given source of properties and add it to the composite configuration.
 java.lang.String getComponentName()
           
private  java.lang.String getPrefix()
           
 java.lang.Object getProperty(java.lang.String key)
          Look for the property in environment, global and base configuration, in this order
private  java.lang.Long getReloadDelay(CompositeConfiguration loadedConf, FileConfiguration newConf)
           
 boolean hasBaseConfiguration()
           
 java.util.List loadedSources()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Log log

baseConf

private CompositeConfiguration baseConf

globalConf

private CompositeConfiguration globalConf

systemConfiguration

private SystemConfiguration systemConfiguration

prefixedSystemConfiguration

private Configuration prefixedSystemConfiguration

componentName

private java.lang.String componentName

companyId

private java.lang.String companyId

loadedSources

private java.util.List loadedSources

baseConfigurationLoaded

private boolean baseConfigurationLoaded
Constructor Detail

AggregatedProperties

public AggregatedProperties(java.lang.String companyId,
                            java.lang.String componentName)
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Look for the property in environment, global and base configuration, in this order

Parameters:
key -
Returns:

getPrefix

private java.lang.String getPrefix()

addBaseFileName

public void addBaseFileName(java.lang.String fileName)

addGlobalFileName

public void addGlobalFileName(java.lang.String fileName)

addPropertiesSource

private Configuration addPropertiesSource(java.lang.String sourceName,
                                          CompositeConfiguration loadedConf)
Read the given source of properties and add it to the composite configuration. The added configuration will be returned. If it is not found null will be returned.


addFileProperties

private Configuration addFileProperties(java.lang.String fileName,
                                        CompositeConfiguration loadedConf)
                                 throws ConfigurationException
Throws:
ConfigurationException

getReloadDelay

private java.lang.Long getReloadDelay(CompositeConfiguration loadedConf,
                                      FileConfiguration newConf)

addDatasourceProperties

private Configuration addDatasourceProperties(java.lang.String datasourcePath)

addJndiProperties

private Configuration addJndiProperties(java.lang.String sourcePath)

addIncludedPropertiesSources

private void addIncludedPropertiesSources(Configuration newConf,
                                          CompositeConfiguration loadedConf)

loadedSources

public java.util.List loadedSources()

hasBaseConfiguration

public boolean hasBaseConfiguration()

getComponentName

public java.lang.String getComponentName()