Examples of ChannelPipeline


Examples of org.jboss.netty.channel.ChannelPipeline

      catch (Throwable e)
      {
        Constants.ahessianLogger.warn("", e);
      }
    }
    ChannelPipeline p = _sessionPipelines.remove(session.getId());
    if (p instanceof StopablePipeline)
      ((StopablePipeline)p).stop();

  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

 
  private void handleSession(ChannelHandlerContext ctx, MixinPipeline pipeline)
  {
    _hasSession = true;
    // now that we have a session extend the pipeline
    ChannelPipeline currentPipeline = ctx.getPipeline();
    pipeline.mixin(currentPipeline);
    ctx.setAttachment(_session);
    ctx.sendUpstream(_connectedEvent);
  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

      Constants.ahessianLogger.warn(ctx.getChannel()+" session already attached -> close connection");
      c.close();
    }
   
    // now that we have a session extend the pipeline
    ChannelPipeline currentPipeline = ctx.getPipeline();
    pipeline.mixin(currentPipeline);
    ctx.setAttachment(session);
    _channel = ctx.getChannel();
    // first send session and wait until it has been transmitted
    ChannelFuture future = Channels.future(ctx.getChannel());
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

  }

  public ChannelPipeline getPipeline() throws Exception
  {
    ChannelPipeline pipeline = StopablePipeline.pipeline();
    // pipeline.addLast("logger1",new OutLogger("1"));
    pipeline.addLast("ipfilter", _ipFilter);
    pipeline.addLast("inputStream", new InputStreamDecoder());
    // pipeline.addLast("logger2",new OutLogger("2"));
    pipeline.addLast("outputStream", new OutputStreamEncoder());
    pipeline.addLast("callDecoder", new PullInputStreamConsumer(new HessianRPCCallDecoder(new JmxSerializerFactory()), _executor));
    pipeline.addLast("replyEncoder", new HessianRPCReplyEncoder(new JmxSerializerFactory()));
    // pipeline.addLast("logger3",new OutLogger("3"));
    pipeline.addLast("outputProducer", new OutputProducer(_executor));
    pipeline.addLast("hessianRPCServer", _factory);
    pipeline.addLast("stopHandler", new StopHandler());

    return pipeline;
  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

    _executor = executor;
  }
 
  public ChannelPipeline getPipeline() throws Exception
 
      ChannelPipeline pipeline = pipeline(); // Note the static import.
        // InputStreamDecoder returns an input stream and calls the next handler in a separate thread

        pipeline.addLast("inputStream", new InputStreamDecoder());

        //pipeline.addLast("logger2",new OutLogger("2"));
        pipeline.addLast("outputStream", new OutputStreamEncoder());
       
        pipeline.addLast("hessianReplyDecoder", new PullInputStreamConsumer(new HessianRPCReplyDecoder(_factory), _executor));
        pipeline.addLast("hessianCallEncoder", new HessianRPCCallEncoder());
        pipeline.addLast("outputProducer", new OutputProducer(_executor));
        //pipeline.addLast("logger3",new OutLogger("3"));
        pipeline.addLast("hessianHandler", _factory);

    return pipeline;
  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

{
  ChannelPipelineFactory factory = new ChannelPipelineFactory()
  {
    public ChannelPipeline getPipeline() throws Exception
    {
      ChannelPipeline pipeline = pipeline();
      pipeline.addLast("discoveryServer", new SimpleChannelUpstreamHandler()
      {

        @Override
        public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
        {
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

{

  @Override
  public void channelClosed(final ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception
  {
    ChannelPipeline p = ctx.getPipeline();
    if (p instanceof StopablePipeline)
      ((StopablePipeline)p).stop();
  }
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

    ChannelPipelineFactory factory = new ChannelPipelineFactory()
    {
      public ChannelPipeline getPipeline() throws Exception
      {
        ChannelPipeline pipeline = pipeline();
        pipeline.addLast("discoveryServer", new SimpleChannelUpstreamHandler()
        {

          @Override
          public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
          {
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

    //introspect connection to server
    Channel channel = conn._channel;
    SocketAddress clientAddr = channel.getLocalAddress();

    Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
    ChannelPipeline serverPipeline = serverChannel.getPipeline();
    SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");

    Assert.assertTrue(objCapture.waitForMessage(1000, 0));
    Object msgObj = objCapture.getMessages().get(0);
    Assert.assertTrue(msgObj instanceof HttpRequest);
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipeline

        }

        final BlockingQueue<ChannelFuture> futureQueue =
            new LinkedBlockingQueue<ChannelFuture>();

        ChannelPipeline bossPipeline = pipeline();
        bossPipeline.addLast("binder", new Binder(localAddress, futureQueue));

        ChannelHandler parentHandler = getParentHandler();
        if (parentHandler != null) {
            bossPipeline.addLast("userHandler", parentHandler);
        }

        Channel channel = getFactory().newChannel(bossPipeline);

        // Wait until the future is available.
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.