Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.CapacityInfo


                catch (JMSException jmsEx) {
                    handleAsyncException(jmsEx);
                }
            }
            else if (packet.getPacketType() == Packet.CAPACITY_INFO) {
                CapacityInfo info = (CapacityInfo) packet;
                flowControlSleepTime = info.getFlowControlTimeout();
                //System.out.println("SET FLOW TIMEOUT = " + flowControlSleepTime + " FOR " + info);
            }
        }
    }
View Full Code Here


     *
     * @param event
     */
    public void capacityChanged(CapacityMonitorEvent event) {
        //send the event to broker ...
        CapacityInfo info = new CapacityInfo();
        info.setId(packetIdGenerator.generateId());
        info.setResourceName(event.getMonitorName());
        info.setCapacity(event.getCapacity());
        //System.out.println("Cap changed: " + event);
        try {
            asyncSendPacket(info, false);
        }
        catch (JMSException e) {
View Full Code Here

                            DurableUnsubscribe ds = (DurableUnsubscribe) packet;
                            brokerConnector.durableUnsubscribe(this, ds);
                            break;
                        }
                        case Packet.CAPACITY_INFO : {
                            CapacityInfo info = (CapacityInfo) packet;
                            consumeCapacityInfo(info);
                            break;
                        }
                        case Packet.CAPACITY_INFO_REQUEST : {
                            updateCapacityInfo(packet.getId());
View Full Code Here

     * Update the peer Connection about the Broker's capacity for messages
     *
     * @param capacity
     */
    public void updateBrokerCapacity(int capacity) {
        CapacityInfo info = new CapacityInfo();
        info.setResourceName(this.brokerConnector.getBrokerInfo().getBrokerName());
        info.setCapacity(capacity);
        info.setFlowControlTimeout(getFlowControlTimeout(capacity));
        send(info);
    }
View Full Code Here

    private void consumeCapacityInfo(CapacityInfo info) {
        this.capacity = info.getCapacity();
    }

    private void updateCapacityInfo(String correlationId) {
        CapacityInfo info = new CapacityInfo();
        info.setResourceName(this.brokerConnector.getBrokerInfo().getBrokerName());
        info.setCorrelationId(correlationId);
        info.setCapacity(this.brokerConnector.getBrokerCapacity());
        info.setFlowControlTimeout(getFlowControlTimeout(info.getCapacity()));
        send(info);
    }
View Full Code Here

                catch (JMSException jmsEx) {
                    handleAsyncException(jmsEx);
                }
            }
            else if (packet.getPacketType() == Packet.CAPACITY_INFO) {
                CapacityInfo info = (CapacityInfo) packet;
                flowControlSleepTime = info.getFlowControlTimeout();
                //System.out.println("SET FLOW TIMEOUT = " + flowControlSleepTime + " FOR " + info);
            }
        }
    }
View Full Code Here

     *
     * @param event
     */
    public void capacityChanged(CapacityMonitorEvent event) {
        //send the event to broker ...
        CapacityInfo info = new CapacityInfo();
        info.setId(packetIdGenerator.generateId());
        info.setResourceName(event.getMonitorName());
        info.setCapacity(event.getCapacity());
        //System.out.println("Cap changed: " + event);
        try {
            asyncSendPacket(info, false);
        }
        catch (JMSException e) {
View Full Code Here

                            DurableUnsubscribe ds = (DurableUnsubscribe) packet;
                            brokerConnector.durableUnsubscribe(this, ds);
                            break;
                        }
                        case Packet.CAPACITY_INFO : {
                            CapacityInfo info = (CapacityInfo) packet;
                            consumeCapacityInfo(info);
                            break;
                        }
                        case Packet.CAPACITY_INFO_REQUEST : {
                            updateCapacityInfo(packet.getId());
View Full Code Here

     * Update the peer Connection about the Broker's capacity for messages
     *
     * @param capacity
     */
    public void updateBrokerCapacity(int capacity) {
        CapacityInfo info = new CapacityInfo();
        info.setResourceName(this.brokerConnector.getBrokerInfo().getBrokerName());
        info.setCapacity(capacity);
        info.setFlowControlTimeout(getFlowControlTimeout(capacity));
        send(info);
    }
View Full Code Here

    private void consumeCapacityInfo(CapacityInfo info) {
        this.capacity = info.getCapacity();
    }

    private void updateCapacityInfo(String correlationId) {
        CapacityInfo info = new CapacityInfo();
        info.setResourceName(this.brokerConnector.getBrokerInfo().getBrokerName());
        info.setCorrelationId(correlationId);
        info.setCapacity(this.brokerConnector.getBrokerCapacity());
        info.setFlowControlTimeout(getFlowControlTimeout(info.getCapacity()));
        send(info);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.CapacityInfo

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.