Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.WireFormatInfo


                thread.setPriority(Thread.NORM_PRIORITY + 2);
            }
            thread.start();
            //send the wire format
            if (isServerSide()) {
                WireFormatInfo info = new WireFormatInfo();
                info.setVersion(getCurrentWireFormatVersion());
                asyncSend(info);
            }
        }
    }
View Full Code Here


    protected boolean doHandleWireFormat(Packet packet) {
        boolean handled = false;
        if (packet.getPacketType() == Packet.WIRE_FORMAT_INFO) {
            handled = true;
            WireFormatInfo info = (WireFormatInfo) packet;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                setPendingStop(true);
                String errorStr = "Cannot process wire format of version: " + info.getVersion();
                TransportStatusEvent event = new TransportStatusEvent();
                event.setChannelStatus(TransportStatusEvent.FAILED);
                fireStatusEvent(event);
                onAsyncException(new UnsupportedWireFormatException(errorStr));
                stop();
            }
            else {
                if (log.isDebugEnabled()) {
                    log.debug(this + " using wire format version: " + info.getVersion());
                }
            }
        }
        return handled;
    }
View Full Code Here

    protected boolean doHandleWireFormat(Packet packet) {
        boolean handled = false;
        if (packet.getPacketType() == Packet.WIRE_FORMAT_INFO) {
            handled = true;
            WireFormatInfo info = (WireFormatInfo) packet;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                setPendingStop(true);
                String errorStr = "Cannot process wire format of version: " + info.getVersion();
                TransportStatusEvent event = new TransportStatusEvent();
                event.setChannelStatus(TransportStatusEvent.FAILED);
                fireStatusEvent(event);
                onAsyncException(new UnsupportedWireFormatException(errorStr));
                stop();
            }
            else {
                if (log.isDebugEnabled()) {
                    log.debug(this + " using wire format version: " + info.getVersion());
                }
            }
        }
        return handled;
    }
View Full Code Here

     * @param dataOut
     * @param dataIn
     * @throws JMSException
     */
    public void initiateClientSideProtocol(DataOutputStream dataOut,DataInputStream dataIn) throws JMSException{
        WireFormatInfo info = new WireFormatInfo();
        info.setVersion(getCurrentWireFormatVersion());
        try {
            writePacket(info, dataOut);
            dataOut.flush();
        }
        catch (IOException e) {
View Full Code Here

            case Packet.CAPACITY_INFO :
                return readPacket(dataIn, capacityInfoReader);
            case Packet.CAPACITY_INFO_REQUEST :
                return readPacket(dataIn, capacityInfoRequestReader);
            case Packet.WIRE_FORMAT_INFO :
                WireFormatInfo info =  (WireFormatInfo)readPacket(dataIn, wireFormatInfoReader);
                if (info != null){
                    if (info.getVersion() < 3){
                        throw new IOException("Cannot support wire format version: " + info.getVersion());
                    }
                }
                return info;
           
            case Packet.KEEP_ALIVE :
View Full Code Here

            }
          
            this.transportChannel.setUsedInternally(internalConnection);
            this.transportChannel.start();
            if (transportChannel.doesSupportWireFormatVersioning()){
                WireFormatInfo info = new WireFormatInfo();
                info.setVersion( transportChannel.getCurrentWireFormatVersion() );
                this.asyncSendPacket(info);
            }
        }
        if (this.closed) {
            throw new IllegalStateException("The Connection is closed");
View Full Code Here

     * @throws IOException thrown if an error occurs
     */
    public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        dataOut.write(WireFormatInfo.MAGIC);
        super.writePacket(packet, dataOut);
        WireFormatInfo info = (WireFormatInfo) packet;
        dataOut.writeInt(info.getVersion());
    }
View Full Code Here

    /**
     * @return a new Packet instance
     */
    public Packet createPacket() {
        return new WireFormatInfo();
    }
View Full Code Here

                throw new IOException("Invalid WireFormatInfo packet.");
            }
        }
       
        super.buildPacket(packet, dataIn);
        WireFormatInfo info = (WireFormatInfo) packet;
        info.setVersion(dataIn.readInt());
        if (wireFormat != null){
            wireFormat.setCurrentWireFormatVersion(info.getVersion());
        }
    }
View Full Code Here

            if (useAsyncSend==false){
                this.transportChannel.setNoDelay(true);
            }
            this.transportChannel.start();
            if (transportChannel.doesSupportWireFormatVersioning()){
                WireFormatInfo info = new WireFormatInfo();
                info.setVersion( transportChannel.getCurrentWireFormatVersion() );
                this.asyncSendPacket(info);
            }
        }
        if (this.closed.get()) {
            throw new IllegalStateException("The Connection is closed");
View Full Code Here

TOP

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

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.