Class BaseJndiImplementation

    • Field Detail

      • jndiName

        @NotBlank
        protected @NotBlank java.lang.String jndiName
      • context

        protected transient volatile javax.naming.Context context
    • Constructor Detail

      • BaseJndiImplementation

        public BaseJndiImplementation()
    • Method Detail

      • lookup

        protected java.lang.Object lookup​(java.lang.String name)
                                   throws javax.jms.JMSException
        Throws:
        javax.jms.JMSException
      • asList

        protected static java.util.List<java.lang.String> asList​(java.lang.String commaSepList,
                                                                 java.lang.String delim)
      • getJndiName

        public java.lang.String getJndiName()

        Returns the name to look up in the JNDI store.

        Returns:
        the name to look up in the JNDI store
      • setJndiName

        public void setJndiName​(java.lang.String s)

        Sets the name to look up in the JNDI store. May not be null or empty.

        Parameters:
        s - the name to look up in the JNDI store that corresponds to a ConnectionFactory of the correct type.
      • getJndiParams

        public KeyValuePairSet getJndiParams()

        Returns a KeyValuePairSet of the parameters requires to connect to the JNDI store. Keys are commonly represented in Java by constants. It is the value of these constants not the constants themselves which should be configured in the KeyValuePairSet.

        Returns:
        a KeyValuePairSet of the parameters requires to connect to the JNDI store
      • setJndiParams

        public void setJndiParams​(KeyValuePairSet k)

        Sets a KeyValuePairSet of the parameters requires to connect to the JNDI store. Keys are commonly represented in Java by constants. It is the value of these constants not the constants themselves which should be configured in the KeyValuePairSet. May not be null.

        Parameters:
        k - a KeyValuePairSet of the parameters requires to connect to the JNDI store
      • setUseJndiForQueues

        public void setUseJndiForQueues​(java.lang.Boolean b)
        Specify whether to use JNDI when attempting to create a Queue.

        This specifies whether to use Context.lookup(String) to find any specified queues, if the named object is not present within JNDI, then an Exception will be thrown

        Parameters:
        b - true to use JNDI to create a Queue, false to use standard JMS methods, default false.
      • useJndiForQueues

        public boolean useJndiForQueues()
      • setUseJndiForTopics

        public void setUseJndiForTopics​(java.lang.Boolean b)
        Specify whether to use JNDI when attempting to create a Topic.

        This specifies whether to use Context.lookup(String) to find any specified topics, if the named object is not present within JNDI, then an Exception will be thrown

        Parameters:
        b - true to use JNDI to create a Topic, false to use standard JMS methods, default false.
      • useJndiForTopics

        public boolean useJndiForTopics()
      • getEnableEncodedPasswords

        public java.lang.Boolean getEnableEncodedPasswords()
        Whether or not encoded passwords are enabled.
        Returns:
        true if encoded passwords are to be supported.
      • setEnableEncodedPasswords

        public void setEnableEncodedPasswords​(java.lang.Boolean b)
        Specify whether or not to enable encoded passwords.

        When enabled, the entry matching Context.SECURITY_CREDENTIALS will be parsed and decoding attempted using the appropriate Password

        Parameters:
        b - true to enable, false otherwise (default false)
      • enableEncodedPasswords

        public boolean enableEncodedPasswords()
      • getEncodedPasswordKeys

        public java.lang.String getEncodedPasswordKeys()
      • setEncodedPasswordKeys

        public void setEncodedPasswordKeys​(java.lang.String encodedPasswordKey)
        A comma separated list of keys that will be decoded.
        Parameters:
        encodedPasswordKey - the keys to decode.
        See Also:
        setEnableEncodedPasswords(Boolean)
      • setExtraFactoryConfiguration

        public void setExtraFactoryConfiguration​(ExtraFactoryConfiguration efc)
        Configure any additional settings that need to be applied to the ConnectionFactory after it has been read from the JNDI store.

        Generally speaking, this is not encouraged, as you are now keeping configuration in 2 separate locations (both JNDI and adapter config). The ConnectionFactory should ideally be configured in JNDI with all the settings that are required for each connection.

        Parameters:
        efc - any extra configuration, default is NoOpFactoryConfiguration
        See Also:
        NoOpFactoryConfiguration, SimpleFactoryConfiguration
      • newContextOnException

        public boolean newContextOnException()
      • getNewContextOnException

        public java.lang.Boolean getNewContextOnException()
      • setNewContextOnException

        public void setNewContextOnException​(java.lang.Boolean b)
        Whether or not to create a new JNDI context on exception.

        In some instances, the InitialContextFactory implementation may be badly behaved, and not re-initialise nicely when error situations occur. By setting this to true, we create a new InitialContext when any exception is encountered. This will of course have a performance hit if you are constantly resetting the connection for things like a missing JNDI entry; but might help with rare events like recovery after a network outage.

        Parameters:
        b - true or false, default false.