Class BaseJndiImplementation
- All Implemented Interfaces:
ComponentLifecycleExtension
,ConnectionComparator<VendorImplementationBase>
,VendorImplementation
,VendorImplementationBase
- Direct Known Subclasses:
StandardJndiImplementation
-
Field Summary
FieldsFields inherited from class com.adaptris.core.jms.VendorImplementationImp
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
connectionEquals
(VendorImplementationBase vendorImp) javax.jms.Queue
createQueue
(String name, JmsActorConfig c) Create or otherwise obtain aQueue
.javax.jms.Topic
createTopic
(String name, JmsActorConfig c) Create or otherwise obtain aTopic
.boolean
Whether or not encoded passwords are enabled.Returns the name to look up in the JNDI store.Returns aKeyValuePairSet
of the parameters requires to connect to the JNDI store.protected Object
boolean
Returns the broker details used to create the underlyingConnectionFactory
.void
Specify whether or not to enable encoded passwords.void
setEncodedPasswordKeys
(String encodedPasswordKey) A comma separated list of keys that will be decoded.void
Configure any additional settings that need to be applied to theConnectionFactory
after it has been read from the JNDI store.void
Sets the name to look up in the JNDI store.void
Sets aKeyValuePairSet
of the parameters requires to connect to the JNDI store.void
Whether or not to create a new JNDI context on exception.void
Specify whether to use JNDI when attempting to create a Queue.void
Specify whether to use JNDI when attempting to create a Topic.boolean
boolean
Methods inherited from class com.adaptris.core.jms.VendorImplementationImp
applyVendorSessionProperties, createConsumer, createDestination, createQueueReceiver, createSession, createTopicSubscriber, prepare
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.jms.VendorImplementation
createConnection, createConnectionFactory
-
Field Details
-
jndiName
-
context
-
-
Constructor Details
-
BaseJndiImplementation
public BaseJndiImplementation()
-
-
Method Details
-
lookup
- Throws:
javax.jms.JMSException
-
asList
-
createQueue
Description copied from interface:VendorImplementationBase
Create or otherwise obtain a
Queue
.- Specified by:
createQueue
in interfaceVendorImplementationBase
- Overrides:
createQueue
in classVendorImplementationImp
- Parameters:
name
- the name of the queuec
- the Configuration- Returns:
- a
Queue
object - Throws:
javax.jms.JMSException
- if any occur- See Also:
-
createTopic
Description copied from interface:VendorImplementationBase
Create or otherwise obtain a
Topic
.- Specified by:
createTopic
in interfaceVendorImplementationBase
- Overrides:
createTopic
in classVendorImplementationImp
- Parameters:
name
- the name of the topicc
- the Configuration- Returns:
- a
Topic
object - Throws:
javax.jms.JMSException
- if any occur- See Also:
-
retrieveBrokerDetailsForLogging
Description copied from interface:VendorImplementationBase
Returns the broker details used to create the underlying
ConnectionFactory
. This is delegated to theVendorImplementation
because it may over-ride the broker details configured inJmsConnection
.- Specified by:
retrieveBrokerDetailsForLogging
in interfaceVendorImplementationBase
- Overrides:
retrieveBrokerDetailsForLogging
in classVendorImplementationImp
- Returns:
- the broker details used to create the underlying
ConnectionFactory
- See Also:
-
connectionEquals
-
getJndiName
Returns the name to look up in the JNDI store.
- Returns:
- the name to look up in the JNDI store
-
setJndiName
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
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 theKeyValuePairSet
.- Returns:
- a
KeyValuePairSet
of the parameters requires to connect to the JNDI store
-
setJndiParams
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 theKeyValuePairSet
. May not be null.- Parameters:
k
- aKeyValuePairSet
of the parameters requires to connect to the JNDI store
-
getUseJndiForQueues
- Returns:
- the useJndiForQueues
- See Also:
-
setUseJndiForQueues
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() -
getUseJndiForTopics
- Returns:
- the useJndiForTopics
- See Also:
-
setUseJndiForTopics
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
Whether or not encoded passwords are enabled.- Returns:
- true if encoded passwords are to be supported.
-
setEnableEncodedPasswords
Specify whether or not to enable encoded passwords.When enabled, the entry matching
Context.SECURITY_CREDENTIALS
will be parsed and decoding attempted using the appropriatePassword
- Parameters:
b
- true to enable, false otherwise (default false)
-
enableEncodedPasswords
public boolean enableEncodedPasswords() -
getEncodedPasswordKeys
-
setEncodedPasswordKeys
A comma separated list of keys that will be decoded.- Parameters:
encodedPasswordKey
- the keys to decode.- See Also:
-
getExtraFactoryConfiguration
-
setExtraFactoryConfiguration
Configure any additional settings that need to be applied to theConnectionFactory
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 isNoOpFactoryConfiguration
- See Also:
-
newContextOnException
public boolean newContextOnException() -
getNewContextOnException
-
setNewContextOnException
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 newInitialContext
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.
-