Package org.activemq.io

Examples of org.activemq.io.WireFormat


        if (started.commit(false, true)) {
            thread = new Thread(this, toString());
            try {
                if (isServerSide()) {
                    thread.setDaemon(true);
                    WireFormat wf = wireFormatLoader.getWireFormat(dataIn);
                    if (wf != null) {
                        setWireFormat(wf);
                    }
                    getWireFormat().registerTransportStreams(dataOut, dataIn);
                    getWireFormat().initiateServerSideProtocol();
View Full Code Here


        if (started.commit(false, true)) {
            thread = new Thread(this, toString());
            try {
                if (isServerSide()) {
                    thread.setDaemon(true);
                    WireFormat wf = wireFormatLoader.getWireFormat(dataIn);
                    if (wf != null) {
                        setWireFormat(wf);
                    }
                    getWireFormat().registerTransportStreams(dataOut, dataIn);
                    getWireFormat().initiateServerSideProtocol();
View Full Code Here

        }
        return (URI) list.remove(idx);
    }

    protected void attemptToConnect(URI uri) throws JMSException {
        WireFormat wf = currentWireFormat.copy();
        channel = TransportChannelProvider.create(wf, uri);
        if (started.get()) {
            channel.start();
        }
    }
View Full Code Here

    protected TransportChannel populateProperties(TransportChannel channel, Map properties) throws JMSException {
        String wireFormatName = (String) properties.remove("wireFormat");
        if (wireFormatName != null) {
            wireFormatName = wireFormatName.trim();
            if (wireFormatName.length() > 0) {
                WireFormat wf = WireFormatLoader.getWireFormat(wireFormatName);
                if (wf != null) {
                    channel.setWireFormat(wf);
                }
            }
        }
View Full Code Here

        if (started.commit(false, true)) {
            thread = new Thread(this, toString());
            try {
                if (isServerSide()) {
                    thread.setDaemon(true);
                    WireFormat wf = wireFormatLoader.getWireFormat(dataIn);
                    if (wf != null) {
                        setWireFormat(wf);
                    }
                    getWireFormat().registerTransportStreams(dataOut, dataIn);
                    getWireFormat().initiateServerSideProtocol();
View Full Code Here

    protected PacketWriter writer;
    protected PacketReader reader;
    protected int packetCount = 10;

    public void testWireFormat() throws IOException, JMSException {
        WireFormat wireFormat = new DefaultWireFormat();

        Packet packet = createPacket();
        System.out.println("Created packet: " + packet + " with type: " + packet.getPacketType());

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        DataOutputStream dataOut = new DataOutputStream(buffer);
        wireFormat.writePacket(packet, dataOut);
        dataOut.close();
        byte[] bytes = buffer.toByteArray();

        DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(bytes));
        int type = dataIn.readByte();
        System.out.println("Read type: " + type);
        Packet otherPacket = wireFormat.readPacket(type, dataIn);

        System.out.println("Read packet: " + otherPacket);
        assertPacket(otherPacket, packet);
    }
View Full Code Here

TOP

Related Classes of org.activemq.io.WireFormat

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.