Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQDestination


        return ((Queue)destination).moveMatchingMessagesTo(context, selector, toDestination);
    }

    public 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);
    }
View Full Code Here


        Queue queue = (Queue) destination;
        Message rc = queue.getMessage(messageId);
        if (rc != null) {
            rc = rc.copy();
            rc.getMessage().setRedeliveryCounter(0);
            ActiveMQDestination originalDestination = rc.getOriginalDestination();
            if (originalDestination != null) {
                ConnectionContext context = BrokerSupport.getConnectionContext(broker.getContextBroker());
                return queue.moveMessageTo(context, rc, originalDestination);
            }
            else {
View Full Code Here

     */
    protected void startDestinations() throws Exception {
        if (destinations != null) {
            ConnectionContext adminConnectionContext = getAdminConnectionContext();
            for (int i = 0; i < destinations.length; i++) {
                ActiveMQDestination destination = destinations[i];
                getBroker().addDestination(adminConnectionContext, destination,true);
            }
        }
    }
View Full Code Here

                context.setBroker(broker);
                adminConnectionContext = context;
                broker.setAdminConnectionContext(adminConnectionContext);
            }
            while (iter.hasNext()) {
                ActiveMQDestination destination = (ActiveMQDestination) iter.next();
                broker.addDestination(adminConnectionContext, destination,false);
            }
        }
    }
View Full Code Here

            ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION.length());

        if (schedularManage == true) {

          JobScheduler scheduler = getInternalScheduler();
          ActiveMQDestination replyTo = messageSend.getReplyTo();

          String action = (String) messageSend.getProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION);

          if (action != null ) {
View Full Code Here

    public void removeAdvisoryTopics(String destinationType, ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception {
        if (this.brokerService.isAdvisorySupport()) {
            String producerAdvisoryTopic = AdvisorySupport.PRODUCER_ADVISORY_TOPIC_PREFIX + destinationType + destination.getPhysicalName();
            String consumerAdvisoryTopic = AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX + destinationType + destination.getPhysicalName();

            ActiveMQDestination dests[] = getDestinations();
            for (ActiveMQDestination dest: dests) {
                String name = dest.getPhysicalName();
                if ( name.equals(producerAdvisoryTopic) || name.equals(consumerAdvisoryTopic) ) {
                    try {
                        removeDestination(context, dest, timeout);
View Full Code Here

    public ActiveMQDestination[] getDestinations() throws Exception {
        ArrayList<ActiveMQDestination> l;

        l = new ArrayList<ActiveMQDestination>(getDestinationMap().keySet());

        ActiveMQDestination rc[] = new ActiveMQDestination[l.size()];
        l.toArray(rc);
        return rc;
    }
View Full Code Here

        return rc;
    }

    @Override
    public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception {
        ActiveMQDestination destination = info.getDestination();
        synchronized (purgeInactiveDestinationsTask) {
            if (destination != null) {

                // This seems to cause the destination to be added but without
                // advisories firing...
                context.getBroker().addDestination(context, destination, false);
                switch (destination.getDestinationType()) {
                case ActiveMQDestination.QUEUE_TYPE:
                    queueRegion.addProducer(context, info);
                    break;
                case ActiveMQDestination.TOPIC_TYPE:
                    topicRegion.addProducer(context, info);
View Full Code Here

        }
    }

    @Override
    public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception {
        ActiveMQDestination destination = info.getDestination();
        synchronized (purgeInactiveDestinationsTask) {
            if (destination != null) {
                switch (destination.getDestinationType()) {
                case ActiveMQDestination.QUEUE_TYPE:
                    queueRegion.removeProducer(context, info);
                    break;
                case ActiveMQDestination.TOPIC_TYPE:
                    topicRegion.removeProducer(context, info);
View Full Code Here

        }
    }

    @Override
    public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
        ActiveMQDestination destination = info.getDestination();
        synchronized (purgeInactiveDestinationsTask) {
            switch (destination.getDestinationType()) {
            case ActiveMQDestination.QUEUE_TYPE:
                return queueRegion.addConsumer(context, info);

            case ActiveMQDestination.TOPIC_TYPE:
                return topicRegion.addConsumer(context, info);
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ActiveMQDestination

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.