Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ProducerInfo


            for (Iterator i = consumers.iterator();i.hasNext();) {
                ConsumerInfo info = (ConsumerInfo) i.next();
                generateAdvisory(advisory, info);
            }
            for (Iterator i = producers.iterator();i.hasNext();) {
                ProducerInfo info = (ProducerInfo) i.next();
                generateAdvisory(advisory, info);
            }
            for (Iterator i = connections.iterator();i.hasNext();) {
                ConnectionInfo info = (ConnectionInfo) i.next();
                generateAdvisory(advisory, info);
View Full Code Here


                    syncSendPacket(consumerInfo);
                }
                //send producers
                for (Iterator producersIterator = session.producers.iterator(); producersIterator.hasNext();) {
                    ActiveMQMessageProducer producer = (ActiveMQMessageProducer) producersIterator.next();
                    ProducerInfo producerInfo = session.createProducerInfo(producer);
                    producerInfo.setStarted(true);
                    syncSendPacket(producerInfo);
                }
            }
        }
        catch (JMSException jmsEx) {
View Full Code Here

                            ConsumerInfo info = (ConsumerInfo) packet;
                            consumeConsumerInfo(info);
                            break;
                        }
                        case Packet.PRODUCER_INFO : {
                            ProducerInfo info = (ProducerInfo) packet;
                            consumeProducerInfo(info);
                            break;
                        }
                        case Packet.SESSION_INFO : {
                            SessionInfo info = (SessionInfo) packet;
View Full Code Here

                    for (Iterator i = consumers.iterator();i.hasNext();) {
                        ConsumerInfo ci = (ConsumerInfo) i.next();
                        ci.setClientId(info.getClientId());
                    }
                    for (Iterator i = producers.iterator();i.hasNext();) {
                        ProducerInfo pi = (ProducerInfo) i.next();
                        pi.setClientId(info.getClientId());
                    }
                    for (int i = 0;i < dispatchQueue.size();i++) {
                        ActiveMQMessage msg = (ActiveMQMessage) dispatchQueue.get(i);
                        dispatch(msg);
                    }
View Full Code Here

                        ConsumerInfo info = (ConsumerInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterMessageConsumer(this, info);
                    }
                    for (Iterator i = producers.iterator();i.hasNext();) {
                        ProducerInfo info = (ProducerInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterMessageProducer(this, info);
                    }
                    for (Iterator i = sessions.iterator();i.hasNext();) {
                        SessionInfo info = (SessionInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterSession(this, info);
                    }
                    for (Iterator i = transactions.iterator();i.hasNext();) {
                        this.brokerConnector.rollbackTransaction(this, i.next().toString());
                    }
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new ProducerInfo();
    }
View Full Code Here

     * @throws IOException
     */

    public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
        super.buildPacket(packet, dataIn);
        ProducerInfo info = (ProducerInfo) packet;
        info.setProducerId(dataIn.readUTF());
        info.setClientId(dataIn.readUTF());
        info.setSessionId(dataIn.readUTF());
        info.setStartTime(dataIn.readLong());
        info.setStarted(dataIn.readBoolean());
        info.setDestination(ActiveMQDestination.readFromStream(dataIn));
    }
View Full Code Here

     * @throws IOException thrown if an error occurs
     */

    public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        super.writePacket(packet, dataOut);
        ProducerInfo info = (ProducerInfo) packet;
        super.writeUTF(info.getProducerId(), dataOut);
        super.writeUTF(info.getClientId(), dataOut);
        super.writeUTF(info.getSessionId(), dataOut);
        dataOut.writeLong(info.getStartTime());
        dataOut.writeBoolean(info.isStarted());
        ActiveMQDestination.writeToStream(info.getDestination(), dataOut);
    }
View Full Code Here

        ProducerInfoReader reader = new ProducerInfoReader();
        assertTrue(reader.getPacketType() == Packet.PRODUCER_INFO);
    }

    public void testReadPacket() {
        ProducerInfo info = new ProducerInfo();
        info.setId(this.producerId);
        info.setClientId(this.clientId);
        info.setDestination(this.destination);
        info.setStartTime(this.startTime);
        info.setStarted(this.started);

        ProducerInfoWriter writer = new ProducerInfoWriter();
        ProducerInfoReader reader = new ProducerInfoReader();
        try {
            byte[] data = writer.writePacketToByteArray(info);
            ProducerInfo testInfo = (ProducerInfo) reader.readPacketFromByteArray(data);

            assertTrue(testInfo.getId().equals(this.producerId));
            assertTrue(testInfo.getClientId().equals(this.clientId));
            assertTrue(testInfo.getDestination().equals(this.destination));
            assertTrue(testInfo.getStartTime() == this.startTime);
            assertTrue(testInfo.isStarted() == this.started);
        }
        catch (Throwable e) {
            e.printStackTrace();
            assertTrue(false);
        }
View Full Code Here

        }
    }

    public void testTime() {

        ProducerInfo info = new ProducerInfo();
        info.setId(this.producerId);
        info.setClientId(this.clientId);
        info.setDestination(this.destination);
        info.setStartTime(this.startTime);
        info.setStarted(this.started);

        ProducerInfoWriter writer = new ProducerInfoWriter();
        ProducerInfoReader reader = new ProducerInfoReader();
        ProducerInfo testInfo = null;
        try {
            int count = 100000;
            long startTime = System.currentTimeMillis();
            for (int i = 0; i < count; i++) {
                byte[] data = writer.writePacketToByteArray(info);
View Full Code Here

TOP

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

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.