public abstract class BaseJndiImplementation extends VendorImplementationImp
Modifier and Type | Field and Description |
---|---|
protected javax.naming.Context |
context |
protected @NotBlank java.lang.String |
jndiName |
log
Constructor and Description |
---|
BaseJndiImplementation() |
Modifier and Type | Method and Description |
---|---|
protected static java.util.List<java.lang.String> |
asList(java.lang.String commaSepList,
java.lang.String delim) |
boolean |
connectionEquals(VendorImplementationBase vendorImp) |
javax.jms.Queue |
createQueue(java.lang.String name,
JmsActorConfig c)
Create or otherwise obtain a
Queue . |
javax.jms.Topic |
createTopic(java.lang.String name,
JmsActorConfig c)
Create or otherwise obtain a
Topic . |
protected boolean |
enableEncodedPasswords() |
java.lang.Boolean |
getEnableEncodedPasswords()
Whether or not encoded passwords are enabled.
|
java.lang.String |
getEncodedPasswordKeys() |
ExtraFactoryConfiguration |
getExtraFactoryConfiguration() |
java.lang.String |
getJndiName()
Returns the name to look up in the JNDI store.
|
KeyValuePairSet |
getJndiParams()
Returns a
KeyValuePairSet of the parameters requires to connect to the JNDI store. |
java.lang.Boolean |
getNewContextOnException() |
java.lang.Boolean |
getUseJndiForQueues() |
java.lang.Boolean |
getUseJndiForTopics() |
protected java.lang.Object |
lookup(java.lang.String name) |
protected boolean |
newContextOnException() |
java.lang.String |
retrieveBrokerDetailsForLogging()
Returns the broker details used to create the underlying
ConnectionFactory . |
void |
setEnableEncodedPasswords(java.lang.Boolean b)
Specify whether or not to enable encoded passwords.
|
void |
setEncodedPasswordKeys(java.lang.String encodedPasswordKey)
A comma separated list of keys that will be decoded.
|
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. |
void |
setJndiName(java.lang.String s)
Sets the name to look up in the JNDI store.
|
void |
setJndiParams(KeyValuePairSet k)
Sets a
KeyValuePairSet of the parameters requires to connect to the JNDI store. |
void |
setNewContextOnException(java.lang.Boolean b)
Whether or not to create a new JNDI context on exception.
|
void |
setUseJndiForQueues(java.lang.Boolean b)
Specify whether to use JNDI when attempting to create a Queue.
|
void |
setUseJndiForTopics(java.lang.Boolean b)
Specify whether to use JNDI when attempting to create a Topic.
|
protected boolean |
useJndiForQueues() |
protected boolean |
useJndiForTopics() |
applyVendorSessionProperties, createConsumer, createDestination, createQueueReceiver, createSession, createTopicSubscriber, prepare
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createConnection, createConnectionFactory
@NotBlank protected @NotBlank java.lang.String jndiName
protected transient volatile javax.naming.Context context
protected java.lang.Object lookup(java.lang.String name) throws javax.jms.JMSException
javax.jms.JMSException
protected static java.util.List<java.lang.String> asList(java.lang.String commaSepList, java.lang.String delim)
public javax.jms.Queue createQueue(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
VendorImplementationBase
Create or otherwise obtain a Queue
.
createQueue
in interface VendorImplementationBase
createQueue
in class VendorImplementationImp
name
- the name of the queuec
- the ConfigurationQueue
objectjavax.jms.JMSException
- if any occurVendorImplementationBase.createQueue(java.lang.String, JmsActorConfig)
public javax.jms.Topic createTopic(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
VendorImplementationBase
Create or otherwise obtain a Topic
.
createTopic
in interface VendorImplementationBase
createTopic
in class VendorImplementationImp
name
- the name of the topicc
- the ConfigurationTopic
objectjavax.jms.JMSException
- if any occurVendorImplementationBase.createTopic(java.lang.String, JmsActorConfig)
public java.lang.String retrieveBrokerDetailsForLogging()
VendorImplementationBase
Returns the broker details used to create the underlying ConnectionFactory
. This is delegated to the
VendorImplementation
because it may over-ride the broker details configured in JmsConnection
.
retrieveBrokerDetailsForLogging
in interface VendorImplementationBase
retrieveBrokerDetailsForLogging
in class VendorImplementationImp
ConnectionFactory
#retrieveBrokerDetailsForLogging()
public boolean connectionEquals(VendorImplementationBase vendorImp)
public java.lang.String getJndiName()
Returns the name to look up in the JNDI store.
public void setJndiName(java.lang.String s)
Sets the name to look up in the JNDI store. May not be null or empty.
s
- the name to look up in the JNDI store that corresponds to a ConnectionFactory of the correct type.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
.
KeyValuePairSet
of the parameters requires to connect to the JNDI storepublic 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.
k
- a KeyValuePairSet
of the parameters requires to connect to the JNDI storepublic java.lang.Boolean getUseJndiForQueues()
setUseJndiForQueues(Boolean)
public void setUseJndiForQueues(java.lang.Boolean b)
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
b
- true to use JNDI to create a Queue, false to use standard JMS methods, default false.protected boolean useJndiForQueues()
public java.lang.Boolean getUseJndiForTopics()
setUseJndiForTopics(Boolean)
public void setUseJndiForTopics(java.lang.Boolean b)
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
b
- true to use JNDI to create a Topic, false to use standard JMS methods, default false.protected boolean useJndiForTopics()
public java.lang.Boolean getEnableEncodedPasswords()
public void setEnableEncodedPasswords(java.lang.Boolean b)
When enabled, the entry matching Context.SECURITY_CREDENTIALS
will be parsed and decoding attempted using the
appropriate Password
b
- true to enable, false otherwise (default false)protected boolean enableEncodedPasswords()
public java.lang.String getEncodedPasswordKeys()
public void setEncodedPasswordKeys(java.lang.String encodedPasswordKey)
encodedPasswordKey
- the keys to decode.setEnableEncodedPasswords(Boolean)
public ExtraFactoryConfiguration getExtraFactoryConfiguration()
public void setExtraFactoryConfiguration(ExtraFactoryConfiguration efc)
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.
efc
- any extra configuration, default is NoOpFactoryConfiguration
NoOpFactoryConfiguration
,
SimpleFactoryConfiguration
protected boolean newContextOnException()
public java.lang.Boolean getNewContextOnException()
public void setNewContextOnException(java.lang.Boolean b)
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.
b
- true or false, default false.