Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.WireFormatInfo


     * @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

    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

            Packet packet = wireFormat.fromString(readRequestBody(request));
           
            if( packet.getPacketType() == Packet.WIRE_FORMAT_INFO ) {
               
                // Can we handle the requested wire format?
                WireFormatInfo info = (WireFormatInfo) packet;
                if (!canProcessWireFormatVersion(info.getVersion())) {
                  response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion());
                }
               
            } else {           
              HttpServerTransportChannel transportChannel = getTransportChannel(request);
              if (transportChannel == null) {
View Full Code Here

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

     * @param dataIn the data input stream to build the packet from
     * @throws IOException
     */
    public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
        super.buildPacket(packet, dataIn);
        WireFormatInfo info = (WireFormatInfo) packet;
        info.setVersion(dataIn.readInt());
        if (wireFormat != null){
            wireFormat.setCurrentWireFormatVersion(info.getVersion());
        }
    }
View Full Code Here

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

                thread.setPriority(Thread.NORM_PRIORITY + 2);
            }
            thread.start();
            //send the wire format
            if (isServerSide()) {
                WireFormatInfo info = new WireFormatInfo();
                info.setVersion(getCurrentWireFormatVersion());
                asyncSend(info);
            }else {
                try {
                getWireFormat().initiateProtocol(dataOut);
                dataOut.flush();
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

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.