hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baosen Cui <coderec2...@gmail.com>
Subject [httpcore] How about add a route inteceptor
Date Sat, 24 Dec 2016 02:18:06 GMT
I had meet a problem that I need to log the time cost by  method
“establishRoute”( in httpclient ).

Since there’s not something seems to support, I wrote a interceptor into
HttpCore coping the structure of “HttpProcessor"

Could I commit the code to HttpCore? I just wonder if HttpCore would accept
the function.

There’re some code, but not all. Just for example.


@ThreadSafe // provided injected dependencies are immutable

public final class ImmutableRouteProcessor implements RouteProcessor {

...

}


public interface PostRouteInterceptor {

  void postProcess(final HttpRequest request, final HttpContext context);

}


public interface PreRouteInterceptor {

  void preProcess(final HttpRequest request, final HttpContext context);

}


public interface RouteProcessor extends PreRouteInterceptor,
PostRouteInterceptor {

}


Baosen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message