Examples of UpstreamMessageEvent


Examples of org.jboss.netty.channel.UpstreamMessageEvent

        RpcMessage response = RpcMessage.newBuilder()
                .setType(MessageType.RESPONSE)
                .setId(1)
                .setResponse(sudokuResponse.toByteString())
                .build();
        channel.messageReceived(null, new UpstreamMessageEvent(mockChannel, response, null));
        assertEquals(sudokuResponse, gotResponse);
    }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

                .setService(SudokuService.getDescriptor().getFullName())
                .setMethod("Solve")
                .setRequest(sudokuRequest.toByteString())
                .build();

        channel.messageReceived(null, new UpstreamMessageEvent(mockChannel, request, null));
        assertEquals(sudokuRequest, gotRequest);

        RpcMessage response = RpcMessage.newBuilder()
                .setType(MessageType.RESPONSE)
                .setId(2)
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

               }
            }
            active = true;
            handShakeFuture.run();
         }
         MessageEvent event = new UpstreamMessageEvent(e.getChannel(), response.getContent(), e.getRemoteAddress());
         waitingGet = false;
         ctx.sendUpstream(event);
      }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

      Map<String, List<String>> jsonMap = GSON.fromJson(json, MAP_TYPE);
      GDATFormatUtil.encode(jsonMap.get("data"), schema, outputStream, false);
      ChannelBuffer dataRecordBuffer = ChannelBuffers.copiedBuffer(outputStream.getByteArray(), 0,
                                                                   outputStream.length());
      outputStream.reset();
      MessageEvent newMessageEvent = new UpstreamMessageEvent(ctx.getChannel(), dataRecordBuffer, e.getRemoteAddress());
      super.messageReceived(ctx, newMessageEvent);
    }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

      buffer.writeBytes((ChannelBuffer) e.getMessage());
      while (true) {
        if (dataRecordLength != -1 && buffer.readableBytes() >= dataRecordLength) {
          ChannelBuffer channelBuffer = buffer.readBytes(dataRecordLength);
          dataRecordLength = -1;
          super.messageReceived(ctx, new UpstreamMessageEvent(e.getChannel(), channelBuffer, e.getRemoteAddress()));
        } else if (dataRecordLength == -1 && buffer.readableBytes() >= Ints.BYTES) {
          //We want to pass both the length bytes and the data bytes and so using getBytes so that readerIndex
          //is not changed.
          buffer.getBytes(buffer.readerIndex(), lengthBytes, 0, Ints.BYTES);
          //Length Data is encoded as an Integer in Big Endian Format.
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

          ctx.getPipeline().remove("headerDecoder");
          LOG.info("Output Stream {} : Received Schema!", outputName);
          //Send any remaining bytes in ChannelBuffer upstream.
          if (buffer.readableBytes() != 0) {
            ChannelBuffer newBuffer = buffer.readBytes(buffer.readableBytes());
            super.messageReceived(ctx, new UpstreamMessageEvent(e.getChannel(), newBuffer, e.getRemoteAddress()));
            break;
          }
        } else {
          break;
        }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

        log.debug(new String(Arrays.toString(array)));
        return;
      }

      final MessageEvent eventOut =
          new UpstreamMessageEvent(eventIn.getChannel(), messageDDF,
              null);

      context.sendUpstream(eventOut);

    } else {
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

        log.debug(new String(Arrays.toString(array)));
        return;
      }

      final MessageEvent eventOut =
          new UpstreamMessageEvent(eventIn.getChannel(), messageDDF,
              null);

      context.sendUpstream(eventOut);

    } else {
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

               }
            }
            active = true;
            handShakeFuture.run();
         }
         MessageEvent event = new UpstreamMessageEvent(e.getChannel(), response.getContent(), e.getRemoteAddress());
         waitingGet = false;
         ctx.sendUpstream(event);
      }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

               }
            }
            active = true;
            handShakeFuture.run();
         }
         MessageEvent event = new UpstreamMessageEvent(e.getChannel(), response.getContent(), e.getRemoteAddress());
         waitingGet = false;
         ctx.sendUpstream(event);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.