Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.SimpleChannelHandler


    static void setHandshaker(ChannelHandlerContext ctx, WebSocketServerHandshaker handshaker) {
        ctx.setAttachment(handshaker);
    }

    static ChannelHandler forbiddenHttpRequestResponder() {
        return new SimpleChannelHandler() {
            @Override
            public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
                if (!(e.getMessage() instanceof WebSocketFrame)) {
                    DefaultHttpResponse response = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.FORBIDDEN);
                    ctx.getChannel().write(response);
View Full Code Here


      /*
       * The vector for data leaving the netty channel and entering the
       * business application logic.
       */
      final SimpleChannelHandler ddfHandler = new ChannelHandlerDDF(
          eventQueue, messageQueue);

      final ChannelPipelineFactory pipelineFactory = new PipelineFactoryDDF(
          ddfHandler);

View Full Code Here

      this.channel = e.getChannel();

      // post ddf link connect
      postEvent(DDF_FeedEvent.LINK_CONNECT);

      final SimpleChannelHandler ddfHandler = new ChannelHandlerDDF(
          eventQueue, messageQueue);

      channel.getPipeline().addLast("ddf frame decoder",
          new MsgDeframerDDF());
View Full Code Here

        bootstrap.setPipelineFactory(new UdpMessagePipelineFactory(LOG, new ChannelNodeAddressResolver(addressResolver), receiveExecutor) {
            @Override
            public ChannelPipeline getPipeline() throws Exception {
                final ChannelPipeline pipeline = super.getPipeline();
                pipeline.addLast("router", new SimpleChannelHandler() {
                    @Override
                    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
                        if (ctx.getChannel() == multicastChannel) {
                            if (e.getRemoteAddress().equals(myAddress))
                                return; // this is our own multicast
View Full Code Here

            return false;
        }

        Random rand = new Random();
        List<String> expectedNames = new ArrayList<String>();
        ChannelHandler dummyHandler = new SimpleChannelHandler();
        for (int i = 0; i < 65536; i ++) {
            String filterName;
            do {
                filterName = String.valueOf(rand.nextInt());
            } while (newMap.containsKey(filterName));
View Full Code Here

            MockMongo.this));

        handler.setDeleteHandler(new DefaultDeleteHandler(
            MockMongo.this));

        return Channels.pipeline(new SimpleChannelHandler() {

          @Override
          public void channelOpen(ChannelHandlerContext ctx,
              ChannelStateEvent e) throws Exception {
            channels.add(e.getChannel());
View Full Code Here

        bootstrap.setPipelineFactory(new UdpMessagePipelineFactory(LOG, new ChannelNodeAddressResolver(addressResolver), receiveExecutor) {

            @Override
            public ChannelPipeline getPipeline() throws Exception {
                final ChannelPipeline pipeline = super.getPipeline();
                pipeline.addLast("router", new SimpleChannelHandler() {

                    @Override
                    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
                        if (ctx.getChannel() == multicastChannel) {
                            if (e.getRemoteAddress().equals(myAddress))
View Full Code Here

      /*
       * The vector for data leaving the netty channel and entering the
       * business application logic.
       */
      final SimpleChannelHandler ddfHandler = new ChannelHandlerDDF(
          eventQueue, messageQueue);

      final ChannelPipelineFactory pipelineFactory = new PipelineFactoryDDF(
          ddfHandler);

View Full Code Here

      this.channel = e.getChannel();

      // post ddf link connect
      postEvent(DDF_FeedEvent.LINK_CONNECT);

      final SimpleChannelHandler ddfHandler = new ChannelHandlerDDF(
          eventQueue, messageQueue);

      channel.getPipeline().addLast("ddf frame decoder",
          new MsgDeframerDDF());
View Full Code Here

      /*
       * The vector for data leaving the netty channel and entering the
       * business application logic.
       */
      final SimpleChannelHandler ddfHandler = new ChannelHandlerDDF(
          eventQueue, messageQueue);

      final ChannelPipelineFactory pipelineFactory = new PipelineFactoryDDF(
          ddfHandler);

View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.SimpleChannelHandler

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.