public class RouterWithInterceptors implements RequestHandler<ByteBuf, ByteBuf> {
private final HttpRequestHandler<ByteBuf, ByteBuf> delegate;
public RouterWithInterceptors() {
SimpleRouter router = new SimpleRouter();
HttpInterceptorSupport<ByteBuf, ByteBuf> interceptorSupport = new HttpInterceptorSupport<ByteBuf, ByteBuf>();
interceptorSupport.forUri("/*").intercept(new LoggingInterceptor());
interceptorSupport.forUri("/hello").intercept(new AuthInterceptor(new AuthenticationServiceImpl()));
delegate = new HttpRequestHandler<ByteBuf, ByteBuf>(router, interceptorSupport);
}