Package com.germinus.easyconf
Class ComponentConfiguration
- java.lang.Object
-
- com.germinus.easyconf.ComponentConfiguration
-
public class ComponentConfiguration extends java.lang.Object
Contains 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.String
companyId
private java.lang.String
componentName
private ConfigurationLoader
confManager
private java.util.Map
confObjectsCache
private static Log
log
private ComponentProperties
properties
-
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 boolean
equals(java.lang.Object obj)
private ComponentProperties
getAvailableProperties()
java.lang.String
getComponentName()
Get the name of the component which is associated with this configurationprivate ConfigurationLoader
getConfigurationManager()
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)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)ComponentProperties
getProperties()
Get a typed map of the properties associated with this componentint
hashCode()
void
saveConfigurationObject(java.lang.Object configurationObject)
Update or create a new default configuration Object to a persistent storage.void
saveConfigurationObject(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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-