Refine search
/** * This method creates a single pipeline object that will be shared for all * the channels. */ public void init() { pipeline = pipeline(); pipeline.addLast("messageBufferEventDecoder", messageBufferEventDecoder); pipeline.addLast("upstream", upstream); // Downstream handlers - Filter for data which flows from server to // client. Note that the last handler added is actually the first // handler for outgoing data. pipeline.addLast("messageBufferEventEncoder",messageBufferEventEncoder); }
@Override public ChannelPipeline getPipeline() { NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this); ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", adapter.getDecoder()); pipeline.addLast("encoder", adapter.getEncoder()); pipeline.addLast("handler", nettyHandler); return pipeline; } });
@Override public ChannelPipeline getPipeline() { NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyClient.this); ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", adapter.getDecoder()); pipeline.addLast("encoder", adapter.getEncoder()); pipeline.addLast("handler", nettyHandler); return pipeline; } });
@Override public ChannelPipeline getPipeline() { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("channel_manage", channelManage); pipeline.addLast("decoder", new NettyDecoder(codec, NettyServer.this, maxContentLength)); pipeline.addLast("encoder", new NettyEncoder(codec, NettyServer.this)); pipeline.addLast("nettyChannelHandler", nettyChannelHandler); return pipeline; } });
@Override public ChannelPipeline getPipeline() { NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyServer.this); ChannelPipeline pipeline = Channels.pipeline(); /*int idleTimeout = getIdleTimeout(); if (idleTimeout > 10000) { pipeline.addLast("timer", new IdleStateHandler(timer, idleTimeout / 1000, 0, 0)); }*/ pipeline.addLast("decoder", adapter.getDecoder()); pipeline.addLast("encoder", adapter.getEncoder()); pipeline.addLast("handler", nettyHandler); return pipeline; } });
public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipelines = Channels.pipeline(); pipelines.addLast(FixedHeaderFrameDecoder.class.getName(), new FixedHeaderFrameDecoder()); // support to maintain child socket channel. pipelines.addLast(HandshakeInitializationHandler.class.getName(), new HandshakeInitializationHandler(childGroups)); pipelines.addLast(ClientAuthenticationHandler.class.getName(), new ClientAuthenticationHandler(embeddedServer)); SessionHandler sessionHandler = new SessionHandler(embeddedServer); pipelines.addLast(SessionHandler.class.getName(), sessionHandler); return pipelines; } });
@Override public ChannelPipeline getPipeline() { NettyCodecAdapter adapter = new NettyCodecAdapter(getCodec(), getUrl(), NettyServer.this); ChannelPipeline pipeline = Channels.pipeline(); /*int idleTimeout = getIdleTimeout(); if (idleTimeout > 10000) { pipeline.addLast("timer", new IdleStateHandler(timer, idleTimeout / 1000, 0, 0)); }*/ pipeline.addLast("decoder", adapter.getDecoder()); pipeline.addLast("encoder", adapter.getEncoder()); pipeline.addLast("handler", nettyHandler); return pipeline; } });
/** * Creates a new {@link ChannelPipeline} which contains the same entries * with the specified {@code pipeline}. Please note that only the names * and the references of the {@link ChannelHandler}s will be copied; a new * {@link ChannelHandler} instance will never be created. */ public static ChannelPipeline pipeline(ChannelPipeline pipeline) { ChannelPipeline newPipeline = pipeline(); for (Map.Entry<String, ChannelHandler> e: pipeline.toMap().entrySet()) { newPipeline.addLast(e.getKey(), e.getValue()); } return newPipeline; }
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = Channels.pipeline(); // Decoder pipeline.addLast("decoder", new MessageDecoder(false, conf)); // Encoder pipeline.addLast("encoder", new MessageEncoder()); // business logic. pipeline.addLast("handler", new StormClientHandler(client)); return pipeline; } }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("idleStateCheck", new IdleStateHandler(timer, 0, 0, MAX_IDLE_SECONDS)); pipeline.addLast("idleCheckHandler", idleCheckHandler); pipeline.addLast("multiplexer", createProtcolMultiplexerDecoder()); return pipeline; }
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = Channels.pipeline(); // Decoder pipeline.addLast("decoder", new MessageDecoder(true, conf)); // Encoder pipeline.addLast("encoder", new MessageEncoder()); // business logic. pipeline.addLast("handler", new StormServerHandler(server)); return pipeline; } }
/** * Creates a new {@link ChannelPipeline} which contains the specified * {@link ChannelHandler}s. The names of the specified handlers are * generated automatically; the first handler's name is {@code "0"}, * the second handler's name is {@code "1"}, the third handler's name is * {@code "2"}, and so on. */ public static ChannelPipeline pipeline(ChannelHandler... handlers) { if (handlers == null) { throw new NullPointerException("handlers"); } ChannelPipeline newPipeline = pipeline(); for (int i = 0; i < handlers.length; i ++) { ChannelHandler h = handlers[i]; if (h == null) { break; } newPipeline.addLast(ConversionUtil.toString(i), h); } return newPipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("lengthDecoder", new LengthFieldBasedFrameDecoder( Integer.MAX_VALUE, 0, 2, 0, 2)); pipeline.addLast("eventDecoder", EVENT_DECODER); pipeline.addLast(DefaultToClientHandler.getName(), defaultToClientHandler); // Down stream handlers are added now. Note that the last one added to // pipeline is actually the first encoder in the pipeline. pipeline.addLast("lengthFieldPrepender", LENGTH_FIELD_PREPENDER); pipeline.addLast("eventEncoder", EVENT_ENCODER); return pipeline; } }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("connectionStats", connectionStatsHandler); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(maxHttpContentLength)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new RestServerRequestHandler(storeRepository)); pipeline.addLast("storageExecutionHandler", storageExecutionHandler); return pipeline; }
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", getFlashPolicyServerHandler()); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_AGGREGATE_SIZE)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new CoordinatorAdminRequestHandler(storeClientConfigs)); return pipeline; }
@Override public ChannelPipeline getPipeline() { final ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", new NettyDecoder(codec, NettyClient.this, maxContentLength)); pipeline.addLast("encoder", new NettyEncoder(codec, NettyClient.this)); pipeline.addLast("handler", new NettyChannelHandler(NettyClient.this, new MessageHandler() { @Override public Object handle(Channel channel, Object message) { Response response = (Response) message; ResponseFuture responseFuture = NettyClient.this.removeCallback(response.getRequestId()); if (responseFuture == null) { LoggerUtil.warn( "NettyClient has response from server, but resonseFuture not exist, requestId={}", response.getRequestId()); return null; } if (response.getException() != null) { responseFuture.onFailure(response); } else { responseFuture.onSuccess(response); } return null; } })); return pipeline; } });
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); // Add the text line codec combination first, DelimiterBasedFrameDecoder frameDecoder = new DelimiterBasedFrameDecoder( maxCommandLength, Delimiters.lineDelimiter()); pipeline.addLast("framer", frameDecoder); pipeline.addLast("decoder", new WordSplitter()); pipeline.addLast("encoder", new StringEncoder()); // and then business logic. pipeline.addLast("handler", this); return pipeline; }