Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TTL/Context transmission on Android | Android 客户端使用TTL进行上下文传递 #88

Open
qianxinyi opened this issue Apr 8, 2018 · 4 comments

Comments

@qianxinyi
Copy link

qianxinyi commented Apr 8, 2018

How to transmit context transparently in Android client premain?


在Android 客户端premain 如何进行上下文透明传递?

@oldratlee
Copy link
Member

oldratlee commented Apr 8, 2018

Support for Android was not considered before, mainly because

  • Implementation mechanism for Android
  • Application scenarios

I don't know much.

@qianxinyi can you explain that? Or Do the (similar) implementations exist to meet the needs?


Android支持之前没有考虑,主要是因为

  • Android的要做的实现机制
  • 应用场景

我了解不多。

@qianxinyi 你能说明一下吗?可以有(类似)实现方式做到满足需求吗?

@qianxinyi
Copy link
Author

比如,我想做客户端日志调用链的形成,在涉及到多线程执行的时候,就要用你这个TTL框架。但是要想做到透明传输,就要写gradle插件修改JDK源码。不知道大神能写个gradle插件以供小白使用

@oldratlee
Copy link
Member

oldratlee commented Apr 8, 2018

JDK的库的代码(逻辑)在Android中是不是系统接管的?
换句话说,编译期修改不了,而是要运行期加载时修改。 @qianxinyi

如果是运行期加载时修改,要了解Android的运行加载过程。
这个你来研究完成一下,运行时系统类的修改 在Android上应该已经有现成的解决方案了。
# JDK的库的代码(逻辑)修改的量不多,在相关的方法插入了一行代码。

方案和实现你整理好了,我可以整合进来,author是你 😄

@oldratlee oldratlee changed the title Android 客户端使用TTL进行上下文传递 Support TTL/Context transmission on Android | Android 客户端使用TTL进行上下文传递 Dec 13, 2019
@mxj0808
Copy link

mxj0808 commented Apr 7, 2024

大佬们,这个后续有结论了吗?我目前具备将TTL的代码插入Android源码方法中的能力,但是对于业务的线程池却不大好封装,因为业务的线程池使用方法很多,很难统一收归,请问有解决办法吗? @oldratlee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants