Package de.businesscode.util
Class JNDIProvider
java.lang.Object
de.businesscode.util.JNDIProvider
- All Implemented Interfaces:
ConfigurationProvider
- Direct Known Subclasses:
BareConfiguration
Provider class for JNDI access easing.
Per default goes to JNDI environment but LocalConfiguration will get its values from a properties file
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.logging.log4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptioninitializes JNDI context java:comp/env, implements caching of parameters, usepurgeCache()to clear cache -
Method Summary
Modifier and TypeMethodDescriptionretrieve a (mandatory) parameter or throw exception, also seeConfigurationProvider.getConfigurationParameterOrNull(String)<T> TgetConfigurationParameter(String id, T defaultValue) getter for configuration parameter including downcastretrieve parameterstatic JNDIProviderDeprecated.will be removed after BCD-UI 4.5static JNDIProvidergetLocalInstance(String propsFile) Deprecated.will be removed after BCD-UI 4.5protected voidinit()voidpurges cache ATTENTION this method also deletes parameters previously added viaputConfigurationParameter(String, Object)putConfigurationParameter(String id, Object value) stores and object at given id in the properties.
-
Field Details
-
configurationParameters
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
JNDIProvider
public JNDIProvider()initializes JNDI context java:comp/env, implements caching of parameters, usepurgeCache()to clear cache
-
-
Method Details
-
getInstance
Deprecated.will be removed after BCD-UI 4.5- Returns:
-
getLocalInstance
Deprecated.will be removed after BCD-UI 4.5- Parameters:
propsFile-- Returns:
-
purgeCache
public void purgeCache()purges cache ATTENTION this method also deletes parameters previously added viaputConfigurationParameter(String, Object) -
init
- Throws:
RuntimeException
-
getConfigurationParameter
Description copied from interface:ConfigurationProvidergetter for configuration parameter including downcast- Specified by:
getConfigurationParameterin interfaceConfigurationProvider- Returns:
- configuration parameter instance or defaultValue
-
getConfigurationParameterOrNull
Description copied from interface:ConfigurationProviderretrieve parameter- Specified by:
getConfigurationParameterOrNullin interfaceConfigurationProvider- Returns:
- configuration parameter instance or NULL
-
getConfigurationParameter
Description copied from interface:ConfigurationProviderretrieve a (mandatory) parameter or throw exception, also seeConfigurationProvider.getConfigurationParameterOrNull(String)- Specified by:
getConfigurationParameterin interfaceConfigurationProvider- Returns:
- configuration parameter instance
-
putConfigurationParameter
stores and object at given id in the properties. Does overwrite the old reference in case one existed. ATTENTION: this is NOT persistent, the configuration parameters are reset during reload of a context / application.- Parameters:
id-value-- Returns:
- an object previously set at given id or NULL in case the id has never been used before
-