Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.Broker


          System.out.println("Broker Connector:" + httpConnector.getUri().toString()
                  + " is stopped");
        }
        service.getManagementContext().stop();
        service.stop();
        Broker broker = service.getBroker();
        while (!broker.isStopped()) {
          synchronized (monitor) {
            try {
              monitor.wait(20); // wait for the broker to terminate
            } catch (Exception e) {
            }
View Full Code Here


            sendStats(context, statsMessage, replyTo);
        }
    }

    protected ActiveMQMapMessage prepareSubscriptionMessage(SubscriptionViewMBean subscriber) throws JMSException {
        Broker regionBroker = getBrokerService().getRegionBroker();
        ActiveMQMapMessage statsMessage = new ActiveMQMapMessage();
        statsMessage.setString("brokerName", regionBroker.getBrokerName());
        statsMessage.setString("brokerId", regionBroker.getBrokerId().toString());
        statsMessage.setString("destinationName", subscriber.getDestinationName());
        statsMessage.setString("clientId", subscriber.getClientId());
        statsMessage.setString("connectionId", subscriber.getConnectionId());
        statsMessage.setLong("sessionId", subscriber.getSessionId());
        statsMessage.setString("selector", subscriber.getSelector());
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

                forwarded_message = message;
            }

            // Send it back through the region broker for routing.
            context.setMutable(true);
            Broker regionBroker = context.getConnectionContext().getBroker().getBrokerService().getRegionBroker();
            regionBroker.send(context, forwarded_message);
        }
        if (!forwardOnly) {
            super.send(context, message);
        }
    }
View Full Code Here

                }
            });
        }

        try {
            Broker broker = multiKahaDBPersistenceAdapter.getBrokerService().getBroker();
            // force completion of local xa
            for (TransactionId txid : broker.getPreparedTransactions(null)) {
                if (multiKahaDBPersistenceAdapter.isLocalXid(txid)) {
                    try {
                        if (recoveredPendingCommit.contains(txid)) {
                            LOG.info("delivering pending commit outcome for tid: " + txid);
                            broker.commitTransaction(null, txid, false);

                        } else {
                            LOG.info("delivering rollback outcome to store for tid: " + txid);
                            broker.forgetTransaction(null, txid);
                        }
                        persistCompletion(txid);
                    } catch (Exception ex) {
                        LOG.error("failed to deliver pending outcome for tid: " + txid, ex);
                    }
View Full Code Here

          httpConnector.stop();
          System.out.println("Broker Connector:"+httpConnector.getUri().toString()+ " is stopped");
        }
        service.getManagementContext().stop();
        service.stop();
        Broker broker =  service.getBroker();
        while( !broker.isStopped() )
        {
          synchronized( monitor )
          {
            try
            {
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

        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) {
View Full Code Here

     * @param message message to send
     * @param destination possibly wildcard destination to send the message to
     * @throws Exception on error
     */
    protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
        Broker broker = context.getConnectionContext().getBroker();
        Set<Destination> destinations = broker.getDestinations(destination);

        for (Destination dest : destinations) {
            dest.send(context, message.copy());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.Broker

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.