org.springframework.jms.support.destination
Class DynamicDestinationResolver

java.lang.Object
  extended by org.springframework.jms.support.destination.DynamicDestinationResolver
All Implemented Interfaces:
DestinationResolver

public class DynamicDestinationResolver
extends Object
implements DestinationResolver

Simple implementation of the DestinationResolver interface, resolving destination names as dynamic destinations.

This implementation will work on both JMS 1.1 and JMS 1.0.2, because it uses the QueueSession or TopicSession methods if possible, falling back to JMS 1.1's generic Session methods.

Since:
1.1
Author:
Juergen Hoeller
See Also:
QueueSession.createQueue(java.lang.String), TopicSession.createTopic(java.lang.String), Session.createQueue(java.lang.String), Session.createTopic(java.lang.String)

Constructor Summary
DynamicDestinationResolver()
           
 
Method Summary
 Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain)
          Resolve the given destination name, either as located resource or as dynamic destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicDestinationResolver

public DynamicDestinationResolver()
Method Detail

resolveDestinationName

public Destination resolveDestinationName(Session session,
                                          String destinationName,
                                          boolean pubSubDomain)
                                   throws JMSException
Description copied from interface: DestinationResolver
Resolve the given destination name, either as located resource or as dynamic destination.

Specified by:
resolveDestinationName in interface DestinationResolver
Parameters:
session - the current JMS Session
destinationName - the name of the destination
pubSubDomain - whether the domain is pub-sub, else P2P
Returns:
the JMS destination (either a topic or a queue)
Throws:
JMSException - if resolution failed


Copyright (c) 2002-2007 The Spring Framework Project.