public class DynamicDestinationResolver extends java.lang.Object implements DestinationResolver
DestinationResolver
implementation resolving destination names
as dynamic destinations.
This implementation will work on both JMS 1.1 and JMS 1.0.2,
because it uses the javax.jms.QueueSession
or javax.jms.TopicSession
methods if possible, falling back to JMS 1.1's generic javax.jms.Session
methods.
javax.jms.QueueSession#createQueue
,
javax.jms.TopicSession#createTopic
,
javax.jms.Session#createQueue
,
javax.jms.Session#createTopic
Constructor and Description |
---|
DynamicDestinationResolver() |
Modifier and Type | Method and Description |
---|---|
Destination |
resolveDestinationName(Session session,
java.lang.String destinationName,
boolean pubSubDomain)
Resolve the specified destination name as a dynamic destination.
|
protected Queue |
resolveQueue(Session session,
java.lang.String queueName)
Resolve the given destination name to a
Queue . |
protected Topic |
resolveTopic(Session session,
java.lang.String topicName)
Resolve the given destination name to a
Topic . |
public Destination resolveDestinationName(Session session, java.lang.String destinationName, boolean pubSubDomain) throws JMSException
resolveDestinationName
in interface DestinationResolver
session
- the current JMS SessiondestinationName
- the name of the destinationpubSubDomain
- true
if the domain is pub-sub, false
if P2Pjavax.jms.JMSException
- if resolution failedJMSException
#resolveTopic(javax.jms.Session, String)
,
#resolveQueue(javax.jms.Session, String)
protected Topic resolveTopic(Session session, java.lang.String topicName) throws JMSException
Topic
.session
- the current JMS SessiontopicName
- the name of the desired Topic
Topic
javax.jms.JMSException
- if resolution failedJMSException
Session#createTopic(String)
protected Queue resolveQueue(Session session, java.lang.String queueName) throws JMSException
Queue
.session
- the current JMS SessionqueueName
- the name of the desired Queue
Queue
javax.jms.JMSException
- if resolution failedJMSException
Session#createQueue(String)