Package org.jboss.netty.handler.timeout

Examples of org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask


        if (producer.getConfiguration().getRequestTimeout() > 0) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using request timeout {} millis", producer.getConfiguration().getRequestTimeout());
            }
            ChannelHandler timeout = new ReadTimeoutHandler(NettyComponent.getTimer(), producer.getConfiguration().getRequestTimeout(), TimeUnit.MILLISECONDS);
            pipeline.addLast("timeout", timeout);
        }

        // handler to route Camel messages
        pipeline.addLast("handler", new HttpClientChannelHandler(producer));
View Full Code Here


        if (readTimeoutTimer == null) {
            readTimeoutTimer = new HashedWheelTimer();
        }

        pipeline.addLast("readTimeout", new ReadTimeoutHandler(readTimeoutTimer,
                                                               conf.getReadTimeout()));
        pipeline.addLast("lengthbasedframedecoder", new LengthFieldBasedFrameDecoder(MAX_FRAME_LENGTH, 0, 4, 0, 4));
        pipeline.addLast("mainhandler", this);
        return pipeline;
    }
View Full Code Here

        RPCChannelHandler channelHandler =
                new RPCChannelHandler(syncManager, rpcService);

        IdleStateHandler idleHandler =
                new IdleStateHandler(timer, 5, 10, 0);
        ReadTimeoutHandler readTimeoutHandler =
                new ReadTimeoutHandler(timer, 30);
       
        ChannelPipeline pipeline = Channels.pipeline();
        pipeline.addLast("idle", idleHandler);
        pipeline.addLast("timeout", readTimeoutHandler);
        pipeline.addLast("handshaketimeout",
View Full Code Here

        super();
        this.controller = controller;
        this.pipelineExecutor = pipelineExecutor;
        this.timer = new HashedWheelTimer();
        this.idleHandler = new IdleStateHandler(timer, 20, 25, 0);
        this.readTimeoutHandler = new ReadTimeoutHandler(timer, 30);
    }
View Full Code Here

    private final Timer timer = new HashedWheelTimer();

    public ChannelPipeline getPipeline() throws Exception {
        // Create a default pipeline implementation.
        ChannelPipeline pipeline = pipeline();
        pipeline.addLast("timeout", new ReadTimeoutHandler(timer, 30));
        pipeline.addLast("decoder", new FlashPolicyServerDecoder());
        pipeline.addLast("handler", new FlashPolicyServerHandler());
        return pipeline;
    }
View Full Code Here

        // Configure the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {

            private final ChannelHandler timeoutHandler =
                new ReadTimeoutHandler(timer, READ_TIMEOUT);
            private final ChannelHandler uptimeHandler =
                new UptimeClientHandler(bootstrap, timer);

            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
View Full Code Here

        // do we use request timeout?
        if (producer.getConfiguration().getRequestTimeout() > 0) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("Using request timeout {} millis", producer.getConfiguration().getRequestTimeout());
            }
            ChannelHandler timeout = new ReadTimeoutHandler(NettyComponent.getTimer(), producer.getConfiguration().getRequestTimeout(), TimeUnit.MILLISECONDS);
            addToPipeline("timeout", channelPipeline, timeout);
        }

        // our handler must be added last
        addToPipeline("handler", channelPipeline, new ClientChannelHandler(producer));
View Full Code Here

    @Override
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      Timer timer = new HashedWheelTimer();
      pipeline.addLast("timeout", new ReadTimeoutHandler(timer, 30));
      pipeline.addLast("codec", new HttpClientCodec());

      if (ssl) {
        SSLContext sslContext = SSLContext.getInstance("TLS");
        //sslContext.init(keyManagers, trustManagers, null);
View Full Code Here

        // Configure the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
                        new ReadTimeoutHandler(timer, READ_TIMEOUT),
                        new UptimeClientHandler(bootstrap, timer));
            }
        });

        bootstrap.setOption(
View Full Code Here

        Preconditions.checkNotNull(readTimeout, "readTimeout is null");
        Preconditions.checkNotNull(maxContentLength, "maxContentLength is null");

        this.nettyConnectionPool = nettyConnectionPool;
        this.executor = executor;
        this.timeoutHandler = new ReadTimeoutHandler(this.timer, readTimeout.toMillis(), TimeUnit.MILLISECONDS);
        this.maxContentLength = Ints.checkedCast(maxContentLength.toBytes());
    }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask

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.