Class JNDIProvider

  • All Implemented Interfaces:
    ConfigurationProvider
    Direct Known Subclasses:
    BareConfiguration

    public class JNDIProvider
    extends java.lang.Object
    implements ConfigurationProvider
    Provider class for JNDI access easing. Per default goes to JNDI environment but LocalConfiguration will get its values from a properties file
    • Field Detail

      • configurationParameters

        protected java.util.Map<java.lang.String,​java.lang.Object> configurationParameters
      • log

        protected org.apache.logging.log4j.Logger log
    • Constructor Detail

      • JNDIProvider

        public JNDIProvider()
        initializes JNDI context java:comp/env, implements caching of parameters, use purgeCache() to clear cache
    • Method Detail

      • getInstance

        @Deprecated
        public static JNDIProvider getInstance()
        Deprecated.
        will be removed after BCD-UI 4.5
        Returns:
      • getLocalInstance

        @Deprecated
        public static JNDIProvider getLocalInstance​(java.lang.String propsFile)
        Deprecated.
        will be removed after BCD-UI 4.5
        Parameters:
        propsFile -
        Returns:
      • init

        protected void init()
                     throws java.lang.RuntimeException
        Throws:
        java.lang.RuntimeException
      • getConfigurationParameter

        public <T> T getConfigurationParameter​(java.lang.String id,
                                               T defaultValue)
        Description copied from interface: ConfigurationProvider
        getter for configuration parameter including downcast
        Specified by:
        getConfigurationParameter in interface ConfigurationProvider
        Returns:
        configuration parameter instance or defaultValue
      • putConfigurationParameter

        public java.lang.Object putConfigurationParameter​(java.lang.String id,
                                                          java.lang.Object value)
        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