Class 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
    • 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 configuration
      private 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 component
      int 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private static final Log log
      • componentName

        private java.lang.String componentName
      • companyId

        private java.lang.String companyId
      • confObjectsCache

        private java.util.Map confObjectsCache
    • Constructor Detail

      • ComponentConfiguration

        public ComponentConfiguration​(java.lang.String componentName)
      • ComponentConfiguration

        public ComponentConfiguration​(java.lang.String companyId,
                                      java.lang.String componentName)
    • 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 -
      • getProperties

        public ComponentProperties getProperties()
        Get a typed map of the properties associated with this component
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object