Package org.apache.geronimo.network.protocol

Examples of org.apache.geronimo.network.protocol.ProtocolException


        ByteBuffer buffer = packet.getBuffer();
        byte[] b = new byte[buffer.remaining()];
        buffer.get(b);
        for (int i = buffer.position(); i < buffer.limit(); i++) {
            if (b[i] != (byte) 0x0b) throw new ProtocolException("bb");
        }
        Subject subject = MetadataSupport.getSubject(packet);
        if (subject != null) log.trace("Subject passed: " + subject);

        if (getUpProtocol() != null) getUpProtocol().sendUp(packet);
View Full Code Here


    }

    public void sendDown(DownPacket packet) throws ProtocolException {
        try {
          log.trace("AQUIRING send Latch: "+sendLatch);
            if (!sendLatch.attempt(1000 * 1000)) throw new ProtocolException("Send timeout.");
          log.trace("AQUIRED send Latch: "+sendLatch);
            super.sendDown(packet);
        } catch (InterruptedException e) {
            throw new ProtocolException(e);
        }
    }
View Full Code Here

    public UpPacket read(ByteBuffer buffer) throws ProtocolException {
        String key = PacketUtil.getString(buffer);
        PacketFactory factory = (PacketFactory) factories.get(key);

        if (factory == null) throw new ProtocolException("No factory registered for " + key);

        return factory.create(buffer.slice());
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.network.protocol.ProtocolException

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.