public class CachedDestinationJndiImplementation extends StandardJndiImplementation
StandardJndiImplementation
that caches destinations in between calls.
This cache is preserved across normal component lifecycle; e.g. the cache remains even if you invoke
Channel.requestClose()
and then Channel.requestStart()
. The only way
to reset the cache is to create a new instance. If this VendorImplementation
is used as
part of a
StandaloneProducer
then the cache is preserved across the component lifecycles. If used as part of a
RetryOnceStandaloneProducer
then the cache will be reset when underlying components is restarted (this
producer specifically marshal/unmarshal it's components).
StandardJndiImplementation
In the adapter configuration file this class is aliased as cached-destination-jndi-implementation which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,javax.jms.Queue> |
queues |
protected java.util.Map<java.lang.String,javax.jms.Topic> |
topics |
context, jndiName
log
Constructor and Description |
---|
CachedDestinationJndiImplementation() |
CachedDestinationJndiImplementation(int cacheSize) |
Modifier and Type | Method and Description |
---|---|
javax.jms.Queue |
createQueue(java.lang.String name,
JmsActorConfig c)
Checks to see if the queue cache contains the provided name.
|
javax.jms.Topic |
createTopic(java.lang.String name,
JmsActorConfig c)
Checks to see if the topic cache contains the provided name.
|
java.lang.Integer |
getMaxDestinationCacheSize()
Get the max number of entries in the cache.
|
int |
maxDestinationCacheSize() |
void |
setMaxDestinationCacheSize(java.lang.Integer maxSize)
Set the max number of entries in the cache.
|
createConnectionFactory
asList, connectionEquals, enableEncodedPasswords, getEnableEncodedPasswords, getEncodedPasswordKeys, getExtraFactoryConfiguration, getJndiName, getJndiParams, getNewContextOnException, getUseJndiForQueues, getUseJndiForTopics, lookup, newContextOnException, retrieveBrokerDetailsForLogging, setEnableEncodedPasswords, setEncodedPasswordKeys, setExtraFactoryConfiguration, setJndiName, setJndiParams, setNewContextOnException, setUseJndiForQueues, setUseJndiForTopics, useJndiForQueues, useJndiForTopics
applyVendorSessionProperties, createConsumer, createDestination, createQueueReceiver, createSession, createTopicSubscriber, prepare
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createConnection
createConsumer, createDestination, createQueueReceiver, createSession, createTopicSubscriber, retrieveBrokerDetailsForLogging
prepare
connectionEquals
protected transient java.util.Map<java.lang.String,javax.jms.Topic> topics
protected transient java.util.Map<java.lang.String,javax.jms.Queue> queues
public CachedDestinationJndiImplementation()
public CachedDestinationJndiImplementation(int cacheSize)
public javax.jms.Queue createQueue(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
createQueue
in interface VendorImplementationBase
createQueue
in class BaseJndiImplementation
name
- the name of the queuec
- the ConfigurationQueue
objectjavax.jms.JMSException
- if any occurBaseJndiImplementation.createQueue(java.lang.String, JmsActorConfig)
public javax.jms.Topic createTopic(java.lang.String name, JmsActorConfig c) throws javax.jms.JMSException
createTopic
in interface VendorImplementationBase
createTopic
in class BaseJndiImplementation
name
- the name of the topicc
- the ConfigurationTopic
objectjavax.jms.JMSException
- if any occurBaseJndiImplementation.createTopic(java.lang.String, JmsActorConfig)
public java.lang.Integer getMaxDestinationCacheSize()
public void setMaxDestinationCacheSize(java.lang.Integer maxSize)
Entries will be removed on a least recently accessed basis.
maxSize
- the maximum number of entries, default 16public int maxDestinationCacheSize()