Package org.kie.internal.utils
Class ChainedProperties
- java.lang.Object
-
- org.kie.internal.utils.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 totrue
Cache entries are by default limited to 100 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
-
Constructor Summary
Constructors Constructor Description ChainedProperties()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChainedProperties
addProperties(java.util.Properties properties)
Specifically added properties take priority, so they go to the front of the list.ChainedProperties
clone()
void
filterDroolsPropertiesForSerialization()
static ChainedProperties
getChainedProperties(java.lang.ClassLoader classLoader)
static ChainedProperties
getChainedProperties(java.lang.String confFileName, java.lang.ClassLoader classLoader)
java.lang.String
getProperty(java.lang.String key, java.lang.String defaultValue)
void
mapStartsWith(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String startsWith, boolean includeSubProperties)
void
readExternal(java.io.ObjectInput in)
void
writeExternal(java.io.ObjectOutput out)
-
-
-
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 classjava.lang.Object
-
filterDroolsPropertiesForSerialization
public void filterDroolsPropertiesForSerialization()
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.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 interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
addProperties
public ChainedProperties 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)
-
-