RESTEasy | ServerWriterInterceptorContext中注入TracingLogger的设计思路

先分析AbstractWriterInterceptorContext

AbstractWriterInterceptorContext是不带http request的,也就没法直接获得tracing logger:

解决方案就是使用ServerWriterInterceptorContextHttpRequest实例来注入logger:

AbstractWriterInterceptorContext旧有的constructor标记为deprecated:

新的constructor接受logger:

这样我们就可以在proceed(...)方法里使用tracingLogger

至于客户端的ClientWriterInterceptorContext,还没有想好如何注入tracing logger,初步的想法是从ResteasyProviderFactory着手。到时候具体要分析client这边对ResteasyProviderFactory的初始化过程。

My Github Page: https://github.com/liweinan

Powered by Jekyll and Theme by solid

If you have any question want to ask or find bugs regarding with my blog posts, please report it here:
https://github.com/liweinan/liweinan.github.io/issues