Package com.germinus.easyconf
Class ComponentConfiguration
- java.lang.Object
-
- com.germinus.easyconf.ComponentConfiguration
-
public class ComponentConfiguration extends java.lang.ObjectContains the configuration of an EasyConf component including properties configuration and an object graph configuration.- Version:
- $Revision: 1.11 $
- Author:
- Jorge Ferrer
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcompanyIdprivate java.lang.StringcomponentNameprivate ConfigurationLoaderconfManagerprivate java.util.MapconfObjectsCacheprivate static Loglogprivate ComponentPropertiesproperties
-
Constructor Summary
Constructors Constructor Description ComponentConfiguration(java.lang.String componentName)ComponentConfiguration(java.lang.String companyId, java.lang.String componentName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)private ComponentPropertiesgetAvailableProperties()java.lang.StringgetComponentName()Get the name of the component which is associated with this configurationprivate ConfigurationLoadergetConfigurationManager()java.lang.ObjectgetConfigurationObject()Get an object which represents the default configuration of component The object is populated using the digester rules defined in the file componentName.digesterRules.xml which must be found in the classpath (first it is searched in the context of the current thread and then in the context of the system classpath)java.lang.ObjectgetConfigurationObject(java.lang.String confName)Get an object which represents a named configuration of the component The object is populated using the digester rules defined in the file componentName.digesterRules.xml which must be found in the classpath (first it is searched in the context of the current thread and then in the context of the system classpath)ComponentPropertiesgetProperties()Get a typed map of the properties associated with this componentinthashCode()voidsaveConfigurationObject(java.lang.Object configurationObject)Update or create a new default configuration Object to a persistent storage.voidsaveConfigurationObject(java.lang.String confName, java.lang.Object configurationObject)Update or create a new Object with the given name to a persistent storage.
-
-
-
Field Detail
-
log
private static final Log log
-
properties
private ComponentProperties properties
-
componentName
private java.lang.String componentName
-
confManager
private ConfigurationLoader confManager
-
companyId
private java.lang.String companyId
-
confObjectsCache
private java.util.Map confObjectsCache
-
-
Method Detail
-
getComponentName
public java.lang.String getComponentName()
Get the name of the component which is associated with this configuration
-
getConfigurationObject
public java.lang.Object getConfigurationObject()
Get an object which represents the default configuration of component The object is populated using the digester rules defined in the file componentName.digesterRules.xml which must be found in the classpath (first it is searched in the context of the current thread and then in the context of the system classpath)- Throws:
ConfigurationException- if the object graph cannot be read
-
getConfigurationObject
public java.lang.Object getConfigurationObject(java.lang.String confName)
Get an object which represents a named configuration of the component The object is populated using the digester rules defined in the file componentName.digesterRules.xml which must be found in the classpath (first it is searched in the context of the current thread and then in the context of the system classpath)- Throws:
ConfigurationException- if the object graph cannot be read
-
saveConfigurationObject
public void saveConfigurationObject(java.lang.Object configurationObject)
Update or create a new default configuration Object to a persistent storage. In order to make this method work it should be stablished a configuration-objects-source to a database as explained in the docs. If the source of configuration objects does not allow persistent storage (which is the default) an exception will be thrown.- Parameters:
obj-
-
saveConfigurationObject
public void saveConfigurationObject(java.lang.String confName, java.lang.Object configurationObject)Update or create a new Object with the given name to a persistent storage. In order to make this method work it should be stablished a configuration-objects-source to a database as explained in the docs. If the source of configuration objects does not allow persistent storage (which is the default) an exception will be thrown.- Parameters:
obj-
-
getConfigurationManager
private ConfigurationLoader getConfigurationManager()
-
getProperties
public ComponentProperties getProperties()
Get a typed map of the properties associated with this component
-
getAvailableProperties
private ComponentProperties getAvailableProperties()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-