1 16 17 package org.springframework.jms.support.destination; 18 19 import javax.jms.Destination ; 20 import javax.jms.JMSException ; 21 import javax.jms.Session ; 22 23 import org.springframework.jms.support.JmsAccessor; 24 import org.springframework.util.Assert; 25 26 39 public abstract class JmsDestinationAccessor extends JmsAccessor { 40 41 private DestinationResolver destinationResolver = new DynamicDestinationResolver(); 42 43 private boolean pubSubDomain = false; 44 45 46 54 public void setDestinationResolver(DestinationResolver destinationResolver) { 55 Assert.notNull(destinationResolver, "'destinationResolver' must not be null"); 56 this.destinationResolver = destinationResolver; 57 } 58 59 62 public DestinationResolver getDestinationResolver() { 63 return this.destinationResolver; 64 } 65 66 77 public void setPubSubDomain(boolean pubSubDomain) { 78 this.pubSubDomain = pubSubDomain; 79 } 80 81 85 public boolean isPubSubDomain() { 86 return this.pubSubDomain; 87 } 88 89 90 99 protected Destination resolveDestinationName(Session session, String destinationName) throws JMSException { 100 return getDestinationResolver().resolveDestinationName(session, destinationName, isPubSubDomain()); 101 } 102 103 } 104 | Popular Tags |