Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.Packet


    private BrokerClient brokerClient;
    private Packet packet;


    public static TransactionTask fromBytes(byte[] data) throws IOException {
        Packet packet = wireFormat.fromBytes(data);
        return createTask(packet);
    }
View Full Code Here


    public byte[] toBytes() throws JMSException, IOException {
        return wireFormat.toBytes(packet);
    }

    public static TransactionTask readTask(ObjectInput in) throws IOException {
        Packet packet = readPacket(in);
        return createTask(packet);
    }
View Full Code Here

        }

        public void run() {
            while (internalCount < localCount) {
                try {
                    Packet obj = queue.dequeue();
                    if (obj != null) {
                        count.increment();
                        internalCount++;
                        if (count.get() == TOTAL_LOAD) {
                            synchronized (mutex) {
View Full Code Here

                    // lets discard messages coming from the local address
                    // to avoid infinite loops when used with the JMS broker
                    if (!localAddress.equals(message.getSrc())) {
                        byte[] data = message.getBuffer();
                        Packet packet = wireFormat.fromBytes(data);
                        if (packet != null) {
                            doConsumePacket(packet);
                        }
                    }
                }
View Full Code Here

    }

    private void dispatch(UpPacket p) {
        try {
            // Dont dispatch messages until the channel is started..
            Packet packet = toPacket(p);
            log.trace("<<<< SENDING UP <<<< " + packet);
            if (packet != null) {
                doConsumePacket(packet);
            }
        }
View Full Code Here

                    stop();
                }
                else {
                    socket.setSoTimeout(0);

                    Packet packet = wireFormat.readPacket(type, dataIn);
                    if (packet != null) {
                        doConsumePacket(packet);
                    }
                }
            }
View Full Code Here

     */
    public void run() {
        try {
            while (!closed.get()) {
                DatagramPacket dpacket = socket.receive();
                Packet packet = wireFormat.readPacket(channelId, dpacket);
                if (packet != null) {
                    doConsumePacket(packet);
                }
            }
            log.trace("The socket peer is now closed");
View Full Code Here

    public void testRpc() throws Exception {
        rpcTest = true;

        List tmpList = (List) packets.clone();
        for (int i = 0; i < TEST_SIZE; i++) {
            Packet packet = (Packet) tmpList.get(i);
            Receipt receipt = sender.send(packet, 4000);
            assertTrue("Receipt should not be null!", receipt != null);
            System.out.println("Got receipt: " + receipt + " for packet: " + packet);
        }
View Full Code Here

        sender.setClientID("sender");
        sender.start();

        packets = new ArrayList(TEST_SIZE);
        for (int i = 0; i < TEST_SIZE; i++) {
            Packet test = new ActiveMQMessage();
            test.setId("test:" + i);
            packets.add(test);
        }
    }
View Full Code Here

                DatagramPacket dpacket = createDatagramPacket();
                while (!socket.isClosed()) {
                    socket.setSoTimeout(0);
                    socket.receive(dpacket);
                    Packet packet = wireFormat.readPacket(getClientID(), dpacket);
                    if (packet != null) {
                        doConsumePacket(packet);
                    }
                }
View Full Code Here

TOP

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

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.