|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.knowledgeplaza.util.ConfigurationProperties
public class ConfigurationProperties
This class is a wrapper for context dependent property collections.
| Nested Class Summary | |
|---|---|
static class |
ConfigurationProperties.ConfigurationChangedEvent
|
static interface |
ConfigurationProperties.ConfigurationChangedListener
|
| Field Summary | |
|---|---|
static String |
CONFIGURATIONPROPERTY_ID_APPLICATIONNAME
|
static String |
CONFIGURATIONPROPERTY_ID_HOST
|
static String |
CONFIGURATIONPROPERTY_ID_OSNAME
|
static String |
CONFIGURATIONPROPERTY_ID_PORT
|
static String |
CONFIGURATIONPROPERTY_ID_SYSTEMNAME
|
static String |
CONFIGURATIONPROPERTY_ID_USERNAME
|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
ConfigurationProperties()
get all the settings from the system properties |
|
ConfigurationProperties(File... files)
get all the settings from the system properties then override with provided identifiers |
|
ConfigurationProperties(Map identifiers)
get all the settings from the system properties then override with provided identifiers |
|
ConfigurationProperties(String pApplicationName)
get all but the parameters from the system properties |
|
ConfigurationProperties(String pApplicationName,
String pSystemName)
get all but the parameters from the system properties |
|
ConfigurationProperties(String pApplicationName,
String pSystemName,
String pUserName)
get all but the parameters from the system properties |
|
| Method Summary | |
|---|---|
void |
addConfigurationChangedListener(ConfigurationProperties.ConfigurationChangedListener listener)
|
ConfigurationProperties |
chain(ConfigurationProperties value)
|
void |
determineAndReadPropertyFiles()
do both |
void |
determineAndReadPropertyFilesIfNotReadYet()
Lazy reading |
void |
determinePropertyFiles()
search and read the property files |
void |
fireConfigurationChanged()
|
static ConfigurationProperties |
get()
Singleton or thread related |
String |
get(Class pContextClass,
String pPropertyName)
Deprecated. use get2 for correct behavior or switch to the Configuration class |
String |
get(Object pContextObject,
String pPropertyName)
Deprecated. use get2 for correct behavior or switch to the Configuration class |
String |
get(String pPropertyName)
find the first definition of a property and return its value |
String |
get2(Class pContextClass,
String pPropertyName)
convenience method: first check the context (full classname, simple classname) then the pure property name |
String |
get2(Object pContextObject,
String pPropertyName)
convenience method: first check the context then the pure property name |
String |
get2(String pContext,
String pPropertyName)
convenience method: first check the context then the pure property name |
List<File> |
getAdditionalPaths()
AdditionalPaths |
String |
getApplicationName()
applicationname |
ConfigurationProperties |
getChain()
by chaining configuration properties several naming scheme's can be combined |
boolean |
getCheckForUpdates()
|
Properties |
getCollection(String prefix)
get all properties that match a prefix |
Properties |
getCollection(String prefix,
Properties properties)
The group logic on one free set of properties. |
List<File> |
getForcedFiles()
|
Properties |
getGroupedCollection(String prefix)
Get all properties that match a prefix and group them. |
String |
getIdentifier(String key)
identifier |
boolean |
getIdentifierLock()
IdentifierLock |
URL |
getLocation(String pPropertyName)
find the location of the first definition of a property |
Properties |
getManualProperties()
we allow adding one manual properties set |
String |
getOsName()
osname |
String |
getPrefix()
the prefix is configurable |
Properties |
getProperties()
Flatten all properties into one |
String |
getSystemName()
systemname |
static ConfigurationProperties |
getThreadRelatedConfigurationProperties()
|
long |
getTimerDelay()
|
String |
getUserName()
username |
static int |
parseInt(String value,
int defaultValue,
org.apache.log4j.Logger log4j,
String prefix)
|
void |
readPropertyFiles()
search and read the property files |
void |
removeConfigurationChangedListener(ConfigurationProperties.ConfigurationChangedListener listener)
|
static ConfigurationProperties |
removeThreadRelatedConfigurationProperties()
|
String |
reportUsedIdentifiersAndFiles()
for feedback |
static void |
set(ConfigurationProperties configurationProperties)
|
void |
setAdditionalPaths(File... value)
|
void |
setAdditionalPaths(List<File> value)
|
void |
setApplicationName(String value)
|
void |
setChain(ConfigurationProperties value)
|
void |
setCheckForUpdates(boolean value)
|
void |
setIdentifier(String key,
String value)
|
void |
setIdentifierLock(boolean value)
|
void |
setManualProperties(InputStream is)
create and load properties from an inputstream (e.g. |
void |
setManualProperties(Properties value)
|
void |
setOsName(String value)
|
void |
setPrefix(String value)
|
void |
setSystemName(String value)
|
static void |
setSystemWideApplicationName(String name)
Set the system wide application name used by all ConfigurationProperties in the JVM |
static void |
setThreadRelatedConfigurationProperties(ConfigurationProperties value)
ThreadRelatedConfigurationProperties This is the CP bound to the current thread It can also be used to preset a CP (for example from a session in a webapp). |
void |
setTimerDelay(long value)
|
void |
setUserName(String value)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
public static final String CONFIGURATIONPROPERTY_ID_HOST
public static final String CONFIGURATIONPROPERTY_ID_PORT
public static final String CONFIGURATIONPROPERTY_ID_APPLICATIONNAME
public static final String CONFIGURATIONPROPERTY_ID_SYSTEMNAME
public static final String CONFIGURATIONPROPERTY_ID_OSNAME
public static final String CONFIGURATIONPROPERTY_ID_USERNAME
| Constructor Detail |
|---|
public ConfigurationProperties()
public ConfigurationProperties(String pApplicationName)
pApplicationName - the name of the application
public ConfigurationProperties(String pApplicationName,
String pSystemName)
pApplicationName - the name of the applicationpSystemName - the name of the system
public ConfigurationProperties(String pApplicationName,
String pSystemName,
String pUserName)
pApplicationName - the name of the applicationpSystemName - the name of the systempUserName - the name of the currently active userpublic ConfigurationProperties(Map identifiers)
public ConfigurationProperties(File... files)
| Method Detail |
|---|
public static ConfigurationProperties get()
public static void set(ConfigurationProperties configurationProperties)
public static void setThreadRelatedConfigurationProperties(ConfigurationProperties value)
public static ConfigurationProperties getThreadRelatedConfigurationProperties()
public static ConfigurationProperties removeThreadRelatedConfigurationProperties()
public List<File> getForcedFiles()
public String getPrefix()
public void setPrefix(String value)
public Properties getManualProperties()
public void setManualProperties(Properties value)
public void setManualProperties(InputStream is)
throws IOException
IOExceptionpublic ConfigurationProperties getChain()
public void setChain(ConfigurationProperties value)
public ConfigurationProperties chain(ConfigurationProperties value)
public List<File> getAdditionalPaths()
public void setAdditionalPaths(List<File> value)
public void setAdditionalPaths(File... value)
public String getIdentifier(String key)
public void setIdentifier(String key,
String value)
public boolean getIdentifierLock()
public void setIdentifierLock(boolean value)
public String getApplicationName()
public void setApplicationName(String value)
public String getSystemName()
public void setSystemName(String value)
public String getOsName()
public void setOsName(String value)
public String getUserName()
public void setUserName(String value)
public void determinePropertyFiles()
public void readPropertyFiles()
public void determineAndReadPropertyFiles()
public void determineAndReadPropertyFilesIfNotReadYet()
public String reportUsedIdentifiersAndFiles()
public String get(String pPropertyName)
public String get(Class pContextClass,
String pPropertyName)
public String get(Object pContextObject,
String pPropertyName)
public String get2(String pContext,
String pPropertyName)
public String get2(Class pContextClass,
String pPropertyName)
public String get2(Object pContextObject,
String pPropertyName)
public URL getLocation(String pPropertyName)
public Properties getCollection(String prefix)
prefix -
public Properties getCollection(String prefix,
Properties properties)
prefix - properties -
public Properties getGroupedCollection(String prefix)
prefix -
public static int parseInt(String value,
int defaultValue,
org.apache.log4j.Logger log4j,
String prefix)
public long getTimerDelay()
public void setTimerDelay(long value)
public boolean getCheckForUpdates()
public void setCheckForUpdates(boolean value)
public Properties getProperties()
prefix -
public void addConfigurationChangedListener(ConfigurationProperties.ConfigurationChangedListener listener)
public void removeConfigurationChangedListener(ConfigurationProperties.ConfigurationChangedListener listener)
public void fireConfigurationChanged()
public String toString()
toString in class Objectpublic static void setSystemWideApplicationName(String name)
name -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||