Examples of BrokerClient


Examples of org.codehaus.activemq.broker.BrokerClient

    }

    private void generateAdvisory(ConsumerInfo advisory, ConsumerInfo info) {
        if (matchConsumer(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = ActiveMQDestination.CONSUMER_ADVISORY_PREFIX + info.getDestination() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    }

    private void generateAdvisory(ConsumerInfo advisory, ProducerInfo info) {
        if (matchProducer(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = ActiveMQDestination.CONSUMER_ADVISORY_PREFIX + info.getDestination() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    }

    private void generateAdvisory(ConsumerInfo advisory, ConnectionInfo info) {
        if (matchConnection(advisory, info)) {
            //find the client for ther advisory
            BrokerClient client = (BrokerClient) advisoryConsumers.get(advisory);
            String suffix = info.isStarted() ? "started" : "stopped";
            String destName = advisory.getDestination().getPhysicalName() + suffix;
            ActiveMQDestination dest = ActiveMQDestination.createDestination(advisory.getDestination()
                    .getDestinationType(), destName);
            generateAdvisoryMessage(advisory, client, info, dest);
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    //-------------------------------------------------------------------------

    protected boolean dispatchMessages(Subscription subscription, boolean dispatched) throws JMSException {
        ActiveMQMessage[] msgs = subscription.getMessagesToDispatch();
        if (msgs != null && msgs.length > 0) {
            BrokerClient client = (BrokerClient) subscriptions.get(subscription);
            if (client == null) {
                log.warn("Null client for subscription: " + subscription);
            }
            else {
                for (int i = 0; i < msgs.length; i++) {
                    ActiveMQMessage msg = msgs[i].shallowCopy();

                    if (log.isDebugEnabled()) {
                        log.debug("Dispatching message: " + msg);
                    }
                    int[] consumerNos = new int[1];
                    consumerNos[0] = subscription.getConsumerNumber();
                    msg.setConsumerNos(consumerNos);
                    client.dispatch(msg);
                    dispatched = true;
                }
            }
        }
        return dispatched;
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

            // lets close all the channels
            // note that this Map implementation does not throw concurrent modification exception
            for (Iterator iter = clientIds.values().iterator(); iter.hasNext();) {
                // should remove clients from parent container?
                BrokerClient client = (BrokerClient) iter.next();
                try {
                    client.stop();
                }
                catch (JMSException e) {
                    if (firstException == null) {
                        firstException = e;
                    }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

     * @param event
     */
    public void capacityChanged(CapacityMonitorEvent event) {
        //only send to producers
        for (Iterator i = producerInfos.values().iterator(); i.hasNext();) {
            BrokerClient client = (BrokerClient) i.next();
            client.updateBrokerCapacity(event.getCapacity());
        }
    }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    /**
     * @param channel - client to add
     */
    public void addClient(TransportChannel channel) {
        try {
            BrokerClient client = new BrokerClientImpl();
            client.initialize(this, channel);
            if (log.isDebugEnabled()) {
                log.debug("Starting new client: " + client);
            }
            channel.start();
            clients.put(channel, client);
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    /**
     * @param channel - client to remove
     */
    public void removeClient(TransportChannel channel) {
        BrokerClient client = (BrokerClient) clients.remove(channel);
        if (client != null) {
            if (log.isDebugEnabled()) {
                log.debug("Client leaving client: " + client);
            }

            // we may have already been closed, if not then lets simulate a normal shutdown
            client.cleanUp();
        }
        else {
            // might have got a duplicate callback
            log.warn("No such client for channel: " + channel);
        }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    //-------------------------------------------------------------------------

    protected boolean dispatchMessages(Subscription subscription, boolean dispatched) throws JMSException {
        ActiveMQMessage[] msgs = subscription.getMessagesToDispatch();
        if (msgs != null && msgs.length > 0) {
            BrokerClient client = (BrokerClient) subscriptions.get(subscription);
            if (client == null) {
                log.warn("Null client for subscription: " + subscription);
            }
            else {
                for (int i = 0; i < msgs.length; i++) {
                    ActiveMQMessage msg = msgs[i].shallowCopy();

                    if (log.isDebugEnabled()) {
                        log.debug("Dispatching message: " + msg);
                    }
                    int[] consumerNos = new int[1];
                    consumerNos[0] = subscription.getConsumerNumber();
                    msg.setConsumerNos(consumerNos);
                    client.dispatch(msg);
                    dispatched = true;
                }
            }
        }
        return dispatched;
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerClient

    /**
     * @param channel - client to add
     */
    public void addClient(TransportChannel channel) {
        try {
            BrokerClient client = new BrokerClientImpl();
            client.initialize(this, channel);
            if (log.isDebugEnabled()) {
                log.debug("Starting new client: " + client);
            }
            channel.setServerSide(true);
            channel.start();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.