Package org.activemq.message

Examples of org.activemq.message.CapacityInfo


     *
     * @param event
     */
    public void capacityChanged(CapacityMonitorEvent event) {
        //send the event to broker ...
        CapacityInfo info = new CapacityInfo();
        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


     * @throws IOException thrown if an error occurs
     */

    public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        super.writePacket(packet, dataOut);
        CapacityInfo info = (CapacityInfo) packet;
        super.writeUTF(info.getResourceName(), dataOut);
        dataOut.writeShort(info.getCorrelationId());
        dataOut.writeByte(info.getCapacity());
        dataOut.writeInt((int)info.getFlowControlTimeout());
    }
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(short 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.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.