Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.SimpleChannelHandler


  public PipelineTester(ChannelPipeline pipeline) {
    LocalAddress address = new LocalAddress(LocalAddress.EPHEMERAL);

    ServerBootstrap sb = new ServerBootstrap(new DefaultLocalServerChannelFactory());

    pipeline.addLast("pipelineTesterEndpoint", new SimpleChannelHandler() {
      @Override
      public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        emittedInside.put(e.getMessage());
      }

      @Override
      public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
          throws Exception {
        super.channelConnected(ctx, e);
        innerChannel = e.getChannel();
      }
    });

    sb.setPipeline(pipeline);

    sb.bind(address);
    ClientBootstrap cb = new ClientBootstrap(new DefaultLocalClientChannelFactory());
    cb.getPipeline().addLast("1", new SimpleChannelHandler() {
      @Override
      public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
          throws Exception {
        super.channelConnected(ctx, e);
        outerChannel = 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))
                                return; // this is our own multicast
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

            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

        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

      /*
       * 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

      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

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.