1 18 package org.apache.activemq.broker.region.virtual; 19 20 import org.apache.activemq.broker.region.Destination; 21 import org.apache.activemq.command.ActiveMQDestination; 22 import org.apache.activemq.command.ActiveMQQueue; 23 import org.apache.activemq.command.ActiveMQTopic; 24 25 35 public class VirtualTopic implements VirtualDestination { 36 37 private String prefix = "Consumer.*."; 38 private String postfix = ""; 39 private String name = ">"; 40 41 42 public ActiveMQDestination getVirtualDestination() { 43 return new ActiveMQTopic(getName()); 44 } 45 46 public Destination intercept(Destination destination) { 47 return new VirtualTopicInterceptor(destination, getPrefix(), getPostfix()); 48 } 49 50 53 public String getPostfix() { 54 return postfix; 55 } 56 57 60 public void setPostfix(String postfix) { 61 this.postfix = postfix; 62 } 63 64 public String getPrefix() { 65 return prefix; 66 } 67 68 72 public void setPrefix(String prefix) { 73 this.prefix = prefix; 74 } 75 76 public String getName() { 77 return name; 78 } 79 80 public void setName(String name) { 81 this.name = name; 82 } 83 84 protected ActiveMQDestination getQueueConsumersWildcard(ActiveMQDestination original) { 87 return new ActiveMQQueue(prefix + original.getPhysicalName() + postfix); 88 } 89 90 91 } 92 | Popular Tags |