Examples of UpstreamMessageEvent


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

Examples of org.jboss.netty.channel.UpstreamMessageEvent

      HttpRequest request = (HttpRequest)e.getMessage();
      HttpMethod method = request.getMethod();
      // if we are a post then we send upstream, otherwise we are just being prompted for a response.
      if (method.equals(HttpMethod.POST))
      {
         MessageEvent event = new UpstreamMessageEvent(e.getChannel(), request.getContent(), e.getRemoteAddress());
         ctx.sendUpstream(event);
      }
      // add a new response
      responses.put(new ResponseHolder(System.currentTimeMillis() + responseTime,
                                       new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK)));
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

                    break;
            }
        }

        if (e instanceof UpstreamMessageEvent) {
            UpstreamMessageEvent ume = (UpstreamMessageEvent) e;
            if (ume.getMessage() instanceof ChannelBuffer) {
                ChannelBuffer cb = (ChannelBuffer) ume.getMessage();
                int readableBytes = cb.readableBytes();
                //  compute stats here, bytes read from remote
                bytesRead.getAndAdd(readableBytes);
            }
        }
View Full Code Here

Examples of org.jboss.netty.channel.UpstreamMessageEvent

      HttpRequest request = (HttpRequest)e.getMessage();
      HttpMethod method = request.getMethod();
      // if we are a post then we send upstream, otherwise we are just being prompted for a response.
      if (method.equals(HttpMethod.POST))
      {
         MessageEvent event = new UpstreamMessageEvent(e.getChannel(), request.getContent(), e.getRemoteAddress());
         ctx.sendUpstream(event);
      }
      // add a new response
      responses.put(new ResponseHolder(System.currentTimeMillis() + responseTime,
                                       new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK)));
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

        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().getName())
                .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
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.