Class SimpleDestinationResolver
java.lang.Object
org.springframework.jms.support.destination.DynamicDestinationResolver
org.springframework.jms.support.destination.SimpleDestinationResolver
- All Implemented Interfaces:
CachingDestinationResolver, DestinationResolver
public class SimpleDestinationResolver
extends DynamicDestinationResolver
implements CachingDestinationResolver
A simple
DestinationResolver implementation for Session-based
destination resolution, caching Queue and Topic instances per
queue/topic name. In that sense, the destinations themselves also need to be
"simple": not Session-specific and therefore stable across an entire JMS setup.
This is the default resolver used by JmsClient
and also JmsTemplate and listener containers,
as of 7.0. For enforcing fresh resolution on every call, you may explicitly set a
DynamicDestinationResolver instead.
- Since:
- 7.0
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the entire destination cache.voidremoveFromCache(String destinationName) Remove the destination with the given name from the cache (if cached by this resolver in the first place).protected jakarta.jms.QueueresolveQueue(jakarta.jms.Session session, String queueName) Resolve the given destination name to aQueue.protected jakarta.jms.TopicresolveTopic(jakarta.jms.Session session, String topicName) Resolve the given destination name to aTopic.Methods inherited from class DynamicDestinationResolver
resolveDestinationNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DestinationResolver
resolveDestinationName
-
Constructor Details
-
SimpleDestinationResolver
public SimpleDestinationResolver()
-
-
Method Details
-
resolveTopic
protected jakarta.jms.Topic resolveTopic(jakarta.jms.Session session, String topicName) throws jakarta.jms.JMSException Description copied from class:DynamicDestinationResolverResolve the given destination name to aTopic.- Overrides:
resolveTopicin classDynamicDestinationResolver- Parameters:
session- the current JMS SessiontopicName- the name of the desiredTopic- Returns:
- the JMS
Topic - Throws:
jakarta.jms.JMSException- if resolution failed- See Also:
-
resolveQueue
protected jakarta.jms.Queue resolveQueue(jakarta.jms.Session session, String queueName) throws jakarta.jms.JMSException Description copied from class:DynamicDestinationResolverResolve the given destination name to aQueue.- Overrides:
resolveQueuein classDynamicDestinationResolver- Parameters:
session- the current JMS SessionqueueName- the name of the desiredQueue- Returns:
- the JMS
Queue - Throws:
jakarta.jms.JMSException- if resolution failed- See Also:
-
removeFromCache
Description copied from interface:CachingDestinationResolverRemove the destination with the given name from the cache (if cached by this resolver in the first place).To be called if access to the specified destination failed, assuming that the JMS Destination object might have become invalid.
- Specified by:
removeFromCachein interfaceCachingDestinationResolver- Parameters:
destinationName- the name of the destination
-
clearCache
public void clearCache()Description copied from interface:CachingDestinationResolverClear the entire destination cache.To be called in case of general JMS provider failure.
- Specified by:
clearCachein interfaceCachingDestinationResolver
-