@Override public Object convert(Object value) { return ActiveMQDestination.createDestination((String)value, ActiveMQDestination.QUEUE_TYPE); } });
/** * Sets the destination property to the given queue name */ public void setQueue(String queue) { setDestination(ActiveMQDestination.createDestination(queue, ActiveMQDestination.QUEUE_TYPE)); }
MessageInterceptor addMessageInterceptor(String destinationName, MessageInterceptor messageInterceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); interceptorMap.put(activeMQDestination, messageInterceptor); return messageInterceptor; }
MessageInterceptor addMessageInterceptorForTopic(String destinationName, MessageInterceptor messageInterceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TOPIC_TYPE); interceptorMap.put(activeMQDestination, messageInterceptor); return messageInterceptor; }
/** * Sets the destination property to the given topic name */ public void setTopic(String topic) { setDestination(ActiveMQDestination.createDestination(topic, ActiveMQDestination.TOPIC_TYPE)); }
MessageInterceptor addMessageInterceptorForQueue(String destinationName, MessageInterceptor messageInterceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); interceptorMap.put(activeMQDestination, messageInterceptor); return messageInterceptor; }
/** * Get the BrokerDestinationView associated with destination * @param destinationName * @param type expects either ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE etc * @return BrokerDestinationView * @throws Exception */ public BrokerDestinationView getDestinationView (String destinationName, byte type) throws Exception { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName,type); return getDestinationView(activeMQDestination); }
void removeMessageInterceptor(String destinationName, MessageInterceptor interceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); interceptorMap.remove(activeMQDestination, interceptor); }
void removeMessageInterceptorForTopic(String destinationName, MessageInterceptor interceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TOPIC_TYPE); interceptorMap.remove(activeMQDestination, interceptor); }
void removeMessageInterceptorForQueue(String destinationName, MessageInterceptor interceptor) { ActiveMQDestination activeMQDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); interceptorMap.remove(activeMQDestination, interceptor); }
public ActiveMQDestination createDestination(String name) { return createDestination(name, getDestinationType()); }
protected ActiveMQDestination convertDestination(ActiveMQDestination destination) { if (destination != null && destination.getPhysicalName().contains(pathSeparator)) { List<String> l = new ArrayList<String>(); StringTokenizer iter = new StringTokenizer(destination.getPhysicalName(), pathSeparator); while (iter.hasMoreTokens()) { String name = iter.nextToken().trim(); if (name.length() == 0) { continue; } l.add(name); } String newName = DestinationPath.toString(l.toArray(new String[l.size()])); return ActiveMQDestination.createDestination(newName, destination.getDestinationType()); } else { return destination; } }
@Override public Set<ActiveMQDestination> doGetDestinations(TransactionContext c) throws SQLException, IOException { HashSet<ActiveMQDestination> rc = new HashSet<ActiveMQDestination>(); PreparedStatement s = null; ResultSet rs = null; try { s = c.getConnection().prepareStatement(this.statements.getFindAllDestinationsStatement()); rs = s.executeQuery(); while (rs.next()) { rc.add(ActiveMQDestination.createDestination(rs.getString(1), ActiveMQDestination.QUEUE_TYPE)); } } finally { close(rs); close(s); } return rc; }
protected void importDestinations() throws Exception { BufferedReader reader = null; try { if (location.exists()) { reader = new BufferedReader(new FileReader(location)); String destination; Broker broker = getBrokerService().getBroker(); while ((destination = reader.readLine()) != null) { broker.addDestination(getBrokerService().getAdminConnectionContext(), ActiveMQDestination.createDestination(destination, ActiveMQDestination.QUEUE_TYPE), true); } } } catch (Exception e) { LOG.warn("Exception loading destinations", e); } finally { if (reader != null) { reader.close(); } } }
public int copyMatchingMessagesTo(String selector, String destinationName) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).copyMatchingMessagesTo(context, selector, toDestination); }
public int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).copyMatchingMessagesTo(context, selector, toDestination, maximumMessages); }
public boolean moveMessageTo(String messageId, String destinationName) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).moveMessageTo(context, messageId, toDestination); }
public synchronized int moveMatchingMessagesTo(String selector, String destinationName) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination); }
public boolean copyMessageTo(String messageId, String destinationName) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).copyMessageTo(context, messageId, toDestination); }
public synchronized int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception { ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker()); ActiveMQDestination toDestination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.QUEUE_TYPE); return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination, maximumMessages); }