Class ChainedProperties

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

    public class ChainedProperties
    extends java.lang.Object
    implements java.io.Externalizable, java.lang.Cloneable
    Priority
    • System properties
    • META-INF/ of provided classLoader

    To improve performance in frequent session creation cases, chained properties can be cached by it's conf file name and requesting classloader. To take advantage of the case it must be enabled via system property:
    org.kie.property.cache.enabled that needs to be set to true Cache entries are by default limited to 10 to reduce memory consumption but can be fine tuned by system property:
    org.kie.property.cache.size that needs to be set to valid integer value
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger logger  
      protected static java.util.Map<org.kie.internal.utils.ChainedProperties.CacheKey,​java.util.List<java.util.Properties>> propertiesCache  
    • Field Detail

      • logger

        protected static transient org.slf4j.Logger logger
      • propertiesCache

        protected static java.util.Map<org.kie.internal.utils.ChainedProperties.CacheKey,​java.util.List<java.util.Properties>> propertiesCache
    • Constructor Detail

      • ChainedProperties

        public ChainedProperties()
    • Method Detail

      • getChainedProperties

        public static ChainedProperties getChainedProperties​(java.lang.ClassLoader classLoader)
      • getChainedProperties

        public static ChainedProperties getChainedProperties​(java.lang.String confFileName,
                                                             java.lang.ClassLoader classLoader)
      • clone

        public ChainedProperties clone()
        Overrides:
        clone in class java.lang.Object
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • addProperties

        public void addProperties​(java.util.Properties properties)
        Specifically added properties take priority, so they go to the front of the list.
      • getProperty

        public java.lang.String getProperty​(java.lang.String key,
                                            java.lang.String defaultValue)
      • mapStartsWith

        public void mapStartsWith​(java.util.Map<java.lang.String,​java.lang.String> map,
                                  java.lang.String startsWith,
                                  boolean includeSubProperties)