Java Code Examples for org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline#get()

The following examples show how to use org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline#get() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RouterHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private void routed(
		ChannelHandlerContext channelHandlerContext,
		RouteResult<?> routeResult,
		HttpRequest httpRequest) {
	ChannelInboundHandler handler = (ChannelInboundHandler) routeResult.target();

	// The handler may have been added (keep alive)
	ChannelPipeline pipeline     = channelHandlerContext.pipeline();
	ChannelHandler addedHandler = pipeline.get(ROUTED_HANDLER_NAME);
	if (handler != addedHandler) {
		if (addedHandler == null) {
			pipeline.addAfter(ROUTER_HANDLER_NAME, ROUTED_HANDLER_NAME, handler);
		} else {
			pipeline.replace(addedHandler, ROUTED_HANDLER_NAME, handler);
		}
	}

	RoutedRequest<?> request = new RoutedRequest<>(routeResult, httpRequest);
	channelHandlerContext.fireChannelRead(request.retain());
}
 
Example 2
Source File: RouterHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private void routed(
		ChannelHandlerContext channelHandlerContext,
		RouteResult<?> routeResult,
		HttpRequest httpRequest) {
	ChannelInboundHandler handler = (ChannelInboundHandler) routeResult.target();

	// The handler may have been added (keep alive)
	ChannelPipeline pipeline     = channelHandlerContext.pipeline();
	ChannelHandler addedHandler = pipeline.get(ROUTED_HANDLER_NAME);
	if (handler != addedHandler) {
		if (addedHandler == null) {
			pipeline.addAfter(ROUTER_HANDLER_NAME, ROUTED_HANDLER_NAME, handler);
		} else {
			pipeline.replace(addedHandler, ROUTED_HANDLER_NAME, handler);
		}
	}

	RoutedRequest<?> request = new RoutedRequest<>(routeResult, httpRequest);
	channelHandlerContext.fireChannelRead(request.retain());
}
 
Example 3
Source File: RouterHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private void routed(
		ChannelHandlerContext channelHandlerContext,
		RouteResult<?> routeResult,
		HttpRequest httpRequest) {
	ChannelInboundHandler handler = (ChannelInboundHandler) routeResult.target();

	// The handler may have been added (keep alive)
	ChannelPipeline pipeline     = channelHandlerContext.pipeline();
	ChannelHandler addedHandler = pipeline.get(ROUTED_HANDLER_NAME);
	if (handler != addedHandler) {
		if (addedHandler == null) {
			pipeline.addAfter(ROUTER_HANDLER_NAME, ROUTED_HANDLER_NAME, handler);
		} else {
			pipeline.replace(addedHandler, ROUTED_HANDLER_NAME, handler);
		}
	}

	RoutedRequest<?> request = new RoutedRequest<>(routeResult, httpRequest);
	channelHandlerContext.fireChannelRead(request.retain());
}