Package org.gradle.messaging.remote.internal.hub.protocol

Examples of org.gradle.messaging.remote.internal.hub.protocol.ChannelMessage


        public InterHubMessage read() throws Exception {
            switch (decoder.readByte()) {
                case CHANNEL_MESSAGE:
                    ChannelIdentifier channelId = readChannelId();
                    Object payload = payloadReader.read();
                    return new ChannelMessage(channelId, payload);
                case END_STREAM_MESSAGE:
                    return new EndOfStream();
                default:
                    throw new IllegalArgumentException();
            }
View Full Code Here


            this.payloadWriter = payloadWriter;
        }

        public void write(InterHubMessage message) throws Exception {
            if (message instanceof ChannelMessage) {
                ChannelMessage channelMessage = (ChannelMessage) message;
                encoder.writeByte(CHANNEL_MESSAGE);
                writeChannelId(channelMessage);
                payloadWriter.write(channelMessage.getPayload());
            } else if (message instanceof EndOfStream) {
                encoder.writeByte(END_STREAM_MESSAGE);
            } else {
                throw new IllegalArgumentException();
            }
View Full Code Here

    void discardQueued() {
        List<InterHubMessage> rejected = new ArrayList<InterHubMessage>();
        drain(rejected);
        for (InterHubMessage message : rejected) {
            if (message instanceof ChannelMessage) {
                ChannelMessage channelMessage = (ChannelMessage) message;
                incomingQueue.queue(new RejectedMessage(channelMessage.getChannel(), channelMessage.getPayload()));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.gradle.messaging.remote.internal.hub.protocol.ChannelMessage

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.