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 TypeMethodDescriptionvoid
Clear the entire destination cache.void
removeFromCache
(String destinationName) Remove the destination with the given name from the cache (if cached by this resolver in the first place).protected Queue
resolveQueue
(Session session, String queueName) Resolve the given destination name to aQueue
.protected Topic
resolveTopic
(Session session, String topicName) Resolve the given destination name to aTopic
.Methods inherited from class DynamicDestinationResolver
resolveDestinationName
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface DestinationResolver
resolveDestinationName
-
Constructor Details
-
SimpleDestinationResolver
public SimpleDestinationResolver()
-
-
Method Details
-
resolveTopic
Description copied from class:DynamicDestinationResolver
Resolve the given destination name to aTopic
.- Overrides:
resolveTopic
in classDynamicDestinationResolver
- Parameters:
session
- the current JMS SessiontopicName
- the name of the desiredTopic
- Returns:
- the JMS
Topic
- Throws:
JMSException
- if resolution failed- See Also:
-
resolveQueue
Description copied from class:DynamicDestinationResolver
Resolve the given destination name to aQueue
.- Overrides:
resolveQueue
in classDynamicDestinationResolver
- Parameters:
session
- the current JMS SessionqueueName
- the name of the desiredQueue
- Returns:
- the JMS
Queue
- Throws:
JMSException
- if resolution failed- See Also:
-
removeFromCache
Description copied from interface:CachingDestinationResolver
Remove 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:
removeFromCache
in interfaceCachingDestinationResolver
- Parameters:
destinationName
- the name of the destination
-
clearCache
public void clearCache()Description copied from interface:CachingDestinationResolver
Clear the entire destination cache.To be called in case of general JMS provider failure.
- Specified by:
clearCache
in interfaceCachingDestinationResolver
-