Package org.codehaus.activemq.broker

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


    /**
     * @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

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

    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

    /**
     * @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

    /**
     * @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

            // 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

     * @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

TOP

Related Classes of org.codehaus.activemq.broker.BrokerClient

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.