master f90093277928 cached
281 files
1.1 MB
306.9k tokens
970 symbols
1 requests
Download .txt
Showing preview only (1,254K chars total). Download the full file or copy to clipboard to get everything.
Repository: alibaba/transmittable-thread-local
Branch: master
Commit: f90093277928
Files: 281
Total size: 1.1 MB

Directory structure:
gitextract_ll2vt13l/

├── .editorconfig
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yaml
│       └── strong_ci.yaml
├── .gitignore
├── .gitmodules
├── .mvn/
│   └── wrapper/
│       └── maven-wrapper.properties
├── CONTRIBUTING.md
├── LICENSE
├── README-EN.md
├── README.md
├── SECURITY.md
├── docs/
│   ├── TransmittableThreadLocal.asta
│   ├── TransmittableThreadLocal.pptx
│   ├── developer-guide-en.md
│   ├── developer-guide.md
│   ├── logo.md
│   ├── performance-test.md
│   ├── release-action-list.md
│   └── requirement-scenario.md
├── mvnw
├── mvnw.cmd
├── pom.xml
├── scripts/
│   ├── bump-ttl-version.sh
│   ├── check-japi-compliance.sh
│   ├── codecov.sh
│   ├── integration-test.sh
│   ├── perf-test/
│   │   ├── memoryleak-ThreadLocal.sh
│   │   ├── memoryleak-TransmittableThreadLocal.sh
│   │   ├── tps-ThreadLocal.sh
│   │   └── tps-TransmittableThreadLocal.sh
│   ├── release.sh
│   └── run-agent-demo.sh
├── src/
│   └── package-list/
│       ├── java/
│       │   └── package-list
│       ├── jetbrains-annotations/
│       │   └── package-list
│       ├── jsr305/
│       │   └── package-list
│       └── spotbugs-annotations/
│           └── package-list
├── ttl-agent/
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── alibaba/
│                       └── ttl3/
│                           └── agent/
│                               ├── TtlAgent.java
│                               ├── TtlAgentHelper.java
│                               ├── TtlExtensionTransformletManager.java
│                               ├── TtlTransformer.java
│                               ├── logging/
│                               │   ├── Logger.java
│                               │   └── package-info.java
│                               ├── package-info.java
│                               └── transformlet/
│                                   ├── ClassInfo.java
│                                   ├── TtlTransformlet.java
│                                   ├── helper/
│                                   │   ├── AbstractExecutorTtlTransformlet.java
│                                   │   ├── TtlTransformletHelper.java
│                                   │   └── package-info.java
│                                   ├── internal/
│                                   │   ├── ForkJoinTtlTransformlet.java
│                                   │   ├── JdkExecutorTtlTransformlet.java
│                                   │   ├── PriorityBlockingQueueTtlTransformlet.java
│                                   │   ├── TimerTaskTtlTransformlet.java
│                                   │   └── package-info.java
│                                   └── package-info.java
├── ttl-bom/
│   └── pom.xml
├── ttl-core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── alibaba/
│       │   │           ├── crr/
│       │   │           │   ├── TransmitCallback.java
│       │   │           │   ├── Transmittable.java
│       │   │           │   ├── composite/
│       │   │           │   │   ├── Backup.java
│       │   │           │   │   ├── Capture.java
│       │   │           │   │   ├── CompositeTransmitCallback.java
│       │   │           │   │   ├── CompositeTransmittable.java
│       │   │           │   │   └── package-info.java
│       │   │           │   └── package-info.java
│       │   │           └── ttl3/
│       │   │               ├── TransmittableThreadLocal.java
│       │   │               ├── TtlCallable.java
│       │   │               ├── TtlRecursiveAction.java
│       │   │               ├── TtlRecursiveTask.java
│       │   │               ├── TtlRunnable.java
│       │   │               ├── TtlTimerTask.java
│       │   │               ├── TtlWrappers.java
│       │   │               ├── agent/
│       │   │               │   ├── EmptyTtlAgentStatus.java
│       │   │               │   ├── TtlAgentStatus.java
│       │   │               │   └── package-info.java
│       │   │               ├── executor/
│       │   │               │   ├── ComparableComparator.java
│       │   │               │   ├── DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
│       │   │               │   ├── DisableInheritableThreadFactoryWrapper.java
│       │   │               │   ├── ExecutorServiceTtlWrapper.java
│       │   │               │   ├── ExecutorTtlWrapper.java
│       │   │               │   ├── ScheduledExecutorServiceTtlWrapper.java
│       │   │               │   ├── TtlExecutors.java
│       │   │               │   ├── TtlUnwrapComparator.java
│       │   │               │   └── package-info.java
│       │   │               ├── internal/
│       │   │               │   └── util/
│       │   │               │       ├── Assert.java
│       │   │               │       ├── ConcurrentReferenceHashMap.java
│       │   │               │       ├── ObjectUtils.java
│       │   │               │       └── Utils.java
│       │   │               ├── package-info.java
│       │   │               ├── spi/
│       │   │               │   ├── TtlAttachments.java
│       │   │               │   ├── TtlAttachmentsDelegate.java
│       │   │               │   ├── TtlEnhanced.java
│       │   │               │   ├── TtlWrapper.java
│       │   │               │   └── package-info.java
│       │   │               └── transmitter/
│       │   │                   ├── ThreadLocalTransmitRegistry.java
│       │   │                   ├── Transmittee.java
│       │   │                   ├── TransmitteeRegistry.java
│       │   │                   ├── Transmitter.java
│       │   │                   └── package-info.java
│       │   └── javadoc/
│       │       └── overview.html
│       └── test/
│           └── java/
│               └── com/
│                   └── alibaba/
│                       ├── Utils.kt
│                       ├── demo/
│                       │   ├── cow/
│                       │   │   └── CowDemo.kt
│                       │   ├── forkjoinpool/
│                       │   │   ├── ForkJoinPoolDemo.kt
│                       │   │   └── ParallelStreamDemo.kt
│                       │   ├── scheduled_thread_pool_executor/
│                       │   │   └── ScheduledFutureTaskDemo.kt
│                       │   ├── session_cache/
│                       │   │   └── SessionCacheDemo.kt
│                       │   ├── timer/
│                       │   │   └── TimerTaskDemo.kt
│                       │   └── ttl3/
│                       │       ├── CustomizedBlockingQueueWithTtlDemo.java
│                       │       ├── SimpleDemo.kt
│                       │       ├── TtlExecutorServiceWithPriorityBlockingQueueDemo.kt
│                       │       ├── TtlExecutorWrapperDemo.kt
│                       │       ├── TtlForkJoinTaskDemo.kt
│                       │       └── TtlWrapperDemo.kt
│                       ├── perf/
│                       │   ├── Utils.kt
│                       │   ├── memoryleak/
│                       │   │   ├── NoMemoryLeak_ThreadLocal_NoRemove.kt
│                       │   │   └── NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt
│                       │   ├── package-info.java
│                       │   └── tps/
│                       │       ├── CreateThreadLocalInstanceTps.kt
│                       │       ├── CreateTransmittableThreadLocalInstanceTps.kt
│                       │       └── TpsCounter.kt
│                       ├── third_part_lib_test/
│                       │   ├── ExecutorsTest.kt
│                       │   └── ForkJoinPoolTest.kt
│                       ├── ttl3/
│                       │   ├── TtlCallableTest.kt
│                       │   ├── TtlFlowTester.kt
│                       │   ├── TtlRunnableTest.kt
│                       │   └── TtlTimerTaskTest.kt
│                       └── user_api_test/
│                           └── ttl3/
│                               ├── DisableIgnoreNullValueSemanticsTest.kt
│                               ├── TransmittableThreadLocal_Transmitter_UserTest.kt
│                               ├── TransmittableThreadLocal_Transmitter_registerTransmittee_UserTest.kt
│                               ├── TransmittableThreadLocal_withInit_Null_Test.java
│                               └── TransmittableThreadLocal_withInit_Test.kt
├── ttl-integrations/
│   ├── sample-ttl-agent-extension-transformlet/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   ├── scripts/
│   │   │   ├── integration-test.sh
│   │   │   └── run.sh
│   │   └── src/
│   │       ├── main/
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── alibaba/
│   │       │   │           └── ttl/
│   │       │   │               └── agent/
│   │       │   │                   └── extension_transformlet/
│   │       │   │                       └── sample/
│   │       │   │                           ├── biz/
│   │       │   │                           │   ├── SampleMain.java
│   │       │   │                           │   └── ToBeTransformedClass.java
│   │       │   │                           └── transformlet/
│   │       │   │                               └── SampleExtensionTransformlet.java
│   │       │   └── resources/
│   │       │       └── META-INF/
│   │       │           └── ttl.agent.transformlets
│   │       └── test/
│   │           └── java/
│   │               └── com/
│   │                   └── alibaba/
│   │                       └── ttl/
│   │                           └── agent/
│   │                               └── extension_transformlet/
│   │                                   └── sample/
│   │                                       └── biz/
│   │                                           └── ToBeTransformedClassTest.java
│   ├── vertx3-ttl-integration/
│   │   ├── README-EN.md
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── alibaba/
│   │       │   │           └── ttl/
│   │       │   │               └── integration/
│   │       │   │                   └── vertx3/
│   │       │   │                       ├── TtlVertxHandler.java
│   │       │   │                       └── agent/
│   │       │   │                           └── transformlet/
│   │       │   │                               ├── NettySingleThreadEventExecutorTtlTransformlet.java
│   │       │   │                               └── VertxFutureTtlTransformlet.java
│   │       │   └── resources/
│   │       │       └── META-INF/
│   │       │           └── ttl.agent.transformlets
│   │       └── test/
│   │           └── java/
│   │               └── com/
│   │                   └── alibaba/
│   │                       └── ttl/
│   │                           └── integration/
│   │                               └── vertx3/
│   │                                   └── VertxTransformletTest.java
│   └── vertx4-ttl-integration/
│       ├── README-EN.md
│       ├── README.md
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   ├── java/
│           │   │   └── com/
│           │   │       └── alibaba/
│           │   │           └── ttl/
│           │   │               └── integration/
│           │   │                   └── vertx4/
│           │   │                       ├── TtlVertxHandler.java
│           │   │                       └── agent/
│           │   │                           └── transformlet/
│           │   │                               ├── NettySingleThreadEventExecutorTtlTransformlet.java
│           │   │                               └── VertxFutureTtlTransformlet.java
│           │   └── resources/
│           │       └── META-INF/
│           │           └── ttl.agent.transformlets
│           └── test/
│               └── java/
│                   └── com/
│                       └── alibaba/
│                           └── ttl/
│                               └── integration/
│                                   └── vertx4/
│                                       └── VertxTransformletTest.java
├── ttl-kotlin/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── kotlin/
│       │       └── com/
│       │           └── alibaba/
│       │               └── ttl3/
│       │                   └── kotlin/
│       │                       ├── Transmitter.kt
│       │                       └── TtlExtensions.kt
│       └── test/
│           └── kotlin/
│               └── com/
│                   └── alibaba/
│                       ├── Utils.kt
│                       └── ttl3/
│                           └── kotlin/
│                               └── TtlExtensionsTests.kt
└── ttl2-compatible/
    ├── pom.xml
    └── src/
        ├── main/
        │   ├── java/
        │   │   └── com/
        │   │       └── alibaba/
        │   │           └── ttl/
        │   │               ├── TransmittableThreadLocal.java
        │   │               ├── TtlCallable.java
        │   │               ├── TtlCopier.java
        │   │               ├── TtlEnhanced.java
        │   │               ├── TtlRecursiveAction.java
        │   │               ├── TtlRecursiveTask.java
        │   │               ├── TtlRunnable.java
        │   │               ├── TtlTimerTask.java
        │   │               ├── TtlUnwrap.java
        │   │               ├── TtlWrappers.java
        │   │               ├── package-info.java
        │   │               ├── spi/
        │   │               │   ├── TtlAttachments.java
        │   │               │   ├── TtlAttachmentsDelegate.java
        │   │               │   ├── TtlEnhanced.java
        │   │               │   ├── TtlWrapper.java
        │   │               │   └── package-info.java
        │   │               └── threadpool/
        │   │                   ├── ComparableComparator.java
        │   │                   ├── DisableInheritableForkJoinWorkerThreadFactory.java
        │   │                   ├── DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
        │   │                   ├── DisableInheritableThreadFactory.java
        │   │                   ├── DisableInheritableThreadFactoryWrapper.java
        │   │                   ├── ExecutorServiceTtlWrapper.java
        │   │                   ├── ExecutorTtlWrapper.java
        │   │                   ├── ScheduledExecutorServiceTtlWrapper.java
        │   │                   ├── TtlExecutors.java
        │   │                   ├── TtlForkJoinPoolHelper.java
        │   │                   ├── TtlUnwrapComparator.java
        │   │                   ├── agent/
        │   │                   │   ├── TtlAgent.java
        │   │                   │   ├── TtlAgentHelper.java
        │   │                   │   ├── TtlExtensionTransformletManager.java
        │   │                   │   ├── TtlTransformer.java
        │   │                   │   ├── logging/
        │   │                   │   │   ├── Logger.java
        │   │                   │   │   └── package-info.java
        │   │                   │   ├── package-info.java
        │   │                   │   └── transformlet/
        │   │                   │       ├── ClassInfo.java
        │   │                   │       ├── TtlTransformlet.java
        │   │                   │       ├── helper/
        │   │                   │       │   ├── AbstractExecutorTtlTransformlet.java
        │   │                   │       │   ├── TtlTransformletHelper.java
        │   │                   │       │   └── package-info.java
        │   │                   │       ├── internal/
        │   │                   │       │   ├── ForkJoinTtlTransformlet.java
        │   │                   │       │   ├── JdkExecutorTtlTransformlet.java
        │   │                   │       │   ├── PriorityBlockingQueueTtlTransformlet.java
        │   │                   │       │   ├── TimerTaskTtlTransformlet.java
        │   │                   │       │   └── package-info.java
        │   │                   │       └── package-info.java
        │   │                   └── package-info.java
        │   └── javadoc/
        │       └── overview.html
        └── test/
            ├── java/
            │   └── com/
            │       └── alibaba/
            │           ├── Utils.kt
            │           ├── demo/
            │           │   ├── coroutine/
            │           │   │   ├── CoroutineDemo.kt
            │           │   │   ├── CoroutineThreadContextElementDemo.kt
            │           │   │   ├── CoroutineThreadContextElementTest.kt
            │           │   │   ├── CoroutineThreadLocalContextContinuationInterceptorDemo.kt
            │           │   │   └── ttl_intergration/
            │           │   │       ├── TtlCoroutineContext.kt
            │           │   │       └── usage/
            │           │   │           ├── TtlCoroutineContextDemo.kt
            │           │   │           └── TtlCoroutineContextTest.kt
            │           │   ├── cow/
            │           │   │   └── CowDemo.kt
            │           │   ├── distributed_tracer/
            │           │   │   ├── refcount/
            │           │   │   │   └── DistributedTracerUseDemo.kt
            │           │   │   └── weakref/
            │           │   │       └── DistributedTracerUseDemo_WeakReferenceInsteadOfRefCounter.kt
            │           │   ├── forkjoinpool/
            │           │   │   ├── ForkJoinPoolDemo.kt
            │           │   │   └── ParallelStreamDemo.kt
            │           │   ├── scheduled_thread_pool_executor/
            │           │   │   └── ScheduledFutureTaskDemo.kt
            │           │   ├── session_cache/
            │           │   │   └── SessionCacheDemo.kt
            │           │   ├── timer/
            │           │   │   └── TimerTaskDemo.kt
            │           │   └── ttl/
            │           │       ├── CustomizedBlockingQueueWithTtlDemo.java
            │           │       ├── SimpleDemo.kt
            │           │       ├── TtlExecutorServiceWithPriorityBlockingQueueDemo.kt
            │           │       ├── TtlExecutorWrapperDemo.kt
            │           │       ├── TtlForkJoinTaskDemo.kt
            │           │       ├── TtlWrapperDemo.kt
            │           │       ├── TtlWrapperTypeInferenceProblemShowcase.java
            │           │       └── agent/
            │           │           ├── AgentDemo.kt
            │           │           └── YourXxxAgent.java
            │           ├── it/
            │           │   ├── README.md
            │           │   └── TimerAgentCheck.kt
            │           ├── perf/
            │           │   ├── Utils.kt
            │           │   ├── memoryleak/
            │           │   │   ├── NoMemoryLeak_ThreadLocal_NoRemove.kt
            │           │   │   └── NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt
            │           │   └── tps/
            │           │       ├── CreateThreadLocalInstanceTps.kt
            │           │       ├── CreateTransmittableThreadLocalInstanceTps.kt
            │           │       └── TpsCounter.kt
            │           ├── third_part_lib_test/
            │           │   ├── ExecutorsTest.kt
            │           │   ├── ForkJoinPoolTest.kt
            │           │   └── JavassistTest.kt
            │           ├── ttl/
            │           │   ├── InheritableTest.kt
            │           │   ├── README.md
            │           │   ├── TtlCallableTest.kt
            │           │   ├── TtlRunnableTest.kt
            │           │   ├── TtlTimerTaskTest.kt
            │           │   ├── TtlWrappersTest.kt
            │           │   ├── forkjoin/
            │           │   │   ├── ForkJoinPool4RunnableCallableTest.kt
            │           │   │   ├── ForkJoinPool4StreamTest.kt
            │           │   │   ├── recursive_action/
            │           │   │   │   └── TtlRecursiveActionTest.kt
            │           │   │   └── recursive_task/
            │           │   │       └── TtlRecursiveTaskTest.kt
            │           │   ├── reported_bugs/
            │           │   │   └── Bug70_Test.kt
            │           │   ├── testmodel/
            │           │   │   ├── Call.kt
            │           │   │   ├── DeepCopyFooTransmittableThreadLocal.kt
            │           │   │   ├── FooPojo.kt
            │           │   │   ├── FooTask.kt
            │           │   │   └── Task.kt
            │           │   ├── threadlocal_integration/
            │           │   │   └── ThreadLocalIntegrationTest.kt
            │           │   └── threadpool/
            │           │       ├── BeforeAndAfterExecuteMethodOfExecutorSubclassTest.kt
            │           │       ├── ExecutorClassesTest.kt
            │           │       ├── ScheduledExecutorServiceTtlWrapperTest.kt
            │           │       ├── TtlExecutorsTest.kt
            │           │       ├── TtlForkJoinPoolHelperTest.kt
            │           │       └── agent/
            │           │           ├── TtlAgentHelperTest.kt
            │           │           ├── TtlExtensionTransformletManagerTest.kt
            │           │           └── transformlet/
            │           │               ├── helper/
            │           │               │   └── TtlTransformletHelperTest.kt
            │           │               └── internal/
            │           │                   └── UtilsTest.java
            │           └── user_api_test/
            │               ├── README.md
            │               └── ttl/
            │                   ├── DisableIgnoreNullValueSemanticsTest.kt
            │                   ├── TransmittableThreadLocal_Transmitter_UserTest.kt
            │                   ├── TransmittableThreadLocal_Transmitter_registerTransmittee_UserTest.kt
            │                   ├── TransmittableThreadLocal_withInit_Null_Test.java
            │                   └── TransmittableThreadLocal_withInit_Test.kt
            └── resources/
                ├── io/
                │   └── mockk/
                │       └── settings.properties
                ├── log4j.xml
                └── test_extension/
                    └── foo.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

tab_width = 2
indent_size = 2
ij_continuation_indent_size = 4
indent_style = space
trim_trailing_whitespace = true

ij_any_blank_lines_after_imports = 2
ij_markdown_wrap_text_if_long = false


[*.{java,kt}]
indent_size = 4
ij_continuation_indent_size = 8


[*.{md,mkd,markdown}]
indent_size = 4
ij_continuation_indent_size = 8
trim_trailing_whitespace = false


[*.xml]
indent_style = tab



================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: maven
    directory: "/"
    schedule:
      interval: daily
    open-pull-requests-limit: 20
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"


================================================
FILE: .github/workflows/ci.yaml
================================================
# Quickstart for GitHub Actions
# https://docs.github.com/en/actions/quickstart
name: fast CI
on: [ push, pull_request, workflow_dispatch ]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 10
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest ]
        java: [ 8, 11, 17, 21, 22 ]
      fail-fast: false
      max-parallel: 64
    name: Fast CI on Java ${{ matrix.java }} OS ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          java-version: ${{ matrix.java }}
          distribution: zulu
          cache: maven
      - name: Build with Maven
        run: ./mvnw -V --no-transfer-progress clean package
      - name: Run unit test under ttl agent, include check for ExecutorService, ForkJoinPool, Timer/TimerTask
        working-directory: ttl2-compatible
        run: >
          ../mvnw -V --no-transfer-progress
          -Penable-ttl-agent-for-test
          surefire:test
          '-Dttl.agent.extra.d.options=-Drun-ttl-test-under-agent-with-enable-timer-task=true'
      - name: Run unit test under ttl agent, and turn on the disable inheritable for thread pool enhancement
        working-directory: ttl2-compatible
        run: >
          ../mvnw -V --no-transfer-progress
          -Penable-ttl-agent-for-test
          surefire:test
          '-Dttl.agent.extra.args=ttl.agent.disable.inheritable.for.thread.pool:true'
          '-Dttl.agent.extra.d.options=-Drun-ttl-test-under-agent-with-disable-inheritable=true'
      - name: Run agent check for Timer/TimerTask, explicit "ttl.agent.enable.timer.task"
        working-directory: ttl2-compatible
        run: >
          ../mvnw -V --no-transfer-progress
          -Penable-ttl-agent-for-test
          surefire:test
          '-Dttl.agent.extra.args=ttl.agent.enable.timer.task:true'
          '-Dttl.agent.extra.d.options=-Drun-ttl-test-under-agent-with-enable-timer-task=true'


================================================
FILE: .github/workflows/strong_ci.yaml
================================================
# Quickstart for GitHub Actions
# https://docs.github.com/en/actions/quickstart

name: Strong CI
on: [ push, pull_request, workflow_dispatch ]
jobs:
  test:
    # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
    runs-on: ubuntu-latest
    timeout-minutes: 30
    name: Strong CI by multiply java versions

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          # https://github.com/actions/setup-java?tab=readme-ov-file#install-multiple-jdks
          java-version: |
            8
            11
            17
            21
            22
          distribution: zulu
          cache: maven

      - name: Run integration test
        run: scripts/integration-test.sh

      - name: Remove self maven install files
        run: rm -rf $HOME/.m2/repository/com/alibaba/{transmittable-thread-local,ttl}*

      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v4
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

      # https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
      - name: Check git dirty
        run: |
          git status --short
          [ -z "$(git status --short)" ]


================================================
FILE: .gitmodules
================================================
[submodule "scripts/bash-buddy"]
	path = scripts/bash-buddy
	url = https://github.com/foldright/bash-buddy.git


================================================
FILE: .mvn/wrapper/maven-wrapper.properties
================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip


================================================
FILE: CONTRIBUTING.md
================================================
# Welcome! Thank you for contributing to TransmittableThreadLocal(TTL)!

> ⚠️ This contribution guide is still in progress.

We follow the standard GitHub [fork & pull](https://help.github.com/articles/using-pull-requests/#fork--pull) approach to pull requests. Just fork the official repo, develop in a branch, and submit a PR!

You're always welcome to submit your PR straight away and start the discussion (without reading the rest of this wonderful doc, or the README.md). The goal of these notes is to make your experience contributing to TransmittableThreadLocal(TTL) as smooth and pleasant as possible. We're happy to guide you through the process once you've submitted your PR.

# The TransmittableThreadLocal(TTL) Community

Mainly use the github issue: https://github.com/alibaba/transmittable-thread-local/issues

In case of questions about the contribution process or for discussion of specific issues please visit the [alibaba/transmittable-thread-local gitter chat](https://gitter.im/alibaba/transmittable-thread-local?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).

# Navigating around the project & codebase

## Branches summary

Depending on what you want to work on, you should target a specific branch as explained below:

* `master` – active development branch
* `incubation/xxx` branches contain big feature.
* `dev/xxx` branches contain small feature or bug fix.

## Tags

TTL uses tags to categorise issues into groups. 

Most notably many tags start with a `t:` prefix (as in `topic:`), which categorises issues in terms of which extension module they relate to. Examples are:

- [t:vertx](https://github.com/alibaba/transmittable-thread-local/labels/t%3Avertx)
- [t:netty](https://github.com/alibaba/transmittable-thread-local/labels/t%3Anetty)

Without `t:xxx` tags is related to `TTL` lib.

see [all tags here](https://github.com/alibaba/transmittable-thread-local/labels)

In general *all issues are open for anyone working on them*, however if you're new to the project and looking for an issue
that will be accepted and likely is a nice one to get started you should check out the following tags:

- [good first issue](https://github.com/alibaba/transmittable-thread-local/labels/%F0%9F%94%B0%20good%20first%20issue) - which identifies simple entry level tickets, such as improvements of documentation or tests. If you're not sure how to solve a ticket but would like to work on it feel free to ask in the issue about clarification or tips.
- [help wanted](https://github.com/alibaba/transmittable-thread-local/labels/help%20wanted) - which identifies issues that the core team will likely not have time to work on, or the issue is a nice entry level ticket. If you're not sure how to solve a ticket but would like to work on it feel free to ask in the issue about clarification or tips.
- [nice-to-have (low-priority)](https://github.com/alibaba/transmittable-thread-local/labels/nice-to-have%20%28low-prio%29) - are tasks which make sense, however are not very high priority (in face of other very high priority issues). If you see something interesting in this list, a contribution would be really wonderful!

Another group of tickets are those which start from a number. They're used to signal in what phase of development an issue is:

- [0 - new](https://github.com/alibaba/transmittable-thread-local/labels/0%20-%20new) - is assigned when a ticket is unclear on its purpose or if it is valid or not. Sometimes the additional tag `discuss` is used to mark such tickets, if they propose large scale changes and need more discussion before moving into triaged (or being closed as invalid).
- [1 - triaged](https://github.com/alibaba/transmittable-thread-local/labels/1%20-%20triaged) - roughly speaking means "this ticket makes sense". Triaged tickets are safe to pick up for contributing in terms of likeliness of a patch for it being accepted. It is not recommended to start working on a ticket that is not triaged.
- [2 - pick next](https://github.com/alibaba/transmittable-thread-local/labels/2%20-%20pick%20next) - used to mark issues which are next up in the queue to be worked on. Sometimes it's also used to mark which PRs are expected to be reviewed/merged for the next release. The tag is non-binding, and mostly used as an organisational helper.
- [3 - in progress](https://github.com/alibaba/transmittable-thread-local/labels/3%20-%20in%20progress) - means someone is working on this ticket. If you see a ticket that has the tag, however seems inactive, it could have been an omission with removing the tag, feel free to ping the ticket then if it's still being worked on.

Another group of tags indicate type of a ticket is:

- [bug](https://github.com/alibaba/transmittable-thread-local/labels/%F0%9F%90%9E%20bug) tickets indicate potential production issues. Bugs take priority in being fixed above features. The core team dedicates a number of days to working on bugs each sprint. Bugs which have **reproducers** are also great for community contributions as they're well-isolated. Sometimes we're not as lucky to have reproducers though, then a bugfix should also include a test reproducing the original error along with the fix.
- [feature](https://github.com/alibaba/transmittable-thread-local/labels/%E2%9C%A8%20feature).
- [enhancement](https://github.com/alibaba/transmittable-thread-local/labels/%F0%9F%92%AA%20enhancement).

# TransmittableThreadLocal(TTL) contributing guidelines

These guidelines are meant to be a living document that should be changed and adapted as needed.
We encourage changes that make it easier to achieve our goals in an efficient way.

## General workflow

The steps below describe how to get a patch into a main development branch (e.g. `master`). 
The steps are exactly the same for everyone involved in the project (be it core team, or first time contributor).

1. To avoid duplicated effort, it might be good to check the [issue tracker](https://github.com/alibaba/transmittable-thread-local/issues) and [existing pull requests](https://github.com/alibaba/transmittable-thread-local/pulls) for existing work.
   - If there is no ticket yet, feel free to [create one](https://github.com/alibaba/transmittable-thread-local/issues/new) to discuss the problem and the approach you want to take to solve it.
1. [Fork the project](https://github.com/alibaba/transmittable-thread-local/fork) on GitHub. You'll need to create a feature-branch for your work on your fork, as this way you'll be able to submit a pull request against the mainline.
1. Create a branch on your fork and work on the feature. For example: `git checkout -b support-fast-thread-local`
   - Please make sure to follow the general quality guidelines (specified below) when developing your patch.
   - Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request. The `validatePullRequest` task ([explained below](#the-validatepullrequest-task)) may come in handy to verify your changes are correct.
   - Use the `verifyCodeStyle` maven task to make sure your code is properly formatted and includes the proper copyright headers.
1. Once your feature is complete, prepare the commit following our [Creating Commits And Writing Commit Messages](#creating-commits-and-writing-commit-messages). For example, a good commit message would be: `Adding compression support for Manifests #42` (note the reference to the ticket it aimed to resolve).
1. If it's a new feature, or a change of behavior, document it on the [User Guide](https://github.com/alibaba/transmittable-thread-local/blob/master/README.md). If the feature was touching Scala or Java DSL, make sure to document both the Scala and Java APIs.
1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)!
    - Please make sure to include a reference to the issue you're solving *in the comment* for the Pull Request, as this will cause the PR to be linked properly with the Issue. Examples of good phrases for this are: "Resolves #1234" or "Refs #1234".
1. If you have not already done so, you will be asked by our CLA bot to [sign the Alibaba CLA](https://cla-assistant.io/alibaba/transmittable-thread-local) online. CLA stands for Contributor License Agreement and is a way of protecting intellectual property disputes from harming the project.
1. Now both committers and interested people will review your code. This process is to ensure the code we merge is of the best possible quality, and that no silly mistakes slip through. You're expected to follow-up these comments by adding new commits to the same branch. The commit messages of those commits can be more loose, for example: `Removed debugging using printline`, as they all will be squashed into one commit before merging into the main branch.
    - The community and team are really nice people, so don't be afraid to ask follow up questions if you didn't understand some comment, or would like clarification on how to continue with a given feature. We're here to help, so feel free to ask and discuss any kind of questions you might have during review!
1. After the review you should fix the issues as needed (pushing a new commit for new review etc.), iterating until the reviewers give their thumbs up–which is signalled usually by a comment saying `LGTM`, which means "Looks Good To Me".
1. Once everything is said and done, your pull request gets merged :tada: Your feature will be available with the next “earliest” release milestone. And of course you will be given credit for the fix in the release stats during the release's announcement. You've made it!

The TL;DR; of the above very precise workflow version is:

1. Fork TTL
2. Hack and test on your feature (on a branch)
3. Document it
4. Submit a PR
5. Sign the CLA if necessary
6. Keep polishing it until received enough LGTM
7. Profit!

## Getting started with maven

TTL is using the [maven](https://maven.apache.org/) build system.

To compile all the core modules use the `compile` command:

```bash
./mvnw compile
```

You can run tests with the `test` command:

```bash
./mvnw test
```

If you want to deploy the artifacts to your local maven repository (for example,
to use from an maven project) use the `install` command:

```bash
./mvnw install
```

## The Pull Request validation task

**TODO**

## Binary compatibility

**TODO**

## Pull request requirements

For a pull request to be considered at all it has to meet these requirements:

1. Regardless if the code introduces new features or fixes bugs or regressions, it must have comprehensive tests.
1. The code must be well documented in the TTL project's standard documentation format (see the ‘Documentation’ section below).
1. The commit messages must properly describe the changes, see further below.
1. A pull request must indicate (link to) the issue it is aimed to resolve in the description (or comments) of the PR, in order to establish a link between PR and Issue. This can be achieved by writing "Fixes #1234" or similar in PR description.
1. All projects must include TTL copyright notices.  Each project can choose between one of two approaches:

    1. All source files in the project must have a TTL copyright notice in the file header.
    1. The Notices file for the project includes the TTL copyright notice and no other files contain copyright notices.  See http://www.apache.org/legal/src-headers.html for instructions for managing this approach for copyrights.

    TTL projects uses the first choice, having copyright notices in every file header. When absent, these are added automatically during `mvn compile`.

### Additional guidelines

Some additional guidelines regarding source code are:

- Keep the code [DRY](http://programmer.97things.oreilly.com/wiki/index.php/Don%27t_Repeat_Yourself).
- Apply the [Boy Scout Rule](http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule) whenever you have the chance to.
- Never delete or change existing copyright notices, just add additional info.
- Do not use ``@author`` tags since it does not encourage [Collective Code Ownership](http://www.extremeprogramming.org/rules/collective.html). TODO
  - Contributors , each project should make sure that the contributors gets the credit they deserve—in a text file or page on the project website and in the release notes etc.

## Documentation

All documentation is preferred to be in Java API doc standard documentation format, which among other things allows all code in the documentation to be externalized into compiled files and imported into the documentation.

To build the documentation locally:

```
mvn -Pgen-api-doc javadoc:javadoc
```

## Creating commits and writing commit messages

Follow these guidelines when creating public commits and writing commit messages.

1. If your work spans multiple local commits (for example; if you do safe point commits while working in a feature branch or work in a branch for a long time doing merges/rebases etc.) then please do not commit it all but rewrite the history by squashing the commits into a single big commit which you write a good commit message for (like discussed in the following sections). For more info read this article: [Git Workflow](http://sandofsky.com/blog/git-workflow.html). Every commit should be able to be used in isolation, cherry picked etc.

2. The first line should be a descriptive sentence what the commit is doing, including the ticket number. It should be possible to fully understand what the commit does—but not necessarily how it does it—by just reading this single line. We follow the “imperative present tense” style for commit messages ([more info here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).

   It is **not ok** to only list the ticket number, type "minor fix" or similar.
   If the commit is a small fix, then you are done. If not, go to 3.

3. Following the single line description should be a blank line followed by an enumerated list with the details of the commit.

4. You can request review by a specific team member for your commit (depending on the degree of automation we reach, the list may change over time):
    * ``Review by @gituser`` - if you want to notify someone on the team. The others can, and are encouraged to participate.

Example:

    enable Travis CI #1

    * Details 1
    * Details 2
    * Details 3

## Pull request validation workflow details

**TODO**

## Source style

Sometimes it is convenient to place 'internal' classes in their own package.
In such situations we prefer 'internal' over 'impl' as a package name.

### Java style

TTL projects uses xxx maven plugin to format Java sources.

**TODO**

PR validation includes checking that the Java sources are formatted and will fail if they are not.

# Supporting infrastructure

## Reporting security issues

If you have found an issue in an TransmittableThreadLocal(TTL) project that might have security
implications, you can report it to <https://security.alibaba.com>. We will make
sure those will get handled with priority. Thank you for your responsible
disclosure!

## Continuous integration

TransmittableThreadLocal(TTL) uses GitHub actions for Continuous Integration: https://github.com/alibaba/transmittable-thread-local/actions

## Related links

- [alibaba/transmittable-thread-local Contributor License Agreement](https://cla-assistant.io/alibaba/transmittable-thread-local)
- [the akka contribution guide](https://github.com/akka/akka/blob/master/CONTRIBUTING.md) (this contribution guide is adapted from it)


================================================
FILE: LICENSE
================================================


                                 Apache License
                           Version 2.0, January 2004
                        https://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       https://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README-EN.md
================================================
# <div align="center"><a href="#dummy"><img src="https://user-images.githubusercontent.com/1063891/233595946-4493119e-4e0c-4081-a382-0a20731c578e.png" alt="📌 TransmittableThreadLocal(TTL)"></a></div>

> [!IMPORTANT]
> 🚧 This branch is `TransmittableThreadLocal(TTL) v3`, which is in development and has not been released yet.  
> See [issue 432](https://github.com/alibaba/transmittable-thread-local/issues/432) for the `v3` notes, work item list and its progress.
>
> 👉 The stable version `v2.x` currently in use is on [**branch `2.x`**](https://github.com/alibaba/transmittable-thread-local/tree/2.x).

<p align="center">
<a href="https://github.com/alibaba/transmittable-thread-local/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/alibaba/transmittable-thread-local/ci.yaml?branch=master&logo=github&logoColor=white&label=fast ci" alt="Fast CI"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/actions/workflows/strong_ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/alibaba/transmittable-thread-local/strong_ci.yaml?branch=master&logo=github&logoColor=white&label=strong ci" alt="Strong CI"></a>
<a href="https://app.codecov.io/gh/alibaba/transmittable-thread-local/tree/master"><img src="https://badgen.net/codecov/c/github/alibaba/transmittable-thread-local/master?icon=codecov" alt="Coverage Status"></a>
<a href="https://openjdk.java.net/"><img src="https://img.shields.io/badge/Java-6+-339933?logo=openjdk&logoColor=white" alt="JDK support"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/alibaba/transmittable-thread-local?color=4D7A97&logo=apache" alt="License"></a>
<a href="https://alibaba.github.io/transmittable-thread-local/apidocs/"><img src="https://img.shields.io/github/release/alibaba/transmittable-thread-local?label=javadoc&color=339933&logo=microsoft-academic&logoColor=white" alt="Javadocs"></a>
<a href="https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml"><img src="https://img.shields.io/maven-central/v/com.alibaba/transmittable-thread-local?logo=apache-maven&logoColor=white" alt="Maven Central"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/releases"><img src="https://img.shields.io/github/release/alibaba/transmittable-thread-local" alt="GitHub release"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/stargazers"><img src="https://img.shields.io/github/stars/alibaba/transmittable-thread-local?style=flat" alt="GitHub Stars"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/fork"><img src="https://img.shields.io/github/forks/alibaba/transmittable-thread-local?style=flat" alt="GitHub Forks"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/network/dependents"><img src="https://badgen.net/github/dependents-repo/alibaba/transmittable-thread-local?label=user%20repos" alt="user repos"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/issues"><img src="https://img.shields.io/github/issues/alibaba/transmittable-thread-local" alt="GitHub issues"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/graphs/contributors"><img src="https://img.shields.io/github/contributors/alibaba/transmittable-thread-local" alt="GitHub Contributors"></a>
<a href="https://github.com/alibaba/transmittable-thread-local"><img src="https://img.shields.io/github/repo-size/alibaba/transmittable-thread-local" alt="GitHub repo size"></a>
<a href="https://gitpod.io/#https://github.com/alibaba/transmittable-thread-local"><img src="https://img.shields.io/badge/Gitpod-ready to code-339933?label=gitpod&logo=gitpod&logoColor=white" alt="gitpod: Ready to Code"></a>
</p>

📖 English Documentation | [📖 中文文档](README.md)

----------------------------------------

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [🔧 Functions](#-functions)
- [🎨 Requirements](#-requirements)
- [👥 User Guide](#-user-guide)
    - [1. Simple usage](#1-simple-usage)
    - [2. Transmit value even using thread pool](#2-transmit-value-even-using-thread-pool)
        - [2.1 Decorate `Runnable` and `Callable`](#21-decorate-runnable-and-callable)
        - [2.2 Decorate thread pool](#22-decorate-thread-pool)
        - [2.3 Use Java Agent to decorate thread pool implementation class](#23-use-java-agent-to-decorate-thread-pool-implementation-class)
- [🔌 Java API Docs](#-java-api-docs)
- [🍪 Maven Dependency](#-maven-dependency)
- [🔨 How to compile and build](#-how-to-compile-and-build)
- [🗿 More Documentation](#-more-documentation)
- [📚 Related Resources](#-related-resources)
    - [JDK Core Classes](#jdk-core-classes)
- [💗 Who Used](#-who-used)
- [👷 Contributors](#-contributors)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

----------------------------------------

# 🔧 Functions

👉 `TransmittableThreadLocal`(`TTL`): The missing Java™ std lib(simple & 0-dependency) for framework/middleware,
provide an enhanced `InheritableThreadLocal` that transmits values between threads even using thread pooling components. Support `Java 6~21`.

Class [`InheritableThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html) in `JDK`
can transmit value to child thread from parent thread.

But when use thread pool, thread is cached up and used repeatedly. Transmitting value from parent thread to child thread has no meaning.
Application need transmit value from the time task is created to the time task is executed.

If you have problem or question, please [submit Issue](https://github.com/alibaba/transmittable-thread-local/issues) or play [fork](https://github.com/alibaba/transmittable-thread-local/fork) and pull request dance.

> [!NOTE]
> From `TTL v2.13+` upgrade to `Java 8`. 🚀  
> If you need `Java 6` support, use version `2.12.x` <a href="https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml"><img src="https://img.shields.io/maven-central/v/com.alibaba/transmittable-thread-local?versionPrefix=2.12.&color=lightgrey&logo=apache-maven&logoColor=white" alt="Maven Central"></a>

# 🎨 Requirements

The Requirements listed below is also why I sort out `TransmittableThreadLocal` in my work.

- Application container or high layer framework transmit information to low layer sdk.
- Transmit context to logging without application code aware.

# 👥 User Guide

## 1. Simple usage

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// set in parent thread
context.set("value-set-in-parent");

// =====================================================

// read in child thread, value is "value-set-in-parent"
String value = context.get();
```

\# See the executable demo [`SimpleDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/SimpleDemo.kt) with full source code.

This is the function of class `InheritableThreadLocal`, should use class `InheritableThreadLocal` instead.

But when use thread pool, thread is cached up and used repeatedly. Transmitting value from parent thread to child thread has no meaning.
Application need transmit value from the time task is created to the point task is executed.

The solution is below usage.

## 2. Transmit value even using thread pool

### 2.1 Decorate `Runnable` and `Callable`

Decorate input `Runnable` and `Callable` by [`TtlRunnable`](ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java)
and [`TtlCallable`](ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java).

Sample code:

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// set in parent thread
context.set("value-set-in-parent");

Runnable task = new RunnableTask();
// extra work, create decorated ttlRunnable object
Runnable ttlRunnable = TtlRunnable.get(task);
executorService.submit(ttlRunnable);

// =====================================================

// read in task, value is "value-set-in-parent"
String value = context.get();
```

**_NOTE_**:  
Even when the same `Runnable` task is submitted to the thread pool multiple times, the decoration operations(ie: `TtlRunnable.get(task)`) is required for each submission to capture the value of the `TransmittableThreadLocal` context at submission time; That is, if the same task is submitted next time without reperforming decoration and still using the last `TtlRunnable`, the submitted task will run in the context of the last captured context. The sample code is as follows:


```java
// first submission
Runnable task = new RunnableTask();
executorService.submit(TtlRunnable.get(task));

// ... some biz logic,
// and modified TransmittableThreadLocal context ...
context.set("value-modified-in-parent");

// next submission
// reperform decoration to transmit the modified TransmittableThreadLocal context
executorService.submit(TtlRunnable.get(task));
```

Above code show how to dealing with `Runnable`, `Callable` is similar:

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// set in parent thread
context.set("value-set-in-parent");

Callable call = new CallableTask();
// extra work, create decorated ttlCallable object
Callable ttlCallable = TtlCallable.get(call);
executorService.submit(ttlCallable);

// =====================================================

// read in call, value is "value-set-in-parent"
String value = context.get();
```

\# See the executable demo [`TtlWrapperDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlWrapperDemo.kt) with full source code.

### 2.2 Decorate thread pool

Eliminating the work of `Runnable` and `Callable` Decoration every time it is submitted to thread pool. This work can be completed in the thread pool.

Use util class
[`TtlExecutors`](ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlExecutors.java)
to decorate thread pool.

Util class `TtlExecutors` has below methods:

- `getTtlExecutor`: decorate interface `Executor`
- `getTtlExecutorService`: decorate interface `ExecutorService`
- `getTtlScheduledExecutorService`: decorate interface `ScheduledExecutorService`

Sample code:

```java
ExecutorService executorService = ...
// extra work, create decorated executorService object
executorService = TtlExecutors.getTtlExecutorService(executorService);

TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// set in parent thread
context.set("value-set-in-parent");

Runnable task = new RunnableTask();
Callable call = new CallableTask();
executorService.submit(task);
executorService.submit(call);

// =====================================================

// read in Task or Callable, value is "value-set-in-parent"
String value = context.get();
```

\# See the executable demo [`TtlExecutorWrapperDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlExecutorWrapperDemo.kt) with full source code.

### 2.3 Use Java Agent to decorate thread pool implementation class

In this usage, transmittance is transparent\(no decoration operation\).

Sample code:

```java
// ## 1. upper layer logic of framework ##
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();
context.set("value-set-in-parent");

// ## 2. biz logic ##
ExecutorService executorService = Executors.newFixedThreadPool(3);

Runnable task = new RunnableTask();
Callable call = new CallableTask();
executorService.submit(task);
executorService.submit(call);

// ## 3. underlayer logic of framework ##
// read in Task or Callable, value is "value-set-in-parent"
String value = context.get();
```

\# See the executable demo [`AgentDemo.kt`](ttl2-compatible/src/test/java/com/alibaba/demo/ttl/agent/AgentDemo.kt) with full source code, run demo by the script [`scripts/run-agent-demo.sh`](scripts/run-agent-demo.sh).

At present, `TTL` agent has decorated below `JDK` execution components(aka. thread pool) implementation:

- `java.util.concurrent.ThreadPoolExecutor` and `java.util.concurrent.ScheduledThreadPoolExecutor`
    - decoration implementation code is in [`JdkExecutorTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/JdkExecutorTtlTransformlet.java).
- `java.util.concurrent.ForkJoinTask`(corresponding execution component is `java.util.concurrent.ForkJoinPool`)
    - decoration implementation code is in [`ForkJoinTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/ForkJoinTtlTransformlet.java), supports since version **_`2.5.1`_**.
    - **_NOTE_**: [**_`CompletableFuture`_**](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/CompletableFuture.html) and (parallel) [**_`Stream`_**](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/stream/package-summary.html) introduced in Java 8 is executed through `ForkJoinPool` underneath, so after supporting `ForkJoinPool`, `TTL` also supports `CompletableFuture` and `Stream` transparently. 🎉
- `java.util.TimerTask`(corresponding execution component is `java.util.Timer`)
    - decoration implementation code is in [`TimerTaskTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/TimerTaskTtlTransformlet.java), supports since version **_`2.7.0`_**.
    - **_NOTE_**: Since version `2.11.2` decoration for `TimerTask` default is enable (because correctness is first concern, not the best practice like "It is not recommended to use `TimerTask`" :); before version `2.11.1` default is disable.
    - enabled/disable by agent argument `ttl.agent.enable.timer.task`:
        - `-javaagent:path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.enable.timer.task:true`
        - `-javaagent:path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.enable.timer.task:false`
    - more info about `TTL` agent arguments, see [the javadoc of `TtlAgent.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java).

Add start options on Java command:

- `-javaagent:path/to/transmittable-thread-local-2.x.y.jar`

Java command example:

```bash
java -javaagent:transmittable-thread-local-2.x.y.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo

# if changed the TTL jar file name or the TTL version is before 2.6.0,
# should set argument -Xbootclasspath explicitly.
java -javaagent:path/to/ttl-foo-name-changed.jar \
    -Xbootclasspath/a:path/to/ttl-foo-name-changed.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo

java -javaagent:path/to/transmittable-thread-local-2.5.1.jar \
    -Xbootclasspath/a:path/to/transmittable-thread-local-2.5.1.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo
```

Run the script [`scripts/run-agent-demo.sh`](scripts/run-agent-demo.sh)
to start demo of "Use Java Agent to decorate thread pool implementation class".



**NOTE**:

- Because TTL agent modified the `JDK` std lib classes, make code refer from std lib class to the TTL classes, so the TTL Agent jar must be added to `boot classpath`.
- Since `v2.6.0`, TTL agent jar will auto add self to `boot classpath`. But you **should _NOT_** modify the downloaded TTL jar file name in the maven repo(eg: `transmittable-thread-local-2.x.y.jar`).
    - if you modified the downloaded TTL jar file name(eg: `ttl-foo-name-changed.jar`),
      you must add TTL agent jar to `boot classpath` manually by java option `-Xbootclasspath/a:path/to/ttl-foo-name-changed.jar`.

The implementation of auto adding self agent jar to `boot classpath` use the `Boot-Class-Path` property of manifest file(`META-INF/MANIFEST.MF`) in the TTL Java Agent Jar:

> [!NOTE]
> `Boot-Class-Path`
>
> A list of paths to be searched by the bootstrap class loader. Paths represent directories or libraries (commonly referred to as JAR or zip libraries on many platforms).
> These paths are searched by the bootstrap class loader after the platform specific mechanisms of locating a class have failed. Paths are searched in the order listed.

More info:

- [`Java Agent Specification` - `JavaDoc`文档](https://docs.oracle.com/en/java/javase/21/docs/api/java.instrument/java/lang/instrument/package-summary.html#package.description)
- [JAR File Specification - JAR Manifest](https://docs.oracle.com/en/java/javase/21/docs/specs/jar/jar.html#jar-manifest)
- [Working with Manifest Files - The Java™ Tutorials](https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html)

# 🔌 Java API Docs

The current version Java API documentation: <https://alibaba.github.io/transmittable-thread-local/apidocs/>

# 🍪 Maven Dependency

```xml
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>transmittable-thread-local</artifactId>
    <version>2.14.4</version>
</dependency>
```

Check available version at [maven.org](https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml).

# 🔨 How to compile and build

Compilation/build environment require **_`JDK 8+`_**; Compilation can be performed in the normal way of `Maven`.

\# The project already contains `Maven` that satisfied the required version, directly run **_`mvnw` in the project root directory_**; there is no need to manually install `Maven` by yourself.

```bash
# Run test case
./mvnw test
# Compile and package
./mvnw package
# Run test case, compile and package, install TTL library to local Maven
./mvnw install

##################################################
# If you use maven installed by yourself, the version requirement: maven 3.3.9+

mvn install
```

# 🗿 More Documentation

- [🎓 Developer Guide](docs/developer-guide-en.md)

# 📚 Related Resources

## JDK Core Classes

- [WeakHashMap](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/WeakHashMap.html)
- [InheritableThreadLocal](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)

# 💗 Who Used

Some open-source projects used `TTL`:

- **Middleware**
    - [`sofastack/sofa-rpc` ![](https://img.shields.io/github/stars/sofastack/sofa-rpc.svg?style=social&label=Star)](https://github.com/sofastack/sofa-rpc) [![star](https://gitee.com/sofastack/sofa-rpc/badge/star.svg?theme=gray)](https://gitee.com/sofastack/sofa-rpc)  
      SOFARPC is a high-performance, high-extensibility, production-level Java RPC framework
    - [`trpc-group/trpc-java` ![](https://img.shields.io/github/stars/trpc-group/trpc-java.svg?style=social&label=Star)](https://github.com/trpc-group/trpc-java)  
      A pluggable, high-performance RPC framework written in java
    - [`tencentmusic/supersonic` ![](https://img.shields.io/github/stars/tencentmusic/supersonic.svg?style=social&label=Star)](https://github.com/tencentmusic/supersonic)  
      SuperSonic is an out-of-the-box yet highly extensible framework for building ChatBI
    - [`dromara/hmily` ![](https://img.shields.io/github/stars/dromara/hmily.svg?style=social&label=Star)](https://github.com/dromara/hmily) [![star](https://gitee.com/dromara/hmily/badge/star.svg?theme=gray)](https://gitee.com/dromara/hmily)  
      Distributed transaction solutions
    - [`dromara/gobrs-async` ![](https://img.shields.io/github/stars/dromara/gobrs-async.svg?style=social&label=Star)](https://github.com/dromara/gobrs-async) [![star](https://gitee.com/dromara/gobrs-async/badge/star.svg?theme=gray)](https://gitee.com/dromara/gobrs-async)  
      一款功能强大、配置灵活、带有全链路异常回调、内存优化、异常状态管理于一身的高性能异步编排框架。为企业提供在复杂应用场景下动态任务编排的能力。 针对于复杂场景下,异步线程复杂性、任务依赖性、异常状态难控制性
    - [`dromara/dynamic-tp` ![](https://img.shields.io/github/stars/dromara/dynamic-tp.svg?style=social&label=Star)](https://github.com/dromara/dynamic-tp) [![star](https://gitee.com/dromara/dynamic-tp/badge/star.svg?theme=gray)](https://gitee.com/dromara/dynamic-tp)  
      Lightweight dynamic threadpool, with monitoring and alarming functions, base on popular config centers (already support Nacos、Apollo、Zookeeper, can be customized through SPI)
    - [`opengoofy/hippo4j` ![](https://img.shields.io/github/stars/opengoofy/hippo4j.svg?style=social&label=Star)](https://github.com/opengoofy/hippo4j) [![star](https://gitee.com/magestack/hippo4j/badge/star.svg?theme=gray)](https://gitee.com/magestack/hippo4j)  
      动态线程池框架,附带监控报警功能,支持 JDK、Tomcat、Jetty、Undertow 线程池;Apache RocketMQ、Dubbo、RabbitMQ、Hystrix 消费等线程池。内置两种使用模式:轻量级依赖配置中心以及无中间件依赖版本
    - [`siaorg/sia-gateway` ![](https://img.shields.io/github/stars/siaorg/sia-gateway.svg?style=social&label=Star)](https://github.com/siaorg/sia-gateway)  
      microservice route gateway(zuul-plus)
    - [`huaweicloud/Sermant` ![](https://img.shields.io/github/stars/huaweicloud/Sermant.svg?style=social&label=Star)](https://github.com/huaweicloud/Sermant)  
      Sermant, a proxyless service mesh solution based on Javaagent
    - [`ZTO-Express/zms` ![](https://img.shields.io/github/stars/ZTO-Express/zms.svg?style=social&label=Star)](https://github.com/ZTO-Express/zms) [![star](https://gitee.com/zto_express/zms/badge/star.svg?theme=gray)](https://gitee.com/zto_express/zms)  
      ZTO Message Service
    - [`lxchinesszz/tomato` ![](https://img.shields.io/github/stars/lxchinesszz/tomato.svg?style=social&label=Star)](https://github.com/lxchinesszz/tomato)  
      一款专门为SpringBoot项目设计的幂等组件
    - [`ytyht226/taskflow` ![](https://img.shields.io/github/stars/ytyht226/taskflow.svg?style=social&label=Star)](https://github.com/ytyht226/taskflow)  
      一款轻量、简单易用、可灵活扩展的通用任务编排框架,基于有向无环图(DAG)的方式实现,框架提供了组件复用、同步/异步编排、条件判断、分支选择等能力,可以根据不同的业务场景对任意的业务流程进行编排
    - [`foldright/cffu` ![](https://img.shields.io/github/stars/foldright/cffu.svg?style=social&label=star)](https://github.com/foldright/cffu)  
      🦝 Java CompletableFuture Fu, aka. CF-Fu, pronounced "Shifu"; include best practice/traps guide and a tiny sidekick library to improve user experience and reduce misuse.
    - [`tuya/connector` ![](https://img.shields.io/github/stars/tuya/connector.svg?style=social&label=Star)](https://github.com/tuya/connector)  
      The connector framework maps cloud APIs to local APIs based on simple configurations and flexible extension mechanisms
- **Middleware/Data Processing**
    - [`apache/shardingsphere` ![](https://img.shields.io/github/stars/apache/shardingsphere.svg?style=social&label=Star)](https://github.com/apache/shardingsphere) [![star](https://gitee.com/Sharding-Sphere/sharding-sphere/badge/star.svg?theme=gray)](https://gitee.com/Sharding-Sphere/sharding-sphere)  
      Ecosystem to transform any database into a distributed database system, and enhance it with sharding, elastic scaling, encryption features & more
    - [`apache/kylin` ![](https://img.shields.io/github/stars/apache/kylin.svg?style=social&label=Star)](https://github.com/apache/kylin)  
      A unified and powerful OLAP platform for Hadoop and Cloud.
    - [`mybatis-flex/mybatis-flex` ![](https://img.shields.io/github/stars/mybatis-flex/mybatis-flex.svg?style=social&label=Star)](https://github.com/mybatis-flex/mybatis-flex) [![star](https://gitee.com/mybatis-flex/mybatis-flex/badge/star.svg?theme=gray)](https://gitee.com/mybatis-flex/mybatis-flex)  
      mybatis-flex is an elegant Mybatis Enhancement Framework
    - [`basicai/xtreme1` ![](https://img.shields.io/github/stars/basicai/xtreme1.svg?style=social&label=Star)](https://github.com/basicai/xtreme1)  
      The Next GEN Platform for Multisensory Training Data. #3D annotation, lidar-camera annotation and image annotation tools are supported
    - [`oceanbase/odc` ![](https://img.shields.io/github/stars/oceanbase/odc.svg?style=social&label=Star)](https://github.com/oceanbase/odc)  
      An open-source, enterprise-grade database tool for collaborative development
    - [`sagframe/sagacity-sqltoy` ![](https://img.shields.io/github/stars/sagframe/sagacity-sqltoy.svg?style=social&label=Star)](https://github.com/sagframe/sagacity-sqltoy)  
      Java真正智慧的ORM框架
    - [`dromara/stream-query` ![](https://img.shields.io/github/stars/dromara/stream-query.svg?style=social&label=Star)](https://github.com/dromara/stream-query) [![star](https://gitee.com/dromara/stream-query/badge/star.svg?theme=gray)](https://gitee.com/dromara/stream-query)  
      允许完全摆脱Mapper的mybatis-plus体验;可以使用类似“工具类”这样的静态函数进行数据库操作
    - [`luo-zhan/Transformer` ![](https://img.shields.io/github/stars/luo-zhan/Transformer.svg?style=social&label=Star)](https://github.com/luo-zhan/Transformer)  
      Transformer可能是最简单,但最强大的字段转换插件,一个注解搞定任意转换,让开发变得更加丝滑
    - [`SimonAlong/Neo` ![](https://img.shields.io/github/stars/SimonAlong/Neo.svg?style=social&label=Star)](https://github.com/SimonAlong/Neo)  
      Orm框架:基于ActiveRecord思想开发的至简化且功能很全的Orm框架
    - [`ppdaicorp/das` ![](https://img.shields.io/github/stars/ppdaicorp/das.svg?style=social&label=Star)](https://github.com/ppdaicorp/das)  
      数据库访问框架(data access service),包括数据库控制台das console,数据库客户端das client和数据库服务端das server三部分
    - [`didi/ALITA` ![](https://img.shields.io/github/stars/didi/ALITA.svg?style=social&label=Star)](https://github.com/didi/ALITA)  
      a layer-based data analysis tool
    - [`didi/daedalus` ![](https://img.shields.io/github/stars/didi/daedalus.svg?style=social&label=Star)](https://github.com/didi/daedalus)  
      实现快速创建数据构造流程,数据构造流程的可视化、线上化、持久化、标准化
- **Middleware/Flow engine**
    - [`dromara/liteflow` ![](https://img.shields.io/github/stars/dromara/liteflow.svg?style=social&label=Star)](https://github.com/dromara/liteflow) [![star](https://gitee.com/dromara/liteFlow/badge/star.svg?theme=gray)](https://gitee.com/dromara/liteFlow)  
      a lightweight and practical micro-process framework
    - [`alibaba/bulbasaur` ![](https://img.shields.io/github/stars/alibaba/bulbasaur.svg?style=social&label=Star)](https://github.com/alibaba/bulbasaur)  
      A pluggable, scalable process engine
- **Middleware/Log**
    - [`dromara/TLog` ![](https://img.shields.io/github/stars/dromara/TLog.svg?style=social&label=Star)](https://github.com/dromara/TLog) [![star](https://gitee.com/dromara/TLog/badge/star.svg?theme=gray)](https://gitee.com/dromara/TLog)  
      Lightweight distributed log label tracking framework
    - [`fayechenlong/plumelog` ![](https://img.shields.io/github/stars/fayechenlong/plumelog.svg?style=social&label=Star)](https://github.com/fayechenlong/plumelog) [![star](https://gitee.com/plumeorg/plumelog/badge/star.svg?theme=gray)](https://gitee.com/plumeorg/plumelog)  
      一个java分布式日志组件,支持百亿级别
    - [`minbox-projects/minbox-logging` ![](https://img.shields.io/github/stars/minbox-projects/minbox-logging.svg?style=social&label=Star)](https://github.com/minbox-projects/minbox-logging) [![star](https://gitee.com/minbox-projects/minbox-logging/badge/star.svg?theme=gray)](https://gitee.com/minbox-projects/minbox-logging)  
      分布式零侵入式、链路式请求日志分析框架。提供Admin端点进行采集日志、分析日志、日志告警通知、服务性能分析等。通过Admin Ui可查看实时链路日志信息、在线业务服务列表
        - [`minbox-projects/api-boot` ![](https://img.shields.io/github/stars/minbox-projects/api-boot.svg?style=social&label=Star)](https://github.com/minbox-projects/api-boot) [![star](https://gitee.com/minbox-projects/api-boot/badge/star.svg?theme=gray)](https://gitee.com/minbox-projects/api-boot)  
          为接口服务而生的,基于“ SpringBoot”完成扩展和自动配置,内部封装了一系列的开箱即用Starters
    - [`ofpay/logback-mdc-ttl` ![](https://img.shields.io/github/stars/ofpay/logback-mdc-ttl.svg?style=social&label=Star)](https://github.com/ofpay/logback-mdc-ttl)  
      logback扩展,集成transmittable-thread-local支持跨线程池的mdc跟踪
    - [`oldratlee/log4j2-ttl-thread-context-map` ![](https://img.shields.io/github/stars/oldratlee/log4j2-ttl-thread-context-map.svg?style=social&label=Star)](https://github.com/oldratlee/log4j2-ttl-thread-context-map)  
      Log4j2 TTL ThreadContextMap, Log4j2 extension integrated TransmittableThreadLocal to MDC
- **Middleware/Bytecode**
    - [`ymm-tech/easy-byte-coder` ![](https://img.shields.io/github/stars/ymm-tech/easy-byte-coder.svg?style=social&label=Star)](https://github.com/ymm-tech/easy-byte-coder)  
      Easy-byte-coder is a non-invasive bytecode injection framework based on JVM
- **Business service or platform application**
    - [`OpenBankProject/OBP-API` ![](https://img.shields.io/github/stars/OpenBankProject/OBP-API.svg?style=social&label=Star)](https://github.com/OpenBankProject/OBP-API)  
      An open source RESTful API platform for banks that supports Open Banking, XS2A and PSD2 through access to accounts, transactions, counterparties, payments, entitlements and metadata - plus a host of internal banking and management APIs
    - [`gz-yami/mall4j` ![](https://img.shields.io/github/stars/gz-yami/mall4j.svg?style=social&label=Star)](https://github.com/gz-yami/mall4j) [![star](https://gitee.com/gz-yami/mall4j/badge/star.svg?theme=gray)](https://gitee.com/gz-yami/mall4j)  
      电商商城 java电商商城系统 uniapp商城 多用户商城
    - [`Joolun/JooLun-wx` ![](https://img.shields.io/github/stars/Joolun/JooLun-wx.svg?style=social&label=Star)](https://github.com/Joolun/JooLun-wx) [![star](https://gitee.com/joolun/JooLun-wx/badge/star.svg?theme=gray)](https://gitee.com/joolun/JooLun-wx)  
      JooLun微信商城
    - [`HummerRisk/HummerRisk` ![](https://img.shields.io/github/stars/HummerRisk/HummerRisk.svg?style=social&label=Star)](https://github.com/HummerRisk/HummerRisk)  
      云原生安全平台,包括混合云安全治理和容器云安全检测
    - [`XiaoMi/mone` ![](https://img.shields.io/github/stars/XiaoMi/mone.svg?style=social&label=Star)](https://github.com/XiaoMi/mone)  
      `Mone`以微服务为核心的一站式企业协同研发平台。支持公共云、专有云和混合云多种部署形态;提供从“项目创建->开发->部署->治理->应用观测”端到端的研发全流程服务;通过云原生新技术和研发新模式,打造“双敏”,敏捷研发和敏捷组织,保障小米-中国区高复杂业务、大规模团队的敏捷研发协同,实现多倍效能提升。
    - [`yangzongzhuan/RuoYi-Cloud` ![](https://img.shields.io/github/stars/yangzongzhuan/RuoYi-Cloud.svg?style=social&label=Star)](https://github.com/yangzongzhuan/RuoYi-Cloud) [![star](https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=gray)](https://gitee.com/y_project/RuoYi-Cloud)  
      基于Spring Boot、Spring Cloud & Alibaba的分布式微服务架构权限管理系统
    - [`somowhere/albedo` ![](https://img.shields.io/github/stars/somowhere/albedo.svg?style=social&label=Star)](https://github.com/somowhere/albedo) [![star](https://gitee.com/somowhere/albedo/badge/star.svg?theme=gray)](https://gitee.com/somowhere/albedo)  
      基于 Spring Boot 、Spring Security、Mybatis 的RBAC权限管理系统
    - [`qwdigital/LinkWechat` ![](https://img.shields.io/github/stars/qwdigital/LinkWechat.svg?style=social&label=Star)](https://github.com/qwdigital/LinkWechat) [![star](https://gitee.com/LinkWeChat/link-wechat/badge/star.svg?theme=gray)](https://gitee.com/LinkWeChat/link-wechat)  
      基于企业微信的开源 SCRM 系统,采用主流的 Java 微服务架构,是企业私域流量管理与营销的综合解决方案,助力企业提高客户运营效率,强化营销能力,拓展盈利空间
    - [`fushengqian/fuint` ![](https://img.shields.io/github/stars/fushengqian/fuint.svg?style=social&label=Star)](https://github.com/fushengqian/fuint) [![star](https://gitee.com/fuint/fuint-uniapp/badge/star.svg?theme=gray)](https://gitee.com/fuint/fuint-uniapp)  
      fuint会员营销系统是一套开源的实体店铺会员管理和营销系统
    - [`hiparker/opsli-boot` ![](https://img.shields.io/github/stars/hiparker/opsli-boot.svg?style=social&label=Star)](https://github.com/hiparker/opsli-boot) [![star](https://gitee.com/hiparker/opsli-boot/badge/star.svg?theme=gray)](https://gitee.com/hiparker/opsli-boot)  
      一款的低代码快速平台,零代码开发,致力于做更简洁的后台管理系统
    - [`topiam/eiam` ![](https://img.shields.io/github/stars/topiam/eiam.svg?style=social&label=Star)](https://github.com/topiam/eiam) [![star](https://gitee.com/topiam/eiam/badge/star.svg?theme=gray)](https://gitee.com/topiam/eiam)  
      EIAM(Employee Identity and Access Management Program)企业级开源IAM平台,实现用户全生命周期的管理、统一认证和单点登录、为数字身份安全赋能
    - [`Newspiral/newspiral-business` ![](https://img.shields.io/github/stars/Newspiral/newspiral-business.svg?style=social&label=Star)](https://github.com/Newspiral/newspiral-business)  
      联盟区块链底层平台
- **Tool product**
    - [`ssssssss-team/spider-flow` ![](https://img.shields.io/github/stars/ssssssss-team/spider-flow.svg?style=social&label=Star)](https://github.com/ssssssss-team/spider-flow) [![star](https://gitee.com/ssssssss-team/spider-flow/badge/star.svg?theme=gray)](https://gitee.com/ssssssss-team/spider-flow)  
      新一代爬虫平台,以图形化方式定义爬虫流程,不写代码即可完成爬虫
    - [`nekolr/slime` ![](https://img.shields.io/github/stars/nekolr/slime.svg?style=social&label=Star)](https://github.com/nekolr/slime)  
      🍰 一个可视化的爬虫平台
    - [`Jackson0714/PassJava-Platform` ![](https://img.shields.io/github/stars/Jackson0714/PassJava-Platform.svg?style=social&label=Star)](https://github.com/Jackson0714/PassJava-Platform)  
      一款面试刷题的 Spring Cloud 开源系统。零碎时间利用小程序查看常见面试题,夯实Java基础。 该项目可以教会你如何搭建SpringBoot项目,Spring Cloud项目。 采用流行的技术,如 SpringBoot、MyBatis、Redis、 MySql、 MongoDB、 RabbitMQ、Elasticsearch,采用Docker容器化部署
    - [`martin-chips/DimpleBlog` ![](https://img.shields.io/github/stars/martin-chips/DimpleBlog.svg?style=social&label=Star)](https://github.com/martin-chips/DimpleBlog)  
      基于`SpringBoot2`搭建的个人博客系统
    - [`zjcscut/octopus` ![](https://img.shields.io/github/stars/zjcscut/octopus.svg?style=social&label=Star)](https://github.com/zjcscut/octopus)  
      长链接压缩为短链接的服务
    - [`xggz/mqr` ![](https://img.shields.io/github/stars/xggz/mqr.svg?style=social&label=Star)](https://github.com/xggz/mqr) [![star](https://gitee.com/mlyai/mqr/badge/star.svg?theme=gray)](https://gitee.com/mlyai/mqr)  
      茉莉QQ机器人(简称MQR),采用mirai的Android协议实现的QQ机器人服务,通过web控制机器人的启停和配置
- **Test solution or tool**
    - [`alibaba/jvm-sandbox-repeater` ![](https://img.shields.io/github/stars/alibaba/jvm-sandbox-repeater.svg?style=social&label=Star)](https://github.com/alibaba/jvm-sandbox-repeater)  
      A Java server-side recording and playback solution based on JVM-Sandbox, 录制/回放通用解决方案
    - [`vivo/MoonBox` ![](https://img.shields.io/github/stars/vivo/MoonBox.svg?style=social&label=Star)](https://github.com/vivo/MoonBox)  
      Moonbox(月光宝盒)是JVM-Sandbox生态下的,基于jvm-sandbox-repeater重新开发的,一款流量回放平台产品。相较于jvm-sandbox-repeater,Moonbox功能更加丰富、数据可靠性更高,同时便于快速线上部署和使用
    - [`alibaba/testable-mock` ![](https://img.shields.io/github/stars/alibaba/testable-mock.svg?style=social&label=Star)](https://github.com/alibaba/testable-mock)  
      换种思路写Mock,让单元测试更简单
    - [`shulieTech/Takin` ![](https://img.shields.io/github/stars/shulieTech/Takin.svg?style=social&label=Star)](https://github.com/shulieTech/Takin)  
      measure online environmental performance test for full-links, Especially for microservices
        - [`shulieTech/LinkAgent` ![](https://img.shields.io/github/stars/shulieTech/LinkAgent.svg?style=social&label=Star)](https://github.com/shulieTech/LinkAgent)  
          a Java-based open-source agent designed to collect data and control Functions for Java applications through JVM bytecode, without modifying applications codes
    - [`alibaba/virtual-environment` ![](https://img.shields.io/github/stars/alibaba/virtual-environment.svg?style=social&label=Star)](https://github.com/alibaba/virtual-environment)  
      Route isolation with service sharing, 阿里测试环境服务隔离和联调机制的`Kubernetes`版实现
- **`Spring Cloud`/`Spring Boot` microservices framework solution or scaffold**
    - [`YunaiV/ruoyi-vue-pro` ![](https://img.shields.io/github/stars/YunaiV/ruoyi-vue-pro.svg?style=social&label=Star)](https://github.com/YunaiV/ruoyi-vue-pro)  [![star](https://gitee.com/zhijiantianya/ruoyi-vue-pro/badge/star.svg?theme=gray)](https://gitee.com/zhijiantianya/ruoyi-vue-pro)  
      一套全部开源的企业级的快速开发平台。基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 微信小程序,支持 RBAC 动态权限、数据权限、SaaS 多租户、Activiti + Flowable 工作流、三方登录、支付、短信、商城等功能
    - [`YunaiV/yudao-cloud` ![](https://img.shields.io/github/stars/YunaiV/yudao-cloud.svg?style=social&label=Star)](https://github.com/YunaiV/yudao-cloud)  [![star](https://gitee.com/zhijiantianya/yudao-cloud/badge/star.svg?theme=gray)](https://gitee.com/zhijiantianya/yudao-cloud)  
      RuoYi-Vue 全新 Cloud 版本,优化重构所有功能。基于 Spring Cloud Alibaba + MyBatis Plus + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能
    - [`zlt2000/microservices-platform` ![](https://img.shields.io/github/stars/zlt2000/microservices-platform.svg?style=social&label=Star)](https://github.com/zlt2000/microservices-platform) [![star](https://gitee.com/zlt2000/microservices-platform/badge/star.svg?theme=gray)](https://gitee.com/zlt2000/microservices-platform)  
      基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构
    - [`dromara/lamp-cloud` ![](https://img.shields.io/github/stars/dromara/lamp-cloud.svg?style=social&label=Star)](https://github.com/zuihou/lamp-cloud) [![star](https://gitee.com/dromara/lamp-cloud/badge/star.svg?theme=gray)](https://gitee.com/dromara/lamp-cloud)  
      基于Jdk11 + SpringCloud + SpringBoot 的微服务快速开发平台,其中的可配置的SaaS功能尤其闪耀, 具备RBAC功能、网关统一鉴权、Xss防跨站攻击、自动代码生成、多种存储系统、分布式事务、分布式定时任务等多个模块,支持多业务系统并行开发, 支持多服务并行开发,可以作为后端服务的开发脚手架
        - [`zuihou/lamp-util` ![](https://img.shields.io/github/stars/zuihou/lamp-util.svg?style=social&label=Star)](https://github.com/zuihou/lamp-util) [![star](https://gitee.com/zuihou111/lamp-util/badge/star.svg?theme=gray)](https://gitee.com/zuihou111/lamp-util)  
          打造一套兼顾 SpringBoot 和 SpringCloud 项目的公共工具类
    - [`matevip/matecloud` ![](https://img.shields.io/github/stars/matevip/matecloud.svg?style=social&label=Star)](https://github.com/matevip/matecloud) [![star](https://gitee.com/matevip/matecloud/badge/star.svg?theme=gray)](https://gitee.com/matevip/matecloud)  
      一款基于Spring Cloud Alibaba的微服务架构
    - [`gavenwangcn/vole` ![](https://img.shields.io/github/stars/gavenwangcn/vole.svg?style=social&label=Star)](https://github.com/gavenwangcn/vole)  
      SpringCloud Micro service business framework
    - [`liuweijw/fw-cloud-framework` ![](https://img.shields.io/github/stars/liuweijw/fw-cloud-framework.svg?style=social&label=Star)](https://github.com/liuweijw/fw-cloud-framework) [![star](https://gitee.com/liuweijw/fw-cloud-framework/badge/star.svg?theme=gray)](https://gitee.com/liuweijw/fw-cloud-framework)  
      基于springcloud全家桶开发分布式框架(支持oauth2认证授权、SSO登录、统一下单、微信公众号服务、Shardingdbc分库分表、常见服务监控、链路监控、异步日志、redis缓存等功能),实现基于Vue全家桶等前后端分离项目工程
    - [`liuht777/Taroco` ![](https://img.shields.io/github/stars/liuht777/Taroco.svg?style=social&label=Star)](https://github.com/liuht777/Taroco)  
      整合Nacos、Spring Cloud Alibaba,提供了一系列starter组件, 同时提供服务治理、服务监控、OAuth2权限认证,支持服务降级/熔断、服务权重
    - [`mingyang66/spring-parent` ![](https://img.shields.io/github/stars/mingyang66/spring-parent.svg?style=social&label=Star)](https://github.com/mingyang66/spring-parent)  
      数据库多数据源、Redis多数据源、日志组件、全链路日志追踪、埋点扩展点、Netty、微服务、开发基础框架支持、异常统一处理、返回值、跨域、API路由、监控等
    - [`budwk/budwk` ![](https://img.shields.io/github/stars/budwk/budwk.svg?style=social&label=Star)](https://github.com/budwk/budwk) [![star](https://gitee.com/budwk/budwk/badge/star.svg?theme=gray)](https://gitee.com/budwk/budwk)  
      `BudWk` 原名 [`NutzWk` ![](https://img.shields.io/github/stars/Wizzercn/NutzWk.svg?style=social&label=Star)](https://github.com/Wizzercn/NutzWk) [![star](https://gitee.com/wizzer/NutzWk/badge/star.svg?theme=gray)](https://gitee.com/wizzer/NutzWk),基于国产框架 nutz 及 nutzboot 开发的开源Web基础项目,集权限体系、系统参数、数据字典、站内消息、定时任务、CMS、微信等最常用功能,不庞杂、不面面俱到,使其具有上手容易、开发便捷、扩展灵活等特性,特别适合各类大中小型定制化项目需求
    - [`yinjihuan/spring-cloud` ![](https://img.shields.io/github/stars/yinjihuan/spring-cloud.svg?style=social&label=Star)](https://github.com/yinjihuan/spring-cloud)  
      《Spring Cloud微服务-全栈技术与案例解析》和《Spring Cloud微服务 入门 实战与进阶》配套源码
    - [`louyanfeng25/ddd-demo` ![](https://img.shields.io/github/stars/louyanfeng25/ddd-demo.svg?style=social&label=Star)](https://github.com/louyanfeng25/ddd-demo)  
      《深入浅出DDD》讲解的演示项目,为了能够更好的理解Demo中的分层与逻辑处理,我强烈建议你配合小册来深入了解DDD
    - [`nageoffer/12306` ![](https://img.shields.io/github/stars/nageoffer/12306.svg?style=social&label=Star)](https://github.com/nageoffer/12306)  
      12306 铁路购票服务是与大家生活和出行相关的关键系统,包括会员、购票、订单、支付和网关等服务。

more open-source projects used `TTL`, see [![user repos](https://badgen.net/github/dependents-repo/alibaba/transmittable-thread-local?label=user%20repos)](https://github.com/alibaba/transmittable-thread-local/network/dependents)

# 👷 Contributors

- Jerry Lee \<oldratlee at gmail dot com> [@oldratlee](https://github.com/oldratlee)
- Yang Fang \<snoop.fy at gmail dot com> [@driventokill](https://github.com/driventokill)
- Zava Xu \<zava.kid at gmail dot com> [@zavakid](https://github.com/zavakid)
- wuwen \<wuwen.55 at aliyun dot com> [@wuwen5](https://github.com/wuwen5)
- rybalkinsd \<yan.brikl at gmail dot com> [@rybalkinsd](https://github.com/rybalkinsd)
- David Dai \<351450944 at qq dot com> [@LNAmp](https://github.com/LNAmp)
- Your name here :-)

[![GitHub Contributors](https://contrib.rocks/image?repo=alibaba/transmittable-thread-local)](https://github.com/alibaba/transmittable-thread-local/graphs/contributors)


================================================
FILE: README.md
================================================
# <div align="center"><a href="#dummy"><img src="https://user-images.githubusercontent.com/1063891/233595946-4493119e-4e0c-4081-a382-0a20731c578e.png" alt="📌 TransmittableThreadLocal(TTL)"></a></div>

> [!IMPORTANT]
> 🚧 这个分支是`TransmittableThreadLocal(TTL) v3`,在开发中还没有发布。  
> `v3`的版本说明、工作项列表及其进展,参见 [issue 432](https://github.com/alibaba/transmittable-thread-local/issues/432)。
>
> 👉 目前使用中的稳定发布版本`v2.x`在 [**分支`2.x`**](https://github.com/alibaba/transmittable-thread-local/tree/2.x)上。

<p align="center">
<a href="https://github.com/alibaba/transmittable-thread-local/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/alibaba/transmittable-thread-local/ci.yaml?branch=master&logo=github&logoColor=white&label=fast ci" alt="Fast CI"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/actions/workflows/strong_ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/alibaba/transmittable-thread-local/strong_ci.yaml?branch=master&logo=github&logoColor=white&label=strong ci" alt="Strong CI"></a>
<a href="https://app.codecov.io/gh/alibaba/transmittable-thread-local/tree/master"><img src="https://img.shields.io/codecov/c/github/alibaba/transmittable-thread-local/master?logo=codecov&logoColor=white" alt="Coverage Status"></a>
<a href="https://openjdk.java.net/"><img src="https://img.shields.io/badge/Java-6+-339933?logo=openjdk&logoColor=white" alt="JDK support"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/alibaba/transmittable-thread-local?color=4D7A97&logo=apache" alt="License"></a>
<a href="https://alibaba.github.io/transmittable-thread-local/apidocs/"><img src="https://img.shields.io/github/release/alibaba/transmittable-thread-local?label=javadoc&color=339933&logo=read-the-docs&logoColor=white" alt="Javadocs"></a>
<a href="https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml"><img src="https://img.shields.io/maven-central/v/com.alibaba/transmittable-thread-local?logo=apache-maven&logoColor=white" alt="Maven Central"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/releases"><img src="https://img.shields.io/github/release/alibaba/transmittable-thread-local" alt="GitHub release"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/stargazers"><img src="https://img.shields.io/github/stars/alibaba/transmittable-thread-local?style=flat" alt="GitHub Stars"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/fork"><img src="https://img.shields.io/github/forks/alibaba/transmittable-thread-local?style=flat" alt="GitHub Forks"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/network/dependents"><img src="https://badgen.net/github/dependents-repo/alibaba/transmittable-thread-local?label=user%20repos" alt="user repos"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/issues"><img src="https://img.shields.io/github/issues/alibaba/transmittable-thread-local" alt="GitHub issues"></a>
<a href="https://github.com/alibaba/transmittable-thread-local/graphs/contributors"><img src="https://img.shields.io/github/contributors/alibaba/transmittable-thread-local" alt="GitHub Contributors"></a>
<a href="https://github.com/alibaba/transmittable-thread-local"><img src="https://img.shields.io/github/repo-size/alibaba/transmittable-thread-local" alt="GitHub repo size"></a>
<a href="https://gitpod.io/#https://github.com/alibaba/transmittable-thread-local"><img src="https://img.shields.io/badge/Gitpod-ready to code-339933?label=gitpod&logo=gitpod&logoColor=white" alt="gitpod: Ready to Code"></a>
</p>

[📖 English Documentation](README-EN.md) | 📖 中文文档

----------------------------------------

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [🔧 功能](#-%E5%8A%9F%E8%83%BD)
- [🎨 需求场景](#-%E9%9C%80%E6%B1%82%E5%9C%BA%E6%99%AF)
- [👥 User Guide](#-user-guide)
    - [1. 简单使用](#1-%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8)
    - [2. 保证线程池中传递值](#2-%E4%BF%9D%E8%AF%81%E7%BA%BF%E7%A8%8B%E6%B1%A0%E4%B8%AD%E4%BC%A0%E9%80%92%E5%80%BC)
        - [2.1 修饰`Runnable`和`Callable`](#21-%E4%BF%AE%E9%A5%B0runnable%E5%92%8Ccallable)
            - [整个过程的完整时序图](#%E6%95%B4%E4%B8%AA%E8%BF%87%E7%A8%8B%E7%9A%84%E5%AE%8C%E6%95%B4%E6%97%B6%E5%BA%8F%E5%9B%BE)
        - [2.2 修饰线程池](#22-%E4%BF%AE%E9%A5%B0%E7%BA%BF%E7%A8%8B%E6%B1%A0)
        - [2.3 使用`Java Agent`来修饰`JDK`线程池实现类](#23-%E4%BD%BF%E7%94%A8java-agent%E6%9D%A5%E4%BF%AE%E9%A5%B0jdk%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%AE%9E%E7%8E%B0%E7%B1%BB)
            - [`Java Agent`的启动参数配置](#java-agent%E7%9A%84%E5%90%AF%E5%8A%A8%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE)
- [🔌 Java API Docs](#-java-api-docs)
- [🍪 Maven依赖](#-maven%E4%BE%9D%E8%B5%96)
- [🔨 关于编译构建](#-%E5%85%B3%E4%BA%8E%E7%BC%96%E8%AF%91%E6%9E%84%E5%BB%BA)
- [❓ FAQ](#-faq)
- [✨ 使用`TTL`的好处与必要性](#-%E4%BD%BF%E7%94%A8ttl%E7%9A%84%E5%A5%BD%E5%A4%84%E4%B8%8E%E5%BF%85%E8%A6%81%E6%80%A7)
- [🗿 更多文档](#-%E6%9B%B4%E5%A4%9A%E6%96%87%E6%A1%A3)
- [📚 相关资料](#-%E7%9B%B8%E5%85%B3%E8%B5%84%E6%96%99)
    - [JDK Core Classes](#jdk-core-classes)
- [💗 Who Used](#-who-used)
- [👷 Contributors](#-contributors)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

----------------------------------------

# 🔧 功能

👉 `TransmittableThreadLocal`(`TTL`):在使用线程池等会池化复用线程的执行组件情况下,提供`ThreadLocal`值的传递功能,解决异步执行时上下文传递的问题。一个`Java`标准库本应为框架/中间件设施开发提供的标配能力,本库功能聚焦 & 0依赖,支持`Java 6~21`。

`JDK`的[`InheritableThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)类可以完成父线程到子线程的值传递。但对于使用线程池等会池化复用线程的执行组件的情况,线程由线程池创建好,并且线程是池化起来反复使用的;这时父子线程关系的`ThreadLocal`值传递已经没有意义,应用需要的实际上是把 **任务提交给线程池时**的`ThreadLocal`值传递到 **任务执行时**。

本库提供的[`TransmittableThreadLocal`](ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java)类继承并加强`InheritableThreadLocal`类,解决上述的问题,使用详见 [User Guide](#-user-guide)。


整个`TransmittableThreadLocal`库的核心功能(用户`API`、线程池`ExecutorService`/`ForkJoinPool`/`TimerTask`及其线程工厂的`Wrapper`;开发者`API`、框架/中间件的集成`API`),只有 **_~1000 `SLOC`代码行_**,非常精小。

欢迎 👏

- 建议和提问,[提交 Issue](https://github.com/alibaba/transmittable-thread-local/issues/new)
- 贡献和改进,[Fork 后提通过 Pull Request 贡献代码](https://github.com/alibaba/transmittable-thread-local/fork)

> [!NOTE]
> 从`TTL v2.13+`开始,升级到`Java 8`。🚀  
> 如果需要`Java 6`的支持,使用版本`2.12.x` <a href="https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml"><img src="https://img.shields.io/maven-central/v/com.alibaba/transmittable-thread-local?versionPrefix=2.12.&color=lightgrey&logo=apache-maven&logoColor=white" alt="Maven Central"></a>

# 🎨 需求场景

`ThreadLocal`的需求场景即`TransmittableThreadLocal`的潜在需求场景,如果你的业务需要『在使用线程池等会池化复用线程的执行组件情况下传递`ThreadLocal`值』则是`TransmittableThreadLocal`目标场景。

下面是几个典型场景例子。

1. 分布式跟踪系统 或 全链路压测(即链路打标)
2. 日志收集记录系统上下文
3. `Request`级`Cache`
4. 应用容器或上层框架跨应用代码给下层`SDK`传递信息

各个场景的展开说明参见子文档 [需求场景](docs/requirement-scenario.md)。

# 👥 User Guide

使用类[`TransmittableThreadLocal`](ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java)来保存值,并跨线程池传递。

`TransmittableThreadLocal`继承`InheritableThreadLocal`,使用方式也类似。相比`InheritableThreadLocal`,添加了`protected`的`transmitteeValue()`方法,用于定制 **任务提交给线程池时** 的`ThreadLocal`值传递到 **任务执行时** 的传递方式,缺省是简单的赋值传递。

注意:如果传递的对象(引用类型)会被修改,且没有做深拷贝(如直接传递引用或是浅拷贝),那么

- 因为跨线程传递而不再有线程封闭,传递对象在多个线程之间是有共享的。
- 与`JDK`的[`InheritableThreadLocal.childValue()`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html#childValue(T))一样,需要使用者/业务逻辑注意保证传递对象的线程安全。

<blockquote>
<details>

<summary>关于<code>transmitteeValue</code>方法 的 展开说明</summary>
<br>

<p>关于构词后缀<code>er</code>与<code>ee</code>的说明:

<ul>
<li><code>transmit</code>是动词传递,<code>transmitter</code>动作的执行者/主动方,而<code>transmittee</code>动作的接收者/被动方。</li>
<li><code>er</code>与<code>ee</code>后缀的常见词是<code>employer</code>(雇主)/<code>employee</code>(雇员)、<code>caller</code>(调用者)/<code>callee</code>(被调用者)。</li>
</ul>

</details>
</blockquote>

具体使用方式见下面的说明。

## 1. 简单使用

父线程给子线程传递值。

示例代码:

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// 在父线程中设置
context.set("value-set-in-parent");

// =====================================================

// 在子线程中可以读取,值是"value-set-in-parent"
String value = context.get();
```

\# 完整可运行的Demo代码参见[`SimpleDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/SimpleDemo.kt)。

这其实是`InheritableThreadLocal`的功能,应该使用`InheritableThreadLocal`来完成。

但对于使用线程池等会池化复用线程的执行组件的情况,线程由线程池创建好,并且线程是池化起来反复使用的;这时父子线程关系的`ThreadLocal`值传递已经没有意义,应用需要的实际上是把 **任务提交给线程池时**的`ThreadLocal`值传递到 **任务执行时**。

解决方法参见下面的这几种用法。

## 2. 保证线程池中传递值

### 2.1 修饰`Runnable`和`Callable`

使用[`TtlRunnable`](ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java)和[`TtlCallable`](ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java)来修饰传入线程池的`Runnable`和`Callable`。

示例代码:

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// 在父线程中设置
context.set("value-set-in-parent");

Runnable task = new RunnableTask();
// 额外的处理,生成修饰了的对象ttlRunnable
Runnable ttlRunnable = TtlRunnable.get(task);
executorService.submit(ttlRunnable);

// =====================================================

// Task中可以读取,值是"value-set-in-parent"
String value = context.get();
```

**_注意_**:  
即使是同一个`Runnable`任务多次提交到线程池时,每次提交时都需要通过修饰操作(即`TtlRunnable.get(task)`)以抓取这次提交时的`TransmittableThreadLocal`上下文的值;即如果同一个任务下一次提交时不执行修饰而仍然使用上一次的`TtlRunnable`,则提交的任务运行时会是之前修饰操作所抓取的上下文。示例代码如下:

```java
// 第一次提交
Runnable task = new RunnableTask();
executorService.submit(TtlRunnable.get(task));

// ...业务逻辑代码,
// 并且修改了 TransmittableThreadLocal上下文 ...
context.set("value-modified-in-parent");

// 再次提交
// 重新执行修饰,以传递修改了的 TransmittableThreadLocal上下文
executorService.submit(TtlRunnable.get(task));
```

上面演示了`Runnable`,`Callable`的处理类似

```java
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// 在父线程中设置
context.set("value-set-in-parent");

Callable call = new CallableTask();
// 额外的处理,生成修饰了的对象ttlCallable
Callable ttlCallable = TtlCallable.get(call);
executorService.submit(ttlCallable);

// =====================================================

// Call中可以读取,值是"value-set-in-parent"
String value = context.get();
```

\# 完整可运行的Demo代码参见[`TtlWrapperDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlWrapperDemo.kt)。

#### 整个过程的完整时序图

[![时序图](https://user-images.githubusercontent.com/1063891/233595980-ef7f1f8b-36cd-45b3-b55b-45f7b3d1c94f.png)](#dummy)

### 2.2 修饰线程池

省去每次`Runnable`和`Callable`传入线程池时的修饰,这个逻辑可以在线程池中完成。

通过工具类[`TtlExecutors`](ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlExecutors.java)完成,有下面的方法:

- `getTtlExecutor`:修饰接口`Executor`
- `getTtlExecutorService`:修饰接口`ExecutorService`
- `getTtlScheduledExecutorService`:修饰接口`ScheduledExecutorService`

示例代码:

```java
ExecutorService executorService = ...
// 额外的处理,生成修饰了的对象executorService
executorService = TtlExecutors.getTtlExecutorService(executorService);

TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

// =====================================================

// 在父线程中设置
context.set("value-set-in-parent");

Runnable task = new RunnableTask();
Callable call = new CallableTask();
executorService.submit(task);
executorService.submit(call);

// =====================================================

// Task或是Call中可以读取,值是"value-set-in-parent"
String value = context.get();
```

\# 完整可运行的Demo代码参见[`TtlExecutorWrapperDemo.kt`](ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlExecutorWrapperDemo.kt)。

### 2.3 使用`Java Agent`来修饰`JDK`线程池实现类

这种方式,实现线程池的传递是透明的,业务代码中没有修饰`Runnable`或是线程池的代码。即可以做到应用代码 **无侵入**。  
\# 关于 **无侵入** 的更多说明参见文档[`Java Agent`方式对应用代码无侵入](docs/developer-guide.md#java-agent%E6%96%B9%E5%BC%8F%E5%AF%B9%E5%BA%94%E7%94%A8%E4%BB%A3%E7%A0%81%E6%97%A0%E4%BE%B5%E5%85%A5)。

示例代码:

```java
// ## 1. 框架上层逻辑,后续流程框架调用业务 ##
TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();
context.set("value-set-in-parent");

// ## 2. 应用逻辑,后续流程业务调用框架下层逻辑 ##
ExecutorService executorService = Executors.newFixedThreadPool(3);

Runnable task = new RunnableTask();
Callable call = new CallableTask();
executorService.submit(task);
executorService.submit(call);

// ## 3. 框架下层逻辑 ##
// Task或是Call中可以读取,值是"value-set-in-parent"
String value = context.get();
```

Demo参见[`AgentDemo.kt`](ttl2-compatible/src/test/java/com/alibaba/demo/ttl/agent/AgentDemo.kt)。执行工程下的脚本[`scripts/run-agent-demo.sh`](scripts/run-agent-demo.sh)即可运行Demo。

目前`TTL Agent`中,修饰了的`JDK`执行器组件(即如线程池)如下:

1. `java.util.concurrent.ThreadPoolExecutor` 和 `java.util.concurrent.ScheduledThreadPoolExecutor`
    - 修饰实现代码在[`JdkExecutorTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/JdkExecutorTtlTransformlet.java)。
1. `java.util.concurrent.ForkJoinTask`(对应的执行器组件是`java.util.concurrent.ForkJoinPool`)
    - 修饰实现代码在[`ForkJoinTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/ForkJoinTtlTransformlet.java)。从版本 **_`2.5.1`_** 开始支持。
    - **_注意_**:`Java 8`引入的[**_`CompletableFuture`_**](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/CompletableFuture.html)与(并行执行的)[**_`Stream`_**](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/stream/package-summary.html)底层是通过`ForkJoinPool`来执行,所以支持`ForkJoinPool`后,`TTL`也就透明支持了`CompletableFuture`与`Stream`。🎉
1. `java.util.TimerTask`的子类(对应的执行器组件是`java.util.Timer`)
    - 修饰实现代码在[`TimerTaskTtlTransformlet.java`](ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/TimerTaskTtlTransformlet.java)。从版本 **_`2.7.0`_** 开始支持。
    - **_注意_**:从`2.11.2`版本开始缺省开启`TimerTask`的修饰(因为保证正确性是第一位,而不是最佳实践『不推荐使用`TimerTask`』:);`2.11.1`版本及其之前的版本没有缺省开启`TimerTask`的修饰。
    - 使用`Agent`参数`ttl.agent.enable.timer.task`开启/关闭`TimerTask`的修饰:
        - `-javaagent:path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.enable.timer.task:true`
        - `-javaagent:path/to/transmittable-thread-local-2.x.y.jar=ttl.agent.enable.timer.task:false`
    - 更多关于`TTL Agent`参数的配置说明详见[`TtlAgent.java`的JavaDoc](ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java)。

<blockquote>
<details>

<summary>关于<code>java.util.TimerTask</code>/<code>java.util.Timer</code> 的 展开说明</summary>
<br>

<p><code>Timer</code>是<code>JDK 1.3</code>的老类,不推荐使用<code>Timer</code>类。

<p>推荐用<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow"><code>ScheduledExecutorService</code></a>。<br>
<code>ScheduledThreadPoolExecutor</code>实现更强壮,并且功能更丰富。
如支持配置线程池的大小(<code>Timer</code>只有一个线程);<code>Timer</code>在<code>Runnable</code>中抛出异常会中止定时执行。更多说明参见 <a href="https://alibaba.github.io/Alibaba-Java-Coding-Guidelines/#concurrency" rel="nofollow">10. <strong>Mandatory</strong> Run multiple TimeTask by using ScheduledExecutorService rather than Timer because Timer will kill all running threads in case of failing to catch exceptions. - Alibaba Java Coding Guidelines</a>。</p>

</details>
</blockquote>

#### `Java Agent`的启动参数配置

在`Java`的启动参数加上:`-javaagent:path/to/transmittable-thread-local-2.x.y.jar`。

**_注意_**:

- 如果修改了下载的`TTL`的`Jar`的文件名(`transmittable-thread-local-2.x.y.jar`),则需要自己手动通过`-Xbootclasspath JVM`参数来显式配置。  
    比如修改文件名成`ttl-foo-name-changed.jar`,则还需要加上`Java`的启动参数:`-Xbootclasspath/a:path/to/ttl-foo-name-changed.jar`。
- 或使用`v2.6.0`之前的版本(如`v2.5.1`),则也需要自己手动通过`-Xbootclasspath JVM`参数来显式配置(就像`TTL`之前的版本的做法一样)。  
    加上`Java`的启动参数:`-Xbootclasspath/a:path/to/transmittable-thread-local-2.5.1.jar`。

`Java`命令行示例如下:

```bash
java -javaagent:path/to/transmittable-thread-local-2.x.y.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo

# 如果修改了TTL jar文件名 或 TTL版本是 2.6.0 之前
# 则还需要显式设置 -Xbootclasspath 参数
java -javaagent:path/to/ttl-foo-name-changed.jar \
    -Xbootclasspath/a:path/to/ttl-foo-name-changed.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo

java -javaagent:path/to/transmittable-thread-local-2.5.1.jar \
    -Xbootclasspath/a:path/to/transmittable-thread-local-2.5.1.jar \
    -cp classes \
    com.alibaba.demo.ttl.agent.AgentDemo
```



<blockquote>
<details>

<summary>关于<code>boot class path</code> 的 展开说明</summary>
<br>

<p>因为修饰了<code>JDK</code>标准库的类,标准库由<code>bootstrap class loader</code>加载;修饰后的<code>JDK</code>类引用了<code>TTL</code>的代码,所以<code>Java Agent</code>使用方式下<code>TTL Jar</code>文件需要配置到<code>boot class path</code>上。</p>

<p><code>TTL</code>从<code>v2.6.0</code>开始,加载<code>TTL Agent</code>时会自动设置<code>TTL Jar</code>到<code>boot class path</code>上。<br>
<strong><em>注意</em></strong>:不能修改从<code>Maven</code>库下载的<code>TTL Jar</code>文件名(形如<code>transmittable-thread-local-2.x.y.jar</code>)。
如果修改了,则需要自己手动通过<code>-Xbootclasspath JVM</code>参数来显式配置(就像<code>TTL</code>之前的版本的做法一样)。</p>

<p>自动设置<code>TTL Jar</code>到<code>boot class path</code>的实现是通过指定<code>TTL Java Agent Jar</code>文件里<code>manifest</code>文件(<code>META-INF/MANIFEST.MF</code>)的<code>Boot-Class-Path</code>属性:</p>

<p><code>Boot-Class-Path</code></p>
<p>A list of paths to be searched by the bootstrap class loader. Paths represent directories or libraries (commonly referred to as JAR or zip libraries on many platforms).
These paths are searched by the bootstrap class loader after the platform specific mechanisms of locating a class have failed. Paths are searched in the order listed.</p>

<p>更多详见</p>

<ul>
<li><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.instrument/java/lang/instrument/package-summary.html#package.description" rel="nofollow"><code>Java Agent</code>规范 - <code>JavaDoc</code></a></li>
<li><a href="https://docs.oracle.com/en/java/javase/21/docs/specs/jar/jar.html#jar-manifest" rel="nofollow">JAR File Specification - JAR Manifest</a></li>
<li><a href="https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html" rel="nofollow">Working with Manifest Files - The Java™ Tutorials</a></li>
</ul>

</details>
</blockquote>

# 🔌 Java API Docs

当前版本的Java API文档地址: <https://alibaba.github.io/transmittable-thread-local/apidocs/>

# 🍪 Maven依赖

示例:

```xml
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>transmittable-thread-local</artifactId>
    <version>2.14.4</version>
</dependency>
```

可以在 [maven.org](https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/maven-metadata.xml) 查看可用的版本。

# 🔨 关于编译构建

编译构建的环境要求: **_`JDK 8+`_**;用`Maven`常规的方式执行编译构建即可:  
\# 在工程中已经包含了符合版本要求的`Maven`,直接运行 **_工程根目录下的`mvnw`_**;并不需要先手动自己安装好`Maven`。

```bash
# 运行测试Case
./mvnw test
# 编译打包
./mvnw package
# 运行测试Case、编译打包、安装TTL库到Maven本地
./mvnw install

#####################################################
# 如果使用你自己安装的 maven,版本要求:maven 3.3.9+
mvn install
```

# ❓ FAQ

**_Q1. `TTL Agent`与其它`Agent`(如`Skywalking`、`Promethues`)配合使用时不生效?_**

配置`TTL Agent`在最前的位置,可以避免与其它其它`Agent`配合使用时,`TTL Agent`可能的不生效问题。配置示例:

```bash
java -javaagent:path/to/transmittable-thread-local-2.x.y.jar \
     -javaagent:path/to/skywalking-agent.jar \
     -jar your-app.jar
```

原因是:

- 像`Skywalking`这样的`Agent`的入口逻辑(`premain`)包含了线程池的启动。
- 如果配置在这样的`Agent`配置在前面,到了`TTL Agent`(的`premain`)时,`TTL`需要加强的线程池类已经加载(`load`)了。
- `TTL Agent`的`TtlTransformer`是在类加载时触发类的增强;如果类已经加载了会跳过`TTL Agent`的增强逻辑。

更多讨论参见 [Issue:`TTL agent`与其他`Agent`的兼容性问题 #226](https://github.com/alibaba/transmittable-thread-local/issues/226)。

**_Q2. `MacOS`下,使用`Java Agent`,可能会报`JavaLaunchHelper`的出错信息_**

JDK Bug: <https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8021205>  
可以换一个版本的`JDK`。我的开发机上`1.7.0_40`有这个问题,`1.6.0_51`、`1.7.0_45`可以运行。  
\# `1.7.0_45`还是有`JavaLaunchHelper`的出错信息,但不影响运行。

# ✨ 使用`TTL`的好处与必要性

> [!NOTE]
> 不读这一节,并不会影响你使用`TTL`来解决你碰到的问题,可以放心跳过;读了 [User Guide](#-user-guide) 就可以快速用起来了~ 😄 这一节信息密度较高不易读。

**_好处:透明且自动完成所有异步执行上下文的可定制、规范化的捕捉与传递。_**  
这个好处也是`TransmittableThreadLocal`的目标。

**_必要性:随着应用的分布式微服务化并使用各种中间件,越来越多的功能与组件会涉及不同的上下文,逻辑流程也越来越长;上下文问题实际上是个大的易错的架构问题,需要统一的对业务透明的解决方案。_**

使用`ThreadLocal`作为业务上下文传递的经典技术手段在中间件、技术与业务框架中广泛大量使用。而对于生产应用,几乎一定会使用线程池等异步执行组件,以高效支撑线上大流量。但使用`ThreadLocal`及其`set/remove`的上下文传递模式,在使用线程池等异步执行组件时,存在多方面的问题:

**_1. 从业务使用者角度来看_**

1. **繁琐**
   - 业务逻辑要知道:有哪些上下文;各个上下文是如何获取的。
   - 并需要业务逻辑去一个一个地捕捉与传递。
1. **依赖**
    - 需要直接依赖不同`ThreadLocal`上下文各自的获取的逻辑或类。
    - 像`RPC`的上下文(如`Dubbo`的`RpcContext`)、全链路跟踪的上下文(如`SkyWalking`的`ContextManager`)、不同业务模块中的业务流程上下文,等等。
1. **静态(易漏)**
    - 因为要 **_事先_** 知道有哪些上下文,如果系统出现了一个新的上下文,业务逻辑就要修改添加上新上下文传递的几行代码。也就是说因 **_系统的_** 上下文新增,**_业务的_** 逻辑就跟进要修改。
    - 而对于业务来说,不关心系统的上下文,即往往就可能遗漏,会是线上故障了。
    - 随着应用的分布式微服务化并使用各种中间件,越来越多的功能与组件会涉及不同的上下文,逻辑流程也越来越长;上下文问题实际上是个大的易错的架构问题,需要统一的对业务透明的解决方案。
1. **定制性**
    - 因为需要业务逻辑来完成捕捉与传递,业务要关注『上下文的传递方式』:直接传引用?还是拷贝传值?拷贝是深拷贝还是浅拷贝?在不同的上下文会需要不同的做法。
    - 『上下文的传递方式』往往是 **_上下文的提供者_**(或说是业务逻辑的框架部分)才能决策处理好的;而 **_上下文的使用者_**(或说是业务逻辑的应用部分)往往不(期望)知道上下文的传递方式。这也可以理解成是 **_依赖_**,即业务逻辑 依赖/关注/实现了 系统/架构的『上下文的传递方式』。

**_2. 从整体流程实现角度来看_**

关注的是 **上下文传递流程的规范化**。上下文传递到了子线程要做好 **_清理_**(或更准确地说是要 **_恢复_** 成之前的上下文),需要业务逻辑去处理好。如果业务逻辑对**清理**的处理不正确,比如:

- 如果清理操作漏了:
   - 下一次执行可能是上次的,即『上下文的 **_污染_**/**_串号_**』,会导致业务逻辑错误。
   - 『上下文的 **_泄漏_**』,会导致内存泄漏问题。
- 如果清理操作做多了,会出现上下文 **_丢失_**。

上面的问题,在业务开发中引发的`Bug`真是**屡见不鲜** !本质原因是:**_`ThreadLocal`的`set/remove`的上下文传递模式_** 在使用线程池等异步执行组件的情况下不再是有效的。常见的典型例子:

- 当线程池满了且线程池的`RejectedExecutionHandler`使用的是`CallerRunsPolicy`时,提交到线程池的任务会在提交线程中直接执行,`ThreadLocal.remove`操作**清理**提交线程的上下文导致上下文**丢失**。
- 类似的,使用`ForkJoinPool`(包含并行执行`Stream`与`CompletableFuture`,底层使用`ForkJoinPool`)的场景,展开的`ForkJoinTask`会在任务提交线程中直接执行。同样导致上下文**丢失**。

怎么设计一个『上下文传递流程』方案(即上下文的生命周期),以**保证**没有上面的问题?

期望:上下文生命周期的操作从业务逻辑中分离出来。业务逻辑不涉及生命周期,就不会有业务代码如疏忽清理而引发的问题了。整个上下文的传递流程或说生命周期可以规范化成:捕捉、回放和恢复这3个操作,即[**_`CRR(capture/replay/restore)`模式_**](docs/developer-guide.md#-%E6%A1%86%E6%9E%B6%E4%B8%AD%E9%97%B4%E4%BB%B6%E9%9B%86%E6%88%90ttl%E4%BC%A0%E9%80%92)。更多讨论参见 [Issue:能在详细讲解一下`replay`、`restore`的设计理念吗?#201](https://github.com/alibaba/transmittable-thread-local/issues/201)。

总结上面的说明:在生产应用(几乎一定会使用线程池等异步执行组件)中,使用`ThreadLocal`及其`set/remove`的上下文传递模式**几乎一定是有问题的**,**_只是在等一个出`Bug`的机会_**。

更多`TTL`好处与必要性的展开讨论参见 [Issue:这个库带来怎样的好处和优势? #128](https://github.com/alibaba/transmittable-thread-local/issues/128),欢迎继续讨论 ♥️

# 🗿 更多文档

- [🎨 需求场景说明](docs/requirement-scenario.md)
- [❤️ 小伙伴同学们写的`TTL`使用场景 与 设计实现解析的文章(写得都很好!) - Issue #123](https://github.com/alibaba/transmittable-thread-local/issues/123)
- [🎓 Developer Guide](docs/developer-guide.md)
- [☔ 性能测试](docs/performance-test.md)

# 📚 相关资料

## JDK Core Classes

- [WeakHashMap](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/WeakHashMap.html)
- [InheritableThreadLocal](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)

# 💗 Who Used

使用了`TTL`的一部分开源项目:

- **中间件**
    - [`sofastack/sofa-rpc` ![](https://img.shields.io/github/stars/sofastack/sofa-rpc.svg?style=social&label=Star)](https://github.com/sofastack/sofa-rpc) [![star](https://gitee.com/sofastack/sofa-rpc/badge/star.svg?theme=gray)](https://gitee.com/sofastack/sofa-rpc)  
      SOFARPC is a high-performance, high-extensibility, production-level Java RPC framework
    - [`trpc-group/trpc-java` ![](https://img.shields.io/github/stars/trpc-group/trpc-java.svg?style=social&label=Star)](https://github.com/trpc-group/trpc-java)  
      A pluggable, high-performance RPC framework written in java
    - [`tencentmusic/supersonic` ![](https://img.shields.io/github/stars/tencentmusic/supersonic.svg?style=social&label=Star)](https://github.com/tencentmusic/supersonic)  
      SuperSonic is an out-of-the-box yet highly extensible framework for building ChatBI
    - [`dromara/hmily` ![](https://img.shields.io/github/stars/dromara/hmily.svg?style=social&label=Star)](https://github.com/dromara/hmily) [![star](https://gitee.com/dromara/hmily/badge/star.svg?theme=gray)](https://gitee.com/dromara/hmily)  
      Distributed transaction solutions
    - [`dromara/gobrs-async` ![](https://img.shields.io/github/stars/dromara/gobrs-async.svg?style=social&label=Star)](https://github.com/dromara/gobrs-async) [![star](https://gitee.com/dromara/gobrs-async/badge/star.svg?theme=gray)](https://gitee.com/dromara/gobrs-async)  
      一款功能强大、配置灵活、带有全链路异常回调、内存优化、异常状态管理于一身的高性能异步编排框架。为企业提供在复杂应用场景下动态任务编排的能力。 针对于复杂场景下,异步线程复杂性、任务依赖性、异常状态难控制性
    - [`dromara/dynamic-tp` ![](https://img.shields.io/github/stars/dromara/dynamic-tp.svg?style=social&label=Star)](https://github.com/dromara/dynamic-tp) [![star](https://gitee.com/dromara/dynamic-tp/badge/star.svg?theme=gray)](https://gitee.com/dromara/dynamic-tp)  
      轻量级动态线程池,内置监控告警功能,支持线程池上下文传递,基于主流配置中心(已支持Nacos、Apollo,Zookeeper,可通过SPI自定义实现)
    - [`opengoofy/hippo4j` ![](https://img.shields.io/github/stars/opengoofy/hippo4j.svg?style=social&label=Star)](https://github.com/opengoofy/hippo4j) [![star](https://gitee.com/opengoofy/hippo4j/badge/star.svg?theme=gray)](https://gitee.com/magestack/hippo4j)  
      动态线程池框架,附带监控报警功能,支持 JDK、Tomcat、Jetty、Undertow 线程池;Apache RocketMQ、Dubbo、RabbitMQ、Hystrix 消费等线程池。内置两种使用模式:轻量级依赖配置中心以及无中间件依赖版本
    - [`siaorg/sia-gateway` ![](https://img.shields.io/github/stars/siaorg/sia-gateway.svg?style=social&label=Star)](https://github.com/siaorg/sia-gateway)  
      微服务路由网关(zuul-plus)
    - [`huaweicloud/Sermant` ![](https://img.shields.io/github/stars/huaweicloud/Sermant.svg?style=social&label=Star)](https://github.com/huaweicloud/Sermant)  
      Sermant, a proxyless service mesh solution based on Javaagent
    - [`ZTO-Express/zms` ![](https://img.shields.io/github/stars/ZTO-Express/zms.svg?style=social&label=Star)](https://github.com/ZTO-Express/zms) [![star](https://gitee.com/zto_express/zms/badge/star.svg?theme=gray)](https://gitee.com/zto_express/zms)  
      ZTO Message Service
    - [`lxchinesszz/tomato` ![](https://img.shields.io/github/stars/lxchinesszz/tomato.svg?style=social&label=Star)](https://github.com/lxchinesszz/tomato)  
      一款专门为SpringBoot项目设计的幂等组件
    - [`ytyht226/taskflow` ![](https://img.shields.io/github/stars/ytyht226/taskflow.svg?style=social&label=Star)](https://github.com/ytyht226/taskflow)  
      一款轻量、简单易用、可灵活扩展的通用任务编排框架,基于有向无环图(DAG)的方式实现,框架提供了组件复用、同步/异步编排、条件判断、分支选择等能力,可以根据不同的业务场景对任意的业务流程进行编排
    - [`foldright/cffu` ![](https://img.shields.io/github/stars/foldright/cffu.svg?style=social&label=star)](https://github.com/foldright/cffu)  
      🦝 Java CompletableFuture Fu, aka. CF-Fu, pronounced "Shifu"; include best practice/traps guide and a tiny sidekick library to improve user experience and reduce misuse.
    - [`tuya/connector` ![](https://img.shields.io/github/stars/tuya/connector.svg?style=social&label=Star)](https://github.com/tuya/connector)  
      The connector framework maps cloud APIs to local APIs based on simple configurations and flexible extension mechanisms
- **中间件/数据处理**
    - [`apache/shardingsphere` ![](https://img.shields.io/github/stars/apache/shardingsphere.svg?style=social&label=Star)](https://github.com/apache/shardingsphere) [![star](https://gitee.com/Sharding-Sphere/sharding-sphere/badge/star.svg?theme=gray)](https://gitee.com/Sharding-Sphere/sharding-sphere)  
      Ecosystem to transform any database into a distributed database system, and enhance it with sharding, elastic scaling, encryption features & more
    - [`apache/kylin` ![](https://img.shields.io/github/stars/apache/kylin.svg?style=social&label=Star)](https://github.com/apache/kylin)  
      A unified and powerful OLAP platform for Hadoop and Cloud.
    - [`mybatis-flex/mybatis-flex` ![](https://img.shields.io/github/stars/mybatis-flex/mybatis-flex.svg?style=social&label=Star)](https://github.com/mybatis-flex/mybatis-flex) [![star](https://gitee.com/mybatis-flex/mybatis-flex/badge/star.svg?theme=gray)](https://gitee.com/mybatis-flex/mybatis-flex)  
      mybatis-flex is an elegant Mybatis Enhancement Framework
    - [`basicai/xtreme1` ![](https://img.shields.io/github/stars/basicai/xtreme1.svg?style=social&label=Star)](https://github.com/basicai/xtreme1)  
      The Next GEN Platform for Multisensory Training Data. #3D annotation, lidar-camera annotation and image annotation tools are supported
    - [`oceanbase/odc` ![](https://img.shields.io/github/stars/oceanbase/odc.svg?style=social&label=Star)](https://github.com/oceanbase/odc)  
      An open-source, enterprise-grade database tool for collaborative development
    - [`sagframe/sagacity-sqltoy` ![](https://img.shields.io/github/stars/sagframe/sagacity-sqltoy.svg?style=social&label=Star)](https://github.com/sagframe/sagacity-sqltoy)  
      Java真正智慧的ORM框架
    - [`dromara/stream-query` ![](https://img.shields.io/github/stars/dromara/stream-query.svg?style=social&label=Star)](https://github.com/dromara/stream-query) [![star](https://gitee.com/dromara/stream-query/badge/star.svg?theme=gray)](https://gitee.com/dromara/stream-query)  
      允许完全摆脱Mapper的mybatis-plus体验;可以使用类似“工具类”这样的静态函数进行数据库操作
    - [`luo-zhan/Transformer` ![](https://img.shields.io/github/stars/luo-zhan/Transformer.svg?style=social&label=Star)](https://github.com/luo-zhan/Transformer)  
      Transformer可能是最简单,但最强大的字段转换插件,一个注解搞定任意转换,让开发变得更加丝滑
    - [`SimonAlong/Neo` ![](https://img.shields.io/github/stars/SimonAlong/Neo.svg?style=social&label=Star)](https://github.com/SimonAlong/Neo)  
      Orm框架:基于ActiveRecord思想开发的至简化且功能很全的Orm框架
    - [`ppdaicorp/das` ![](https://img.shields.io/github/stars/ppdaicorp/das.svg?style=social&label=Star)](https://github.com/ppdaicorp/das)  
      数据库访问框架(data access service),包括数据库控制台das console,数据库客户端das client和数据库服务端das server三部分
    - [`didi/ALITA` ![](https://img.shields.io/github/stars/didi/ALITA.svg?style=social&label=Star)](https://github.com/didi/ALITA)  
      a layer-based data analysis tool
    - [`didi/daedalus` ![](https://img.shields.io/github/stars/didi/daedalus.svg?style=social&label=Star)](https://github.com/didi/daedalus)  
      实现快速创建数据构造流程,数据构造流程的可视化、线上化、持久化、标准化
- **中间件/流程引擎**
    - [`dromara/liteflow` ![](https://img.shields.io/github/stars/dromara/liteflow.svg?style=social&label=Star)](https://github.com/dromara/liteflow) [![star](https://gitee.com/dromara/liteFlow/badge/star.svg?theme=gray)](https://gitee.com/dromara/liteFlow)  
      a lightweight and practical micro-process framework
    - [`alibaba/bulbasaur` ![](https://img.shields.io/github/stars/alibaba/bulbasaur.svg?style=social&label=Star)](https://github.com/alibaba/bulbasaur)  
      A pluggable, scalable process engine
- **中间件/日志**
    - [`dromara/TLog` ![](https://img.shields.io/github/stars/dromara/TLog.svg?style=social&label=Star)](https://github.com/dromara/TLog) [![star](https://gitee.com/dromara/TLog/badge/star.svg?theme=gray)](https://gitee.com/dromara/TLog)  
      Lightweight distributed log label tracking framework
    - [`fayechenlong/plumelog` ![](https://img.shields.io/github/stars/fayechenlong/plumelog.svg?style=social&label=Star)](https://github.com/fayechenlong/plumelog) [![star](https://gitee.com/plumeorg/plumelog/badge/star.svg?theme=gray)](https://gitee.com/plumeorg/plumelog)  
      一个java分布式日志组件,支持百亿级别
    - [`minbox-projects/minbox-logging` ![](https://img.shields.io/github/stars/minbox-projects/minbox-logging.svg?style=social&label=Star)](https://github.com/minbox-projects/minbox-logging) [![star](https://gitee.com/minbox-projects/minbox-logging/badge/star.svg?theme=gray)](https://gitee.com/minbox-projects/minbox-logging)  
      分布式零侵入式、链路式请求日志分析框架。提供Admin端点进行采集日志、分析日志、日志告警通知、服务性能分析等。通过Admin Ui可查看实时链路日志信息、在线业务服务列表
        - [`minbox-projects/api-boot` ![](https://img.shields.io/github/stars/minbox-projects/api-boot.svg?style=social&label=Star)](https://github.com/minbox-projects/api-boot) [![star](https://gitee.com/minbox-projects/api-boot/badge/star.svg?theme=gray)](https://gitee.com/minbox-projects/api-boot)  
          为接口服务而生的,基于“ SpringBoot”完成扩展和自动配置,内部封装了一系列的开箱即用Starters
    - [`ofpay/logback-mdc-ttl` ![](https://img.shields.io/github/stars/ofpay/logback-mdc-ttl.svg?style=social&label=Star)](https://github.com/ofpay/logback-mdc-ttl)  
      logback扩展,集成transmittable-thread-local支持跨线程池的mdc跟踪
    - [`oldratlee/log4j2-ttl-thread-context-map` ![](https://img.shields.io/github/stars/oldratlee/log4j2-ttl-thread-context-map.svg?style=social&label=Star)](https://github.com/oldratlee/log4j2-ttl-thread-context-map)  
      Log4j2 TTL ThreadContextMap, Log4j2 extension integrated TransmittableThreadLocal to MDC
    - [`qqxx6661/log-record` ![](https://img.shields.io/github/stars/qqxx6661/log-record.svg?style=social&label=Star)](https://github.com/qqxx6661/log-record)
      业务日志记录框架,使用注解优雅记录日志,支持SpEL表达式,自定义上下文,自定义函数,实体类DIFF等特性。
- **中间件/字节码**
    - [`ymm-tech/easy-byte-coder` ![](https://img.shields.io/github/stars/ymm-tech/easy-byte-coder.svg?style=social&label=Star)](https://github.com/ymm-tech/easy-byte-coder)  
      Easy-byte-coder is a non-invasive bytecode injection framework based on JVM
- **业务服务或平台应用**
    - [`OpenBankProject/OBP-API` ![](https://img.shields.io/github/stars/OpenBankProject/OBP-API.svg?style=social&label=Star)](https://github.com/OpenBankProject/OBP-API)  
      An open source RESTful API platform for banks that supports Open Banking, XS2A and PSD2 through access to accounts, transactions, counterparties, payments, entitlements and metadata - plus a host of internal banking and management APIs
    - [`gz-yami/mall4j` ![](https://img.shields.io/github/stars/gz-yami/mall4j.svg?style=social&label=Star)](https://github.com/gz-yami/mall4j) [![star](https://gitee.com/gz-yami/mall4j/badge/star.svg?theme=gray)](https://gitee.com/gz-yami/mall4j)  
      电商商城 java电商商城系统 uniapp商城 多用户商城
    - [`Joolun/JooLun-wx` ![](https://img.shields.io/github/stars/Joolun/JooLun-wx.svg?style=social&label=Star)](https://github.com/Joolun/JooLun-wx) [![star](https://gitee.com/joolun/JooLun-wx/badge/star.svg?theme=gray)](https://gitee.com/joolun/JooLun-wx)  
      JooLun微信商城
    - [`HummerRisk/HummerRisk` ![](https://img.shields.io/github/stars/HummerRisk/HummerRisk.svg?style=social&label=Star)](https://github.com/HummerRisk/HummerRisk)  
      云原生安全平台,包括混合云安全治理和容器云安全检测
    - [`XiaoMi/mone` ![](https://img.shields.io/github/stars/XiaoMi/mone.svg?style=social&label=Star)](https://github.com/XiaoMi/mone)  
      `Mone`以微服务为核心的一站式企业协同研发平台。支持公共云、专有云和混合云多种部署形态;提供从“项目创建->开发->部署->治理->应用观测”端到端的研发全流程服务;通过云原生新技术和研发新模式,打造“双敏”,敏捷研发和敏捷组织,保障小米-中国区高复杂业务、大规模团队的敏捷研发协同,实现多倍效能提升。
    - [`yangzongzhuan/RuoYi-Cloud` ![](https://img.shields.io/github/stars/yangzongzhuan/RuoYi-Cloud.svg?style=social&label=Star)](https://github.com/yangzongzhuan/RuoYi-Cloud) [![star](https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=gray)](https://gitee.com/y_project/RuoYi-Cloud)  
      基于Spring Boot、Spring Cloud & Alibaba的分布式微服务架构权限管理系统
    - [`somowhere/albedo` ![](https://img.shields.io/github/stars/somowhere/albedo.svg?style=social&label=Star)](https://github.com/somowhere/albedo) [![star](https://gitee.com/somowhere/albedo/badge/star.svg?theme=gray)](https://gitee.com/somowhere/albedo)  
      基于 Spring Boot 、Spring Security、Mybatis 的RBAC权限管理系统
    - [`qwdigital/LinkWechat` ![](https://img.shields.io/github/stars/qwdigital/LinkWechat.svg?style=social&label=Star)](https://github.com/qwdigital/LinkWechat) [![star](https://gitee.com/LinkWeChat/link-wechat/badge/star.svg?theme=gray)](https://gitee.com/LinkWeChat/link-wechat)  
      基于企业微信的开源 SCRM 系统,采用主流的 Java 微服务架构,是企业私域流量管理与营销的综合解决方案,助力企业提高客户运营效率,强化营销能力,拓展盈利空间
    - [`fushengqian/fuint` ![](https://img.shields.io/github/stars/fushengqian/fuint.svg?style=social&label=Star)](https://github.com/fushengqian/fuint) [![star](https://gitee.com/fuint/fuint-uniapp/badge/star.svg?theme=gray)](https://gitee.com/fuint/fuint-uniapp)  
      fuint会员营销系统是一套开源的实体店铺会员管理和营销系统
    - [`hiparker/opsli-boot` ![](https://img.shields.io/github/stars/hiparker/opsli-boot.svg?style=social&label=Star)](https://github.com/hiparker/opsli-boot) [![star](https://gitee.com/hiparker/opsli-boot/badge/star.svg?theme=gray)](https://gitee.com/hiparker/opsli-boot)  
      一款的低代码快速平台,零代码开发,致力于做更简洁的后台管理系统
    - [`topiam/eiam` ![](https://img.shields.io/github/stars/topiam/eiam.svg?style=social&label=Star)](https://github.com/topiam/eiam) [![star](https://gitee.com/topiam/eiam/badge/star.svg?theme=gray)](https://gitee.com/topiam/eiam)  
      EIAM(Employee Identity and Access Management Program)企业级开源IAM平台,实现用户全生命周期的管理、统一认证和单点登录、为数字身份安全赋能
    - [`Newspiral/newspiral-business` ![](https://img.shields.io/github/stars/Newspiral/newspiral-business.svg?style=social&label=Star)](https://github.com/Newspiral/newspiral-business)  
      联盟区块链底层平台
- **工具产品**
    - [`ssssssss-team/spider-flow` ![](https://img.shields.io/github/stars/ssssssss-team/spider-flow.svg?style=social&label=Star)](https://github.com/ssssssss-team/spider-flow) [![star](https://gitee.com/ssssssss-team/spider-flow/badge/star.svg?theme=gray)](https://gitee.com/ssssssss-team/spider-flow)  
      新一代爬虫平台,以图形化方式定义爬虫流程,不写代码即可完成爬虫
    - [`nekolr/slime` ![](https://img.shields.io/github/stars/nekolr/slime.svg?style=social&label=Star)](https://github.com/nekolr/slime)  
      🍰 一个可视化的爬虫平台
    - [`Jackson0714/PassJava-Platform` ![](https://img.shields.io/github/stars/Jackson0714/PassJava-Platform.svg?style=social&label=Star)](https://github.com/Jackson0714/PassJava-Platform)  
      一款面试刷题的 Spring Cloud 开源系统。零碎时间利用小程序查看常见面试题,夯实Java基础。 该项目可以教会你如何搭建SpringBoot项目,Spring Cloud项目。 采用流行的技术,如 SpringBoot、MyBatis、Redis、 MySql、 MongoDB、 RabbitMQ、Elasticsearch,采用Docker容器化部署
    - [`martin-chips/DimpleBlog` ![](https://img.shields.io/github/stars/martin-chips/DimpleBlog.svg?style=social&label=Star)](https://github.com/martin-chips/DimpleBlog)  
      基于`SpringBoot2`搭建的个人博客系统
    - [`zjcscut/octopus` ![](https://img.shields.io/github/stars/zjcscut/octopus.svg?style=social&label=Star)](https://github.com/zjcscut/octopus)  
      长链接压缩为短链接的服务
    - [`xggz/mqr` ![](https://img.shields.io/github/stars/xggz/mqr.svg?style=social&label=Star)](https://github.com/xggz/mqr) [![star](https://gitee.com/mlyai/mqr/badge/star.svg?theme=gray)](https://gitee.com/mlyai/mqr)  
      茉莉QQ机器人(简称MQR),采用mirai的Android协议实现的QQ机器人服务,通过web控制机器人的启停和配置
- **测试解决方案或工具**
    - [`alibaba/jvm-sandbox-repeater` ![](https://img.shields.io/github/stars/alibaba/jvm-sandbox-repeater.svg?style=social&label=Star)](https://github.com/alibaba/jvm-sandbox-repeater)  
      A Java server-side recording and playback solution based on JVM-Sandbox, 录制/回放通用解决方案
    - [`vivo/MoonBox` ![](https://img.shields.io/github/stars/vivo/MoonBox.svg?style=social&label=Star)](https://github.com/vivo/MoonBox)  
      Moonbox(月光宝盒)是JVM-Sandbox生态下的,基于jvm-sandbox-repeater重新开发的,一款流量回放平台产品。相较于jvm-sandbox-repeater,Moonbox功能更加丰富、数据可靠性更高,同时便于快速线上部署和使用
    - [`alibaba/testable-mock` ![](https://img.shields.io/github/stars/alibaba/testable-mock.svg?style=social&label=Star)](https://github.com/alibaba/testable-mock)  
      换种思路写Mock,让单元测试更简单
    - [`shulieTech/Takin` ![](https://img.shields.io/github/stars/shulieTech/Takin.svg?style=social&label=Star)](https://github.com/shulieTech/Takin)  
      全链路压测平台,measure online environmental performance test for full-links, Especially for microservices
        - [`shulieTech/LinkAgent` ![](https://img.shields.io/github/stars/shulieTech/LinkAgent.svg?style=social&label=Star)](https://github.com/shulieTech/LinkAgent)  
          a Java-based open-source agent designed to collect data and control Functions for Java applications through JVM bytecode, without modifying applications codes
    - [`alibaba/virtual-environment` ![](https://img.shields.io/github/stars/alibaba/virtual-environment.svg?style=social&label=Star)](https://github.com/alibaba/virtual-environment)  
      Route isolation with service sharing, 阿里测试环境服务隔离和联调机制的`Kubernetes`版实现
- **`Spring Cloud`/`Spring Boot`的框架方案/脚手架**
    - [`YunaiV/ruoyi-vue-pro` ![](https://img.shields.io/github/stars/YunaiV/ruoyi-vue-pro.svg?style=social&label=Star)](https://github.com/YunaiV/ruoyi-vue-pro)  [![star](https://gitee.com/zhijiantianya/ruoyi-vue-pro/badge/star.svg?theme=gray)](https://gitee.com/zhijiantianya/ruoyi-vue-pro)  
      一套全部开源的企业级的快速开发平台。基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 微信小程序,支持 RBAC 动态权限、数据权限、SaaS 多租户、Activiti + Flowable 工作流、三方登录、支付、短信、商城等功能
    - [`YunaiV/yudao-cloud` ![](https://img.shields.io/github/stars/YunaiV/yudao-cloud.svg?style=social&label=Star)](https://github.com/YunaiV/yudao-cloud)  [![star](https://gitee.com/zhijiantianya/yudao-cloud/badge/star.svg?theme=gray)](https://gitee.com/zhijiantianya/yudao-cloud)  
      RuoYi-Vue 全新 Cloud 版本,优化重构所有功能。基于 Spring Cloud Alibaba + MyBatis Plus + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能
    - [`zlt2000/microservices-platform` ![](https://img.shields.io/github/stars/zlt2000/microservices-platform.svg?style=social&label=Star)](https://github.com/zlt2000/microservices-platform) [![star](https://gitee.com/zlt2000/microservices-platform/badge/star.svg?theme=gray)](https://gitee.com/zlt2000/microservices-platform)  
      基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构
    - [`dromara/lamp-cloud` ![](https://img.shields.io/github/stars/dromara/lamp-cloud.svg?style=social&label=Star)](https://github.com/zuihou/lamp-cloud) [![star](https://gitee.com/dromara/lamp-cloud/badge/star.svg?theme=gray)](https://gitee.com/dromara/lamp-cloud)  
      基于Jdk11 + SpringCloud + SpringBoot 的微服务快速开发平台,其中的可配置的SaaS功能尤其闪耀, 具备RBAC功能、网关统一鉴权、Xss防跨站攻击、自动代码生成、多种存储系统、分布式事务、分布式定时任务等多个模块,支持多业务系统并行开发, 支持多服务并行开发,可以作为后端服务的开发脚手架
        - [`zuihou/lamp-util` ![](https://img.shields.io/github/stars/zuihou/lamp-util.svg?style=social&label=Star)](https://github.com/zuihou/lamp-util) [![star](https://gitee.com/zuihou111/lamp-util/badge/star.svg?theme=gray)](https://gitee.com/zuihou111/lamp-util)  
          打造一套兼顾 SpringBoot 和 SpringCloud 项目的公共工具类
    - [`matevip/matecloud` ![](https://img.shields.io/github/stars/matevip/matecloud.svg?style=social&label=Star)](https://github.com/matevip/matecloud) [![star](https://gitee.com/matevip/matecloud/badge/star.svg?theme=gray)](https://gitee.com/matevip/matecloud)  
      一款基于Spring Cloud Alibaba的微服务架构
    - [`gavenwangcn/vole` ![](https://img.shields.io/github/stars/gavenwangcn/vole.svg?style=social&label=Star)](https://github.com/gavenwangcn/vole)  
      SpringCloud 微服务业务脚手架
    - [`liuweijw/fw-cloud-framework` ![](https://img.shields.io/github/stars/liuweijw/fw-cloud-framework.svg?style=social&label=Star)](https://github.com/liuweijw/fw-cloud-framework) [![star](https://gitee.com/liuweijw/fw-cloud-framework/badge/star.svg?theme=gray)](https://gitee.com/liuweijw/fw-cloud-framework)  
      基于springcloud全家桶开发分布式框架(支持oauth2认证授权、SSO登录、统一下单、微信公众号服务、Shardingdbc分库分表、常见服务监控、链路监控、异步日志、redis缓存等功能),实现基于Vue全家桶等前后端分离项目工程
    - [`liuht777/Taroco` ![](https://img.shields.io/github/stars/liuht777/Taroco.svg?style=social&label=Star)](https://github.com/liuht777/Taroco)  
      整合Nacos、Spring Cloud Alibaba,提供了一系列starter组件, 同时提供服务治理、服务监控、OAuth2权限认证,支持服务降级/熔断、服务权重
    - [`mingyang66/spring-parent` ![](https://img.shields.io/github/stars/mingyang66/spring-parent.svg?style=social&label=Star)](https://github.com/mingyang66/spring-parent)  
      数据库多数据源、Redis多数据源、日志组件、全链路日志追踪、埋点扩展点、Netty、微服务、开发基础框架支持、异常统一处理、返回值、跨域、API路由、监控等
    - [`budwk/budwk` ![](https://img.shields.io/github/stars/budwk/budwk.svg?style=social&label=Star)](https://github.com/budwk/budwk) [![star](https://gitee.com/budwk/budwk/badge/star.svg?theme=gray)](https://gitee.com/budwk/budwk)  
      `BudWk` 原名 [`NutzWk` ![](https://img.shields.io/github/stars/Wizzercn/NutzWk.svg?style=social&label=Star)](https://github.com/Wizzercn/NutzWk) [![star](https://gitee.com/wizzer/NutzWk/badge/star.svg?theme=gray)](https://gitee.com/wizzer/NutzWk),基于国产框架 nutz 及 nutzboot 开发的开源Web基础项目,集权限体系、系统参数、数据字典、站内消息、定时任务、CMS、微信等最常用功能,不庞杂、不面面俱到,使其具有上手容易、开发便捷、扩展灵活等特性,特别适合各类大中小型定制化项目需求
    - [`yinjihuan/spring-cloud` ![](https://img.shields.io/github/stars/yinjihuan/spring-cloud.svg?style=social&label=Star)](https://github.com/yinjihuan/spring-cloud)  
      《Spring Cloud微服务-全栈技术与案例解析》和《Spring Cloud微服务 入门 实战与进阶》配套源码
    - [`louyanfeng25/ddd-demo` ![](https://img.shields.io/github/stars/louyanfeng25/ddd-demo.svg?style=social&label=Star)](https://github.com/louyanfeng25/ddd-demo)  
      《深入浅出DDD》讲解的演示项目,为了能够更好的理解Demo中的分层与逻辑处理,我强烈建议你配合小册来深入了解DDD
    - [`nageoffer/12306` ![](https://img.shields.io/github/stars/nageoffer/12306.svg?style=social&label=Star)](https://github.com/nageoffer/12306)  
      12306 铁路购票服务是与大家生活和出行相关的关键系统,包括会员、购票、订单、支付和网关等服务。

更多使用`TTL`的开源项目 参见 [![user repos](https://badgen.net/github/dependents-repo/alibaba/transmittable-thread-local?label=user%20repos)](https://github.com/alibaba/transmittable-thread-local/network/dependents)

# 👷 Contributors

- Jerry Lee \<oldratlee at gmail dot com> [@oldratlee](https://github.com/oldratlee)
- Yang Fang \<snoop.fy at gmail dot com> [@driventokill](https://github.com/driventokill)
- Zava Xu \<zava.kid at gmail dot com> [@zavakid](https://github.com/zavakid)
- wuwen \<wuwen.55 at aliyun dot com> [@wuwen5](https://github.com/wuwen5)
- rybalkinsd \<yan.brikl at gmail dot com> [@rybalkinsd](https://github.com/rybalkinsd)
- David Dai \<351450944 at qq dot com> [@LNAmp](https://github.com/LNAmp)
- Your name here :-)

[![GitHub Contributors](https://contrib.rocks/image?repo=alibaba/transmittable-thread-local)](https://github.com/alibaba/transmittable-thread-local/graphs/contributors)


================================================
FILE: SECURITY.md
================================================
# 漏洞奖励计划

## 报告

如果您认为自己在本程序中发现了任何安全(技术)漏洞,欢迎您通过 https://security.alibaba.com 向我们提交漏洞报告。
如果您报告任何安全漏洞,请注意您可能包含以下信息(合格报告):

* `git`程序`URL`地址,运行的环境
* 包含必要屏幕截图的详细说明
* 重现漏洞的步骤以及修复漏洞的建议。
* 其他有用信息

## 处理

ASRC(Alibaba Security Response Center 阿里安全响应中心)将尽快审核并回复您的提交内容,并在我们努力修复您提交的漏洞时随时通知您。如有必要,我们可能会与您联系以获取更多信息。

## 条款和条件

1. 仅接受技术漏洞并对其进行评级
2. 出于安全原因,上报者同意与ASRC合作完成他/她提交的漏洞,不向任何第三方透露任何漏洞信息
3. 如果不止一个人报告相同的安全漏洞,奖励将给予完成合格报告的第一个人
4. 为了保护程序的用户,请在修复之前不要直接提交`git`的`issue`,也不要在社区讨论任何漏洞信息
5. 所有奖励和声誉积分将提供给仅向ASRC提交其安全漏洞的上报者
6. 安全漏洞奖励的解释权利归ASRC所有

## 收集范围

我们的主要收集漏洞类别是:

* 服务器端请求伪造(`SSRF`)
* `SQL`注入
* 拒绝服务攻击
* 远程执行代码(`RCE`)
* XML外部实体攻击(`XXE`)
* 访问控制问题(不安全的直接对象参考问题等)
* 敏感目录遍历问题
* 本地文件读取(`LFD`)
* 敏感信息泄露(密钥、`Cookie`、`Session`等)

## 奖励

* 可直接导致严重问题的每个漏洞奖励7000元人民币
* 存在限制及需要一定特殊环境下才能利用的问题将给予700-5600元人民币不等的奖励,比如需要用户主动点击才会触发的问题或需要admin权限
* 只有在指定环境下才可以运行的利用将有可能被收纳但不给予奖励,或直接被忽略,比如只在`fastjson`+`linux`特定版本才会出现的问题

## 不在收集范围的报告

* 影响过时浏览器或平台用户的漏洞
* `Self-XSS`
* 会话固定
* 内容欺骗
* 缺少`cookie`标记
* 混合内容警告
* `SSL`/`TLS`问题
* `Clickjacking`
* 基于`Flash`的漏洞
* 反射文件下载攻击(`RFD`)
* 物理或社会工程攻击
* 未验证自动化工具或扫描仪的结果
* 登录/注销/未认证/低影响`CSRF`
* 需要`MITM`或物理访问用户设备的攻击
* 与网络协议或行业标准相关的问题
* 不能用于直接攻击的错误信息泄露
* 缺少与安全相关的`HTTP`标头等


# Vulnerability Reward Program

## Reporting

If you believe you have found any security (technical) vulnerability in the Program, you are welcomed to submit a vulnerability report to us at https://security.alibaba.com
In case of reporting any security vulnerability, please be noted that you may including following information (Qualified Reporting):

* The git program URL and running version
* A detailed description with necessary screenshots
* Steps to reappearance the vulnerability and your advice to fix it
* Other useful information

## Processing

ASRC (Alibaba Security Response Center) will review and respond as quickly as possible to your submission, and keep you informed as we work to fix the vulnerability you submitted. We may contact you for further information if necessary.

## Terms and Conditions

1. ONLY technical vulnerabilities will be accepted and rated.
2. With regarding to security reasons, reporters agree to cooperate with ASRC exclusively on the vulnerability he/she submitted and not disclose any information of vulnerability to any third-parties.
3. In the case that more than one person report the same security vulnerability, the reward will be given to the first person who accomplish a Qualified Reporting.
4. To protect users of the program, please do not directly submit issue on github or discuss anything with the community
5. All Rewards and Reputation Credits are given to the reporters who submit his/her security vulnerabilities ONLY to ASRC.
6. All rights for the security vulnerability rewards are reserved by ASRC.

## Scope of Collecting

The main categories of vulnerabilities that we are sincerely looking for are:

* Server-Side Request Forgery (`SSRF`)
* SQL Injection
* Denial of Service Attack
* Remote Code Execution (`RCE`)
* XML External Entity Attacks (`XXE`)
* Access Control Issues (Insecure Direct Object Reference issues, etc.)
* Directory Traversal Issues
* Local File Disclosure (`LFD`)
* Sensitive Information Leakage (Key, Cookie, Session etc.)

## Reward

* $1,000 for one valid report
* $100-$800 for Vuls which is limited. For example, Vuls that need user interactions or administrator authority
* Vuls which only work on the special version will be accepted but no reward, or directly rejected. For example, Vul runs only on a special linux version

## Ineligible Reports

* Vulnerabilities affecting users of outdated browsers or platforms
* "Self" `XSS`
* Session fixation
* Content Spoofing
* Missing cookie flags
* Mixed content warnings
* `SSL`/`TLS` best practices
* Clickjacking/UI redressing
* Flash-based vulnerabilities
* Reflected file download attacks (`RFD`)
* Physical or social engineering attacks
* Unverified Results of automated tools or scanners
* Login/logout/unauthenticated/low-impact `CSRF`
* Attacks requiring MITM or physical access to a user's device
* Issues related to networking protocols or industry standards
* Error information disclosure that cannot be used to make a direct attack
* Missing security-related `HTTP` headers which do not lead directly to a vulnerability


================================================
FILE: docs/developer-guide-en.md
================================================
# 🎓 Developer Guide

---------------------------

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [📌 Framework/Middleware integration to `TTL` transmittance](#-frameworkmiddleware-integration-to-ttl-transmittance)
- [📚 Related material](#-related-material)
    - [`JDK` core classes](#jdk-core-classes)
    - [`Java` Agent](#java-agent)
    - [`Javassist`](#javassist)
    - [`Maven Shade plugin`](#maven-shade-plugin)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

---------------------------

# 📌 Framework/Middleware integration to `TTL` transmittance

[`TransmittableThreadLocal.Transmitter`](../ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java) to capture all `TTL` values of current thread and replay them in another thread.

There are following methods:

1. `capture`: capture all `TTL` values in current thread
2. `replay`: replay the captured `TTL` values in the current thread, and return the backup `TTL` values before replay
3. `restore`: restore `TTL` values before replay

Sample code:

```java
// ===========================================================================
// Thread A
// ===========================================================================

TransmittableThreadLocal<String> context = new TransmittableThreadLocal<String>();
context.set("value-set-in-parent");

// 1. capture all TTL values in current thread
final Object captured = TransmittableThreadLocal.Transmitter.capture();

// ===========================================================================
// Thread B
// ===========================================================================

// 2. replay the captured TTL values in current thread, and return the backup TTL values before replay
final Object backup = TransmittableThreadLocal.Transmitter.replay(captured);
try {
    // Your biz code, you can get the TTL value from here
    String value = context.get();
    ...
} finally {
    // 3. restore TTL values before replay
    TransmittableThreadLocal.Transmitter.restore(backup);
}
```


- For more info about `TransmittableThreadLocal.Transmitter`, see [its Javadoc](../ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java).
- For more actual implementation code of `TTL` transmittance, see [`TtlRunnable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java) and [`TtlCallable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java).

# 📚 Related material

## `JDK` core classes

- [WeakHashMap](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/WeakHashMap.html)
- [InheritableThreadLocal](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)

## `Java` Agent

- [Java Agent Specification](https://docs.oracle.com/en/java/javase/21/docs/api/java.instrument/java/lang/instrument/package-summary.html)

## `Javassist`

- [Getting Started with Javassist](https://www.javassist.org/tutorial/tutorial.html)

## `Maven Shade plugin`

- [`Maven Shade plugin` doc](https://maven.apache.org/plugins/maven-shade-plugin/)


================================================
FILE: docs/developer-guide.md
================================================
# 🎓 Developer Guide

---------------------------

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [📌 框架/中间件集成`TTL`传递](#-%E6%A1%86%E6%9E%B6%E4%B8%AD%E9%97%B4%E4%BB%B6%E9%9B%86%E6%88%90ttl%E4%BC%A0%E9%80%92)
- [📟 关于`Java Agent`](#-%E5%85%B3%E4%BA%8Ejava-agent)
    - [`Java Agent`方式对应用代码无侵入](#java-agent%E6%96%B9%E5%BC%8F%E5%AF%B9%E5%BA%94%E7%94%A8%E4%BB%A3%E7%A0%81%E6%97%A0%E4%BE%B5%E5%85%A5)
    - [已有`Java Agent`中嵌入`TTL Agent`](#%E5%B7%B2%E6%9C%89java-agent%E4%B8%AD%E5%B5%8C%E5%85%A5ttl-agent)
- [👢 `Bootstrap ClassPath`上添加通用库`Jar`的问题及其解决方法](#-bootstrap-classpath%E4%B8%8A%E6%B7%BB%E5%8A%A0%E9%80%9A%E7%94%A8%E5%BA%93jar%E7%9A%84%E9%97%AE%E9%A2%98%E5%8F%8A%E5%85%B6%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95)
- [🔨 如何编译构建](#-%E5%A6%82%E4%BD%95%E7%BC%96%E8%AF%91%E6%9E%84%E5%BB%BA)
- [发布操作列表](#%E5%8F%91%E5%B8%83%E6%93%8D%E4%BD%9C%E5%88%97%E8%A1%A8)
- [📚 相关资料](#-%E7%9B%B8%E5%85%B3%E8%B5%84%E6%96%99)
    - [`JDK` core classes](#jdk-core-classes)
    - [`Java Agent`](#java-agent)
    - [`Javassist`](#javassist)
    - [`Maven Shade`插件](#maven-shade%E6%8F%92%E4%BB%B6)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

---------------------------

# 📌 框架/中间件集成`TTL`传递

框架/中间件集成`TTL`传递,通过[`TransmittableThreadLocal.Transmitter`](../ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java)
抓取当前线程的所有`TTL`值并在其他线程进行回放;在回放线程执行完业务操作后,恢复为回放线程原来的`TTL`值。

`TransmittableThreadLocal.Transmitter`提供了所有`TTL`值的抓取、回放和恢复方法(即`CRR`操作):

1. `capture`方法:抓取线程(线程A)的所有`TTL`值。
2. `replay`方法:在另一个线程(线程B)中,回放在`capture`方法中抓取的`TTL`值,并返回 回放前`TTL`值的备份
3. `restore`方法:恢复线程B执行`replay`方法之前的`TTL`值(即备份)

示例代码:

```java
// ===========================================================================
// 线程 A
// ===========================================================================

TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();
context.set("value-set-in-parent");

// (1) 抓取当前线程的所有TTL值
final Object captured = TransmittableThreadLocal.Transmitter.capture();

// ===========================================================================
// 线程 B(异步线程)
// ===========================================================================

// (2) 在线程 B中回放在capture方法中抓取的TTL值,并返回 回放前TTL值的备份
final Object backup = TransmittableThreadLocal.Transmitter.replay(captured);
try {
    // 你的业务逻辑,这里你可以获取到外面设置的TTL值
    String value = context.get();

    System.out.println("Hello: " + value);
    ...
    String result = "World: " + value;
} finally {
    // (3) 恢复线程 B执行replay方法之前的TTL值(即备份)
    TransmittableThreadLocal.Transmitter.restore(backup);
}
```

更多`TTL`传递的代码实现示例,参见 [`TtlRunnable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java)、[`TtlCallable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java)。

当然可以使用`TransmittableThreadLocal.Transmitter`的工具方法`runSupplierWithCaptured`和`runCallableWithCaptured`和可爱的`Java 8 Lambda`语法
来简化`replay`和`restore`操作,示例代码:

```java
// ===========================================================================
// 线程 A
// ===========================================================================

TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();
context.set("value-set-in-parent");

// (1) 抓取当前线程的所有TTL值
final Object captured = TransmittableThreadLocal.Transmitter.capture();

// ===========================================================================
// 线程 B(异步线程)
// ===========================================================================

String result = runSupplierWithCaptured(captured, () -> {
    // 你的业务逻辑,这里你可以获取到外面设置的TTL值
    String value = context.get();
    System.out.println("Hello: " + value);
    ...
    return "World: " + value;
}); // (2) + (3)
```

- 更多`TTL`传递的说明,详见[`TransmittableThreadLocal.Transmitter`的`JavaDoc`](../ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java)。
- 更多`TTL`传递的代码实现,参见[`TtlRunnable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java)、[`TtlCallable.java`](../ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java)。

# 📟 关于`Java Agent`

## `Java Agent`方式对应用代码无侵入

[User Guide - 2.3 使用`Java Agent`来修饰`JDK`线程池实现类](../README.md#23-%E4%BD%BF%E7%94%A8java-agent%E6%9D%A5%E4%BF%AE%E9%A5%B0jdk%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%AE%9E%E7%8E%B0%E7%B1%BB) 说到了,相对修饰`Runnable`或是线程池的方式,`Java Agent`方式是对应用代码无侵入的。下面做一些展开说明。

<img src="scenario-framework-sdk-arch.png" alt="构架图" width="260" />

按框架图,把前面示例代码操作可以分成下面几部分:

1. 读取信息设置到`TTL`。  
    这部分在容器中完成,无需应用参与。
2. 提交`Runnable`到线程池。要有修饰操作`Runnable`(无论是直接修饰`Runnable`还是修饰线程池)。  
    这部分操作一定是在用户应用中触发。
3. 读取`TTL`,做业务检查。  
    在`SDK`中完成,无需应用参与。

只有第2部分的操作和应用代码相关。

如果不通过`Java Agent`修饰线程池,则修饰操作需要应用代码来完成。

使用`Java Agent`方式,应用无需修改代码,即做到 相对应用代码 透明地完成跨线程池的上下文传递。

更多关于应用场景的了解说明参见文档[需求场景](requirement-scenario.md)。

## 已有`Java Agent`中嵌入`TTL Agent`

这样可以减少`Java`启动命令行上的`Agent`的配置。

在自己的`Agent`中加上`TTL Agent`的逻辑,示例代码如下([`YourXxxAgent.java`](../ttl2-compatible/src/test/java/com/alibaba/demo/ttl/agent/YourXxxAgent.java)):

```java
import com.alibaba.ttl.threadpool.agent.TtlAgent;
import com.alibaba.ttl.threadpool.agent.TtlTransformer;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;
import java.util.logging.Logger;

public final class YourXxxAgent {
    private static final Logger logger = Logger.getLogger(YourXxxAgent.class.getName());

    public static void premain(String agentArgs, Instrumentation inst) {
        TtlAgent.premain(agentArgs, inst); // add TTL Transformer

        // add your Transformer
        ...
    }
}
```

关于`Java Agent`和`ClassFileTransformer`的如何实现可以参考:[`TtlAgent.java`](../ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java)、[`TtlTransformer.java`](../ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlTransformer.java)。

注意,在`bootclasspath`上,还是要加上`TTL Jar`:

```bash
-Xbootclasspath/a:/path/to/transmittable-thread-local-2.x.y.jar:/path/to/your/agent/jar/files
```

# 👢 `Bootstrap ClassPath`上添加通用库`Jar`的问题及其解决方法

`TTL Agent`的使用方式,需要将`TTL Jar`加到`Bootstrap ClassPath`上(通过`Java`命令行参数`-Xbootclasspath`);这样`TTL`的类与`JDK`的标准库的类(如`java.lang.String`)的`ClassLoader`是一样的,都在`Bootstrap ClassPath`上。

`Bootstrap ClassPath`上的类会优先于应用`ClassPath`的`Jar`被加载,并且加载`ClassLoader`不能被改。  
\# 当然技术上严格地说,通过`Bootstrap ClassPath`上的类(如标准库的类)是可以改`ClassLoader`的,但这样做一般只会带来各种麻烦的问题。关于`ClassLoader`及其使用注意的介绍说明 可以参见[ClassLoader委托关系的完备配置](https://github.com/oldratlee/land#1-classloader%E5%A7%94%E6%89%98%E5%85%B3%E7%B3%BB%E7%9A%84%E5%AE%8C%E5%A4%87%E9%85%8D%E7%BD%AE)。

`TTL Agent`自己内部实现使用了`Javassist`,即在`Bootstrap ClassPath`上也需要添加`Javassist`。如果应用中也使用了`Javassist`,由于运行时会优先使用`TTL Agent`配置`Bootstrap ClassPath`上的`Javassist`,应用逻辑运行时实际不能选择/指定应用自己的`Javassist`的版本,带来了 应用需要的`Javassist`与`TTL Agent`用的`Javassist`之间的兼容性风险。

可以通过 `repackage`依赖(即 重命名/改写 依赖类的包名)来解决这个问题。`Maven`提供了[`Shade`插件](https://maven.apache.org/plugins/maven-shade-plugin/),可以完成下面的操作:

- `repackage` `Javassist`的类文件
- 添加`repackage`过的`Javassist`到`TTL Jar`中

这样操作后,`TTL Agent`不需要依赖外部的`Javassist`依赖,效果上这样的`shade`过的`TTL Jar`是自包含的、在使用上是编译/运行时0依赖的,自然也规避了依赖冲突的问题。

# 🔨 如何编译构建

编译构建的环境要求: **_`JDK 8+`_**;用`Maven`常规的方式执行编译构建即可:  
\# 在工程中已经包含了符合版本要求的`Maven`,直接运行 **_工程根目录下的`mvnw`_**;并不需要先手动自己安装好`Maven`。

```bash
# 运行测试Case
./mvnw test
# 编译打包
./mvnw package
# 运行测试Case、编译打包、安装TTL库到Maven本地
./mvnw install

#####################################################
# 如果使用你自己安装的 maven,版本要求:maven 3.3.9+
mvn install
```

# 发布操作列表

详见独立文档 [发布操作列表](release-action-list.md)。

# 📚 相关资料

## `JDK` core classes

- [WeakHashMap](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/WeakHashMap.html)
- [InheritableThreadLocal](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)

## `Java Agent`

- 官方文档
    - [`Java Agent`规范 - `JavaDoc`](https://docs.oracle.com/en/java/javase/21/docs/api/java.instrument/java/lang/instrument/package-summary.html#package.description)
    - [JAR File Specification - JAR Manifest](https://docs.oracle.com/en/java/javase/21/docs/specs/jar/jar.html#jar-manifest)
    - [Working with Manifest Files - The Java™ Tutorials](https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html)
- [Java SE 6 新特性: Instrumentation 新功能](https://www.ibm.com/developerworks/cn/java/j-lo-jse61/)
- [Creation, dynamic loading and instrumentation with javaagents](https://dhruba.name/2010/02/07/creation-dynamic-loading-and-instrumentation-with-javaagents/)
- [JavaAgent加载机制分析](https://www.iteye.com/blog/nijiaben-1847212/)

## `Javassist`

- [Getting Started with Javassist](https://www.javassist.org/tutorial/tutorial.html)

## `Maven Shade`插件

- [`Maven Shade`插件文档](https://maven.apache.org/plugins/maven-shade-plugin/)


================================================
FILE: docs/logo.md
================================================


================================================
FILE: docs/performance-test.md
================================================
# ☔️ 性能测试

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [👻 内存泄漏](#-%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F)
    - [验证结果](#%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C)
    - [执行方式](#%E6%89%A7%E8%A1%8C%E6%96%B9%E5%BC%8F)
- [🐎 TPS & 压力测试](#-tps--%E5%8E%8B%E5%8A%9B%E6%B5%8B%E8%AF%95)
    - [验证结果](#%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C-1)
        - [TPS略有下降的原因分析](#tps%E7%95%A5%E6%9C%89%E4%B8%8B%E9%99%8D%E7%9A%84%E5%8E%9F%E5%9B%A0%E5%88%86%E6%9E%90)
        - [FGC次数增多的原因分析](#fgc%E6%AC%A1%E6%95%B0%E5%A2%9E%E5%A4%9A%E7%9A%84%E5%8E%9F%E5%9B%A0%E5%88%86%E6%9E%90)
    - [执行方式](#%E6%89%A7%E8%A1%8C%E6%96%B9%E5%BC%8F-1)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 👻 内存泄漏

对比测试[`TransmittableThreadLocal`](../ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java)和[`ThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ThreadLocal.html),测试Case是:

简单一个线程一直循环`new` `TransmittableThreadLocal`、`ThreadLocal`实例,不主动做任何清理操作,即不调用`ThreadLocal`的`remove`方法主动清空。

### 验证结果

都可以持续运行,不会出内存溢出`OutOfMemoryError`。

### 执行方式

可以通过执行工程下的脚本来运行Case验证:

* 脚本[`memoryleak-ThreadLocal.sh`](../scripts/perf-test/memoryleak-ThreadLocal.sh)运行`ThreadLocal`的测试。  
测试类是[`NoMemoryLeak_ThreadLocal_NoRemove`](../ttl-core/src/test/java/com/alibaba/perf/memoryleak/NoMemoryLeak_ThreadLocal_NoRemove.kt)。
* 脚本[`memoryleak-TransmittableThreadLocal.sh`](../scripts/perf-test/memoryleak-TransmittableThreadLocal.sh)运行`TransmittableThreadLocal`的测试。
测试类是[`NoMemoryLeak_TransmittableThreadLocal_NoRemove`](../ttl-core/src/test/java/com/alibaba/perf/memoryleak/NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt)。

## 🐎 TPS & 压力测试

对比测试[`TransmittableThreadLocal`](../ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java)和[`ThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ThreadLocal.html),测试Case是:

2个线程并发一直循环`new` `TransmittableThreadLocal`、`ThreadLocal`实例,不主动做任何清理操作,即不调用`ThreadLocal`的`remove`方法主动清空。

### 验证结果

在我的4核开发机上运行了24小时,稳定正常。

TPS结果如下:

`ThreadLocal`的TPS稳定在~41K:

```bash
......
tps: 42470
tps: 40940
tps: 41041
tps: 40408
tps: 40610
```

`TransmittableThreadLocal`的TPS稳定在~40K:

```bash
......
tps: 40461 
tps: 40101 
tps: 39989 
tps: 40684 
tps: 41174 
```

GC情况如下(1分钟输出一次):

`ThreadLocal`的每分钟GC时间是`5.45s`,FGC次数是`0.09`:

```bash
   S0     S1      E      O      P    YGC      YGCT     FGC     FGCT   GCT
......
  0.00  97.66   0.00   8.33  12.70 1470935 2636.215    41    0.229 2636.444
 97.66   0.00   0.00  17.18  12.70 1473968 2640.597    41    0.229 2640.825
 98.44   0.00   0.00  25.47  12.70 1477020 2645.265    41    0.229 2645.493
 96.88   0.00  33.04  34.03  12.70 1480068 2650.149    41    0.229 2650.378
  0.00  97.66  14.01  41.82  12.70 1483113 2655.262    41    0.229 2655.490
  0.00  97.66  74.07  50.25  12.70 1486149 2660.596    41    0.229 2660.825
 96.88   0.00   0.00  58.32  12.70 1489170 2666.135    41    0.229 2666.364
 98.44   0.00  26.07  67.05  12.70 1492162 2671.841    41    0.229 2672.070
  0.00  97.66   0.00  76.50  12.70 1495139 2677.809    41    0.229 2678.038
  0.00  97.66   0.00  85.95  12.70 1498091 2683.994    41    0.229 2684.222
 96.88   0.00   0.00  96.50  12.70 1501038 2690.454    41    0.229 2690.683
 97.66   0.00   0.00   7.96  12.70 1504054 2695.583    42    0.233 2695.816
  0.00  97.66   0.00  17.46  12.70 1507099 2700.009    42    0.233 2700.241
  0.00  97.66   0.00  26.97  12.70 1510133 2704.652    42    0.233 2704.885
 97.66   0.00   0.00  36.57  12.70 1513158 2709.592    42    0.233 2709.825
  0.00  97.66   0.00  45.59  12.70 1516167 2714.738    42    0.233 2714.971
 98.44   0.00   0.00  54.49  12.70 1519166 2720.109    42    0.233 2720.342
  0.00  98.44   0.00  63.52  12.70 1522141 2725.688    42    0.233 2725.921
  0.00  97.66  84.18  72.00  12.70 1525139 2731.579    42    0.233 2731.812
  0.00  98.44  20.04  80.10  12.70 1528121 2737.680    42    0.233 2737.913
  0.00  97.66  28.06  87.70  12.70 1531093 2743.991    42    0.233 2744.224
  0.00  98.44   0.00  95.63  12.70 1534055 2750.508    42    0.233 2750.741
 97.66   0.00   0.00   4.75  12.70 1537062 2756.196    43    0.239 2756.435
```

`TransmittableThreadLocal`的每分钟GC时间是`5.29s`,FGC次数是`3.27`:

```bash
   S0     S1      E      O      P    YGC      YGCT     FGC     FGCT   GCT
......
  0.00  98.44   8.01  57.38  12.80 1390879 2571.496  1572    9.820 2581.315
  0.00  97.66   0.00  78.87  12.80 1393725 2576.784  1575    9.839 2586.623
 98.44   0.00  14.04   5.83  12.80 1396559 2582.082  1579    9.866 2591.948
 98.44   0.00   0.00  26.41  12.80 1399394 2587.274  1582    9.885 2597.159
 98.44  98.44   0.00  50.75  12.80 1402230 2592.506  1585    9.904 2602.410
 98.44   0.00   0.00  84.37  12.80 1405077 2597.808  1588    9.925 2607.733
  0.00  98.44   0.00   5.19  12.80 1407926 2603.108  1592    9.952 2613.059
  0.00  98.44  58.17  29.80  12.80 1410770 2608.314  1595    9.973 2618.287
 99.22   0.00   0.00  54.14  12.80 1413606 2613.582  1598    9.992 2623.574
 98.44   0.00   0.00  78.18  12.80 1416444 2618.881  1601   10.012 2628.893
  0.00  97.66   0.00   7.36  12.80 1419275 2624.167  1605   10.038 2634.205
  0.00  99.22   0.00  31.04  12.80 1422125 2629.391  1608   10.057 2639.448
  0.00  98.44   0.00  60.41  12.80 1424974 2634.636  1611   10.077 2644.714
  0.00  98.44   0.00  84.72  12.80 1427825 2639.929  1614   10.094 2650.024
  0.00  97.66   0.00  12.32  12.80 1430679 2645.204  1618   10.119 2655.323
  0.00  98.44  12.05  39.31  12.80 1433539 2650.442  1621   10.141 2660.583
 86.81   0.00   0.00  67.40  12.80 1436392 2655.743  1624   10.156 2665.899
 99.22   0.00   0.00  95.25  12.80 1439244 2661.071  1627   10.175 2671.246
 98.44   0.00   0.00  24.63  12.80 1442090 2666.305  1631   10.201 2676.506
  0.00  99.22   0.00  52.86  12.80 1444945 2671.546  1634   10.222 2681.769
 98.44   0.00   0.00  80.38  12.80 1447802 2676.850  1637   10.241 2687.091
  0.00  87.50   0.00   4.22  12.80 1450658 2682.196  1641   10.268 2692.464
 99.22   0.00   0.00  33.22  12.80 1453507 2687.386  1644   10.290 2697.676
```

#### TPS略有下降的原因分析

使用`jvisualvm` Profile方法耗时,`TransmittableThreadLocal`Case的热点方法和`ThreadLocal`Case一样。

略有下降可以认为是Full GC更多引起。

实际使用场景中,`TransmittableThreadLocal`实例个数非常有限,不会有性能问题。

#### FGC次数增多的原因分析

在`TransmittableThreadLocal.holder`中,持有`TransmittableThreadLocal`实例的弱引用,减慢实例的回收,导致Full GC增加。

实际使用场景中,`TransmittableThreadLocal`实例个数非常有限,不会有性能问题。

### 执行方式

可以通过执行工程下的脚本来运行Case验证:

* 脚本[`tps-ThreadLocal.sh`](../scripts/perf-test/tps-ThreadLocal.sh)运行`ThreadLocal`的测试。  
测试类是[`CreateThreadLocalInstanceTps`](../ttl-core/src/test/java/com/alibaba/perf/tps/CreateThreadLocalInstanceTps.kt)。
* [`tps-TransmittableThreadLocal.sh`](../scripts/perf-test/tps-TransmittableThreadLocal.sh)运行`TransmittableThreadLocal`的测试。
测试类是[`CreateTransmittableThreadLocalInstanceTps`](../ttl-core/src/test/java/com/alibaba/perf/tps/CreateTransmittableThreadLocalInstanceTps.kt)。


================================================
FILE: docs/release-action-list.md
================================================
发布操作列表
===============================

1. 准备发布分支
    1. 如`POM`中有降开发版本,注意 修改 新加`API`的 **_`@since`_** !!
    2. 从`master`分支新建发布分支
    3. 在发布分支上,更新版本号及相关信息
        - 更新`POM`的版本号成要发布的版本号,去掉`SNAPSHOT`
        - 更新`README`
            - 更新badge的引用,由master分支名改成Tag名  
                - `sed 's/master/v2.x.y/g' -i README*`
                - `javadoc` badge的JavaDoc链接到固定版本  
                    https://alibaba.github.io/transmittable-thread-local/apidocs/2.x.y/index.html
            - 示例`Maven`依赖的版本
            - 更新`JavaDoc`链接到固定版本
2. 新建并Push Tag,如`v2.x.y`  
    - `git tag -m 'release v2.x.y' v2.x.y`
    - `git push origin v2.x.y`
3. 等待Tag的CI通过 https://github.com/alibaba/transmittable-thread-local/actions
4. 执行[`scripts/check-japi-compliance.sh`](../scripts/check-japi-compliance.sh),检查`API`兼容性
5. 发布版本到`Maven`中央库  
    `./mvnw clean && ./mvnw deploy -DperformRelease`
6. 更新`JavaDoc`
    1. 生成`JavaDoc`,更新到分支`gh-pages`
        - `git checkout gh-pages`
        - `mv target/apidocs apidocs/2.x.y`
    2. 修改`index.html`<https://alibaba.github.io/transmittable-thread-local/apidocs>的重定向到最新版本的`JavaDoc`
7. 编写Release Note: <https://github.com/alibaba/transmittable-thread-local/releases>
8. 升级`Master`分支的开发版本号
    - 更新 `README`中的示例`Maven`依赖版本


================================================
FILE: docs/requirement-scenario.md
================================================
# 🎨 需求场景

在`ThreadLocal`的需求场景即是`TTL`的潜在需求场景,如果你的业务需要『在使用线程池等会池化复用线程的组件情况下传递`ThreadLocal`』则是`TTL`目标场景。

下面是几个典型场景例子。

-------------------------------

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [🔎 1. 分布式跟踪系统](#-1-%E5%88%86%E5%B8%83%E5%BC%8F%E8%B7%9F%E8%B8%AA%E7%B3%BB%E7%BB%9F)
- [🌵 2. 日志收集记录系统上下文](#-2-%E6%97%A5%E5%BF%97%E6%94%B6%E9%9B%86%E8%AE%B0%E5%BD%95%E7%B3%BB%E7%BB%9F%E4%B8%8A%E4%B8%8B%E6%96%87)
    - [`Log4j2 MDC`的`TTL`集成](#log4j2-mdc%E7%9A%84ttl%E9%9B%86%E6%88%90)
    - [`Logback MDC`的`TTL`集成](#logback-mdc%E7%9A%84ttl%E9%9B%86%E6%88%90)
- [👜 3. `Request`级`Cache`](#-3-request%E7%BA%A7cache)
- [🛁 4. 应用容器或上层框架跨应用代码给下层`SDK`传递信息](#-4-%E5%BA%94%E7%94%A8%E5%AE%B9%E5%99%A8%E6%88%96%E4%B8%8A%E5%B1%82%E6%A1%86%E6%9E%B6%E8%B7%A8%E5%BA%94%E7%94%A8%E4%BB%A3%E7%A0%81%E7%BB%99%E4%B8%8B%E5%B1%82sdk%E4%BC%A0%E9%80%92%E4%BF%A1%E6%81%AF)
    - [上面场景使用`TTL`的整体构架](#%E4%B8%8A%E9%9D%A2%E5%9C%BA%E6%99%AF%E4%BD%BF%E7%94%A8ttl%E7%9A%84%E6%95%B4%E4%BD%93%E6%9E%84%E6%9E%B6)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

-------------------------------

## 🔎 1. 分布式跟踪系统 或 全链路压测(即链路打标)

关于『分布式跟踪系统』可以了解一下`Google`的`Dapper`(介绍的论文:[中文](https://bigbully.github.io/Dapper-translation/)| [英文](https://research.google.com/pubs/pub36356.html))。分布式跟踪系统作为基础设施,不会限制『使用线程池等会池化复用线程的组件』,并期望对业务逻辑尽可能的透明。

分布式跟踪系统的实现的示意Demo参见[`DistributedTracerUseDemo.kt`](../ttl2-compatible/src/test/java/com/alibaba/demo/distributed_tracer/refcount/DistributedTracerUseDemo.kt)

从技术能力上讲,全链路压测 与 分布式跟踪系统 是一样的,即链路打标。

PS: 多谢 [@wyzssw](https://github.com/https://github.com/wyzssw) 对分布式追踪系统场景说明交流和实现上讨论建议:

- [Issue: 分布式追踪系统场景下,如何使用TTL](https://github.com/alibaba/transmittable-thread-local/issues/53)

## 🌵 2. 日志收集记录系统上下文

由于不限制用户应用使用线程池,系统的上下文需要能跨线程的传递,且不影响应用代码。

### `Log4j2 MDC`的`TTL`集成

`Log4j2`通过[`Thread Context`](https://logging.apache.org/log4j/2.x/manual/thread-context.html)提供了`Mapped Diagnostic Context`(`MDC`,诊断上下文)的功能,通过[`ThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ThreadLocal.html)/[`InheritableThreadLocal`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/InheritableThreadLocal.html)实现上下文传递。

在[`Thread Context文档`](https://logging.apache.org/log4j/2.x/manual/thread-context.html)中提到了在使用线程池等会池化复用线程的组件(如`Executors`)时有问题,需要提供一个机制方案:

> The Stack and the Map are managed per thread and are based on ThreadLocal by default. The Map can be configured to use an InheritableThreadLocal by setting system property isThreadContextMapInheritable to "true". When configured this way, the contents of the Map will be passed to child threads. However, as discussed in the [Executors](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/Executors.html#privilegedThreadFactory%28%29) class and in other cases where thread pooling is utilized, the ThreadContext may not always be automatically passed to worker threads. In those cases the pooling mechanism should provide a means for doing so. The getContext() and cloneStack() methods can be used to obtain copies of the Map and Stack respectively.

即是`TTL`要解决的问题,提供`Log4j2 MDC`的`TTL`集成,详见工程[`log4j2-ttl-thread-context-map`](https://github.com/oldratlee/log4j2-ttl-thread-context-map)。对应依赖:

```xml
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>log4j2-ttl-thread-context-map</artifactId>
    <version>1.3.0</version>
</dependency>
```

可以在 [maven.org](https://repo1.maven.org/maven2/com/alibaba/log4j2-ttl-thread-context-map/maven-metadata.xml) 查看可用的版本。

PS: 多谢 @bwzhang2011 和 @wuwen5 对日志场景说明交流和实现上讨论建议:

- [Issue: 能否提供与LOG4J(2)中的MDC集成或增强](https://github.com/alibaba/transmittable-thread-local/issues/49)  [@bwzhang2011](https://github.com/bwzhang2011)
- [Issue: slf4j MDCAdapter with multi-thread-context 支持](https://github.com/alibaba/transmittable-thread-local/issues/51)  [@bwzhang2011](https://github.com/bwzhang2011)

### `Logback MDC`的`TTL`集成

`Logback`的集成参见[@ofpay](https://github.com/ofpay)提供的[`logback-mdc-ttl`](https://github.com/ofpay/logback-mdc-ttl)。对应依赖:

```xml
<dependency>
    <groupId>com.ofpay</groupId>
    <artifactId>logback-mdc-ttl</artifactId>
    <version>1.0.2</version>
</dependency>
```

可以在 [maven.org](https://repo1.maven.org/maven2/com/ofpay/logback-mdc-ttl/maven-metadata.xml) 查看可用的版本。

这个集成已经在 **_线上产品环境_** 使用的。说明详见[欧飞网的使用场景](https://github.com/alibaba/transmittable-thread-local/issues/73#issuecomment-300665308)。

## 👜 3. `Request`级`Cache`

对于计算逻辑复杂业务流程,基础数据读取服务(这样的读取服务往往是个外部远程服务)可能需要多次调用,期望能缓存起来,以避免多次重复执行高成本操作。

同时,在入口发起不同的请求,处理的是不同用户的数据,所以不同发起请求之间不需要共享数据,这样也能避免请求对应的不同用户之间可能的数据污染。

因为涉及多个上下游线程,其实是`Session`级缓存。

通过`Request`级缓存可以

- 避免重复执行高成本操作,提升性能。
- 避免不同`Request`之间的数据污染。

更多讨论与使用方式参见[**_`@olove`_**](https://github.com/olove) 提的Issue:[讨论:Session级Cache场景下,TransmittableThreadLocal的使用](https://github.com/alibaba/transmittable-thread-local/issues/122)。

## 🛁 4. 应用容器或上层框架跨应用代码给下层`SDK`传递信息

举个具体的业务场景,在`App Engine`(`PAAS`)上会运行由应用提供商提供的应用(`SAAS`模式)。多个`SAAS`用户购买并使用这个应用(即`SAAS`应用)。`SAAS`应用往往是一个实例为多个`SAAS`用户提供服务。  
\# 另一种模式是:`SAAS`用户使用完全独立一个`SAAS`应用,包含独立应用实例及其后的数据源(如`DB`、缓存,etc)。

需要避免的`SAAS`应用拿到多个`SAAS`用户的数据。一个解决方法是处理过程关联好一个`SAAS`用户的上下文,在上下文中应用只能处理(读/写)这个`SAAS`用户的数据。请求由`SAAS`用户发起(如从`Web`请求进入`App Engine`),`App Engine`可以知道是从哪个`SAAS`用户,在`Web`请求时在上下文中设置好`SAAS`用户`ID`。应用处理数据(`DB`、`Web`、消息 etc.)是通过`App Engine`提供的服务`SDK`来完成。当应用处理数据时,`SDK`检查数据所属的`SAAS`用户是否和上下文中的`SAAS`用户`ID`一致,如果不一致则拒绝数据的读写。

应用代码会使用线程池,并且这样的使用是正常的业务需求。`SAAS`用户`ID`的从要`App Engine`传递到下层`SDK`,要支持这样的用法。

### 上面场景使用`TTL`的整体构架

<img src="scenario-framework-sdk-arch.png" alt="构架图" width="260" />

构架涉及3个角色:容器、用户应用、`SDK`。

整体流程:

1. 请求进入`PAAS`容器,提取上下文信息并设置好上下文。
2. 进入用户应用处理业务,业务调用`SDK`(如`DB`、消息、etc)。  
    用户应用会使用线程池,所以调用`SDK`的线程可能不是请求的线程。
3. 进入`SDK`处理。  
    提取上下文的信息,决定是否符合拒绝处理。

整个过程中,上下文的传递 对于 **用户应用代码** 期望是透明的。


================================================
FILE: mvnw
================================================
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
#   JAVA_HOME - location of a JDK home dir, required when download maven via java source
#   MVNW_REPOURL - repo url base for downloading maven distribution
#   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
#   MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------

set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x

# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
  [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
  native_path() { cygpath --path --windows "$1"; }
  ;;
esac

# set JAVACMD and JAVACCMD
set_java_home() {
  # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
  if [ -n "${JAVA_HOME-}" ]; then
    if [ -x "$JAVA_HOME/jre/sh/java" ]; then
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
      JAVACCMD="$JAVA_HOME/jre/sh/javac"
    else
      JAVACMD="$JAVA_HOME/bin/java"
      JAVACCMD="$JAVA_HOME/bin/javac"

      if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
        echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
        echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
        return 1
      fi
    fi
  else
    JAVACMD="$(
      'set' +e
      'unset' -f command 2>/dev/null
      'command' -v java
    )" || :
    JAVACCMD="$(
      'set' +e
      'unset' -f command 2>/dev/null
      'command' -v javac
    )" || :

    if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
      echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
      return 1
    fi
  fi
}

# hash string like Java String::hashCode
hash_string() {
  str="${1:-}" h=0
  while [ -n "$str" ]; do
    char="${str%"${str#?}"}"
    h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
    str="${str#?}"
  done
  printf %x\\n $h
}

verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }

die() {
  printf %s\\n "$1" >&2
  exit 1
}

trim() {
  # MWRAPPER-139:
  #   Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
  #   Needed for removing poorly interpreted newline sequences when running in more
  #   exotic environments such as mingw bash on Windows.
  printf "%s" "${1}" | tr -d '[:space:]'
}

# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
  case "${key-}" in
  distributionUrl) distributionUrl=$(trim "${value-}") ;;
  distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
  esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"

case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
  MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
  case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
  *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
  :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
  :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
  :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
  *)
    echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
    distributionPlatform=linux-amd64
    ;;
  esac
  distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
  ;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac

# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"

exec_maven() {
  unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
  exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}

if [ -d "$MAVEN_HOME" ]; then
  verbose "found existing MAVEN_HOME at $MAVEN_HOME"
  exec_maven "$@"
fi

case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac

# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
  clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
  trap clean HUP INT TERM EXIT
else
  die "cannot create temp dir"
fi

mkdir -p -- "${MAVEN_HOME%/*}"

# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"

# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
  distributionUrl="${distributionUrl%.zip}.tar.gz"
  distributionUrlName="${distributionUrl##*/}"
fi

# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v

# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac

if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
  verbose "Found wget ... using wget"
  wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
  verbose "Found curl ... using curl"
  curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
  verbose "Falling back to use Java to download"
  javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
  targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
  cat >"$javaSource" <<-END
	public class Downloader extends java.net.Authenticator
	{
	  protected java.net.PasswordAuthentication getPasswordAuthentication()
	  {
	    return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
	  }
	  public static void main( String[] args ) throws Exception
	  {
	    setDefault( new Downloader() );
	    java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
	  }
	}
	END
  # For Cygwin/MinGW, switch paths to Windows format before running javac and java
  verbose " - Compiling Downloader.java ..."
  "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
  verbose " - Running Downloader.java ..."
  "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi

# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
  distributionSha256Result=false
  if [ "$MVN_CMD" = mvnd.sh ]; then
    echo "Checksum validation is not supported for maven-mvnd." >&2
    echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
    exit 1
  elif command -v sha256sum >/dev/null; then
    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
      distributionSha256Result=true
    fi
  elif command -v shasum >/dev/null; then
    if echo "$distributionSha256Sum  $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
      distributionSha256Result=true
    fi
  else
    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
    echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
    exit 1
  fi
  if [ $distributionSha256Result = false ]; then
    echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
    echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
    exit 1
  fi
fi

# unzip and move
if command -v unzip >/dev/null; then
  unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
  tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"

clean || :
exec_maven "$@"


================================================
FILE: mvnw.cmd
================================================
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements.  See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership.  The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License.  You may obtain a copy of the License at
@REM
@REM    http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied.  See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------

@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM   MVNW_REPOURL - repo url base for downloading maven distribution
@REM   MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM   MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------

@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
  IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>

$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
  $VerbosePreference = "Continue"
}

# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
  Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}

switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
  "maven-mvnd-*" {
    $USE_MVND = $true
    $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
    $MVN_CMD = "mvnd.cmd"
    break
  }
  default {
    $USE_MVND = $false
    $MVN_CMD = $script -replace '^mvnw','mvn'
    break
  }
}

# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
  $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
  $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
  $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"

if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
  Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
  Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
  exit $?
}

if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
  Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}

# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
  if ($TMP_DOWNLOAD_DIR.Exists) {
    try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
    catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
  }
}

New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null

# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"

$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
  $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null

# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
  if ($USE_MVND) {
    Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
  }
  Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
  if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
    Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
  }
}

# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
  Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
  if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
    Write-Error "fail to move MAVEN_HOME"
  }
} finally {
  try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
  catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}

Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"


================================================
FILE: pom.xml
================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.alibaba.ttl3</groupId>
	<artifactId>ttl3-parent</artifactId>
	<version>3.x-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>${project.artifactId}</name>
	<description>
		📌 The missing Java™ std lib(simple &amp; 0-dependency) for framework/middleware, provide an enhanced
		InheritableThreadLocal that transmits values between threads even using thread pooling components.
	</description>
	<url>https://github.com/alibaba/transmittable-thread-local</url>
	<inceptionYear>2013</inceptionYear>

	<licenses>
		<license>
			<name>Apache 2</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
			<comments>A business-friendly OSS license</comments>
		</license>
	</licenses>
	<scm>
		<connection>scm:git:git@github.com:alibaba/transmittable-thread-local.git</connection>
		<developerConnection>scm:git:git@github.com:alibaba/transmittable-thread-local.git</developerConnection>
		<url>https://github.com/alibaba/transmittable-thread-local</url>
	</scm>
	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/alibaba/transmittable-thread-local/issues</url>
	</issueManagement>
	<ciManagement>
		<system>GitHub Actions</system>
		<url>https://github.com/alibaba/transmittable-thread-local/actions</url>
	</ciManagement>
	<organization>
		<name>Alibaba</name>
		<url>https://www.alibaba.com</url>
	</organization>
	<developers>
		<developer>
			<name>Jerry Lee</name>
			<id>oldratlee</id>
			<email>oldratlee(AT)gmail(DOT)com</email>
			<roles>
				<role>Developer</role>
			</roles>
			<timezone>+8</timezone>
			<url>https://github.com/oldratlee</url>
			<organization>Alibaba</organization>
			<organizationUrl>https://www.alibaba.com</organizationUrl>
		</developer>
	</developers>

	<modules>
		<module>ttl-core</module>
		<module>ttl-agent</module>

		<module>ttl-kotlin</module>
		<module>ttl2-compatible</module>

		<module>ttl-bom</module>

		<module>ttl-integrations/vertx4-ttl-integration</module>
		<module>ttl-integrations/vertx3-ttl-integration</module>

		<module>ttl-integrations/sample-ttl-agent-extension-transformlet</module>
	</modules>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- overridden by submodule that need skip deploy -->
		<maven.deploy.skip>false</maven.deploy.skip>
		<javadoc.ttl.base.link>
			https://alibaba.github.io/transmittable-thread-local/apidocs/${project.version}
		</javadoc.ttl.base.link>

		<spotbugs.annotations.version>4.8.6</spotbugs.annotations.version>
		<jsr305.version>3.0.2</jsr305.version>
		<jetbrains.annotations.version>24.1.0</jetbrains.annotations.version>

		<kotlin.version>1.9.25</kotlin.version>
		<kotlin.compiler.jvmTarget>${maven.compiler.source}</kotlin.compiler.jvmTarget>
		<kotlin.coroutine.version>1.9.0</kotlin.coroutine.version>
		<!-- https://kotlin.github.io/dokka/1.7.10/user_guide/maven/usage/ -->
		<dokka.version>1.9.20</dokka.version>
		<dokka.link.jdk.version>8</dokka.link.jdk.version>

		<slf4j.version>2.0.7</slf4j.version>

		<!-- testing dependencies versions -->
		<junit5.version>5.11.4</junit5.version>
		<kotest.version>5.9.1</kotest.version>

		<!--
			slf4j simple logger configuration for test

			the system properties are supported to configure the behavior of slf4j simple logger
			https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html
		-->
		<ttl.test.logger.level>warn</ttl.test.logger.level> <!-- overridden by maven -D options -->
		<argLine.slf4j.simple.logger.default.d.options>
			-Dorg.slf4j.simpleLogger.logFile=System.err
			-Dorg.slf4j.simpleLogger.defaultLogLevel=${ttl.test.logger.level}
		</argLine.slf4j.simple.logger.default.d.options>
		<argLine.slf4j.simple.logger.extra.d.options/> <!-- overridden by maven -D options -->
		<argLine.slf4j.simple.logger.d.options>
			${argLine.slf4j.simple.logger.default.d.options} ${argLine.slf4j.simple.logger.extra.d.options}
		</argLine.slf4j.simple.logger.d.options>

		<argLine>${argLine.slf4j.simple.logger.d.options}</argLine> <!-- overridden by profile -->
	</properties>

	<dependencies>
		<!-- QA libs -->
		<dependency>
			<groupId>com.github.spotbugs</groupId>
			<artifactId>spotbugs-annotations</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.jetbrains</groupId>
			<artifactId>annotations</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- logging libs -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.github.microutils</groupId>
			<artifactId>kotlin-logging-jvm</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- testing libs -->
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-runner-junit4-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-runner-junit5-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-assertions-core-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.kotest</groupId>
			<artifactId>kotest-property-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.mockk</groupId>
			<artifactId>mockk-jvm</artifactId>
			<scope>test</scope>
		</dependency>
		<!--
			Executing JUnit 4 and JUnit 5 tests in a same build
				https://stackoverflow.com/a/47158584/922688
		-->
		<dependency>
			<!-- JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API -->
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<!-- JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API  -->
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<!-- bom -->
			<dependency>
				<!-- https://github.com/raphw/byte-buddy/issues/1264 -->
				<groupId>net.bytebuddy</groupId>
				<artifactId>byte-buddy-parent</artifactId>
				<version>1.15.11</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-bom</artifactId>
				<version>${kotlin.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.jetbrains.kotlinx</groupId>
				<artifactId>kotlinx-coroutines-bom</artifactId>
				<version>${kotlin.coroutine.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${junit5.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!--
				QA libs
				make qa libs optional, 0-dependency and smaller deployment
			-->
			<dependency>
				<!--
					JSR305 is already Dormant status, so SpotBugs does not release jsr305 jar file.
					Please continue using findbugs’ one.
					depend on spotbugs-annotations instead.
					https://spotbugs.readthedocs.io/en/stable/migration.html
				-->
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-annotations</artifactId>
				<version>${spotbugs.annotations.version}</version>
				<optional>true</optional>
			</dependency>
			<dependency>
				<groupId>com.google.code.findbugs</groupId>
				<artifactId>jsr305</artifactId>
				<version>${jsr305.version}</version>
				<optional>true</optional>
			</dependency>
			<dependency>
				<!-- https://www.jetbrains.com/help/idea/annotating-source-code.html -->
				<groupId>org.jetbrains</groupId>
				<artifactId>annotations</artifactId>
				<version>${jetbrains.annotations.version}</version>
				<optional>true</optional>
			</dependency>

			<dependency>
				<groupId>org.javassist</groupId>
				<artifactId>javassist</artifactId>
				<version>3.30.2-GA</version>
				<optional>true</optional>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>3.12.0</version>
			</dependency>

			<dependency>
				<groupId>io.reactivex.rxjava2</groupId>
				<artifactId>rxjava</artifactId>
				<version>2.2.21</version>
			</dependency>
			<dependency>
				<groupId>io.reactivex.rxjava2</groupId>
				<artifactId>rxkotlin</artifactId>
				<version>2.4.0</version>
			</dependency>

			<!-- logging libs -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${slf4j.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.github.microutils</groupId>
				<artifactId>kotlin-logging-jvm</artifactId>
				<version>3.0.0</version>
			</dependency>

			<!--
				testing libs
			-->
			<!-- https://github.com/kotlintest/kotlintest -->
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-runner-junit4-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-runner-junit5-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-assertions-core-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.kotest</groupId>
				<artifactId>kotest-property-jvm</artifactId>
				<version>${kotest.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.mockk</groupId>
				<artifactId>mockk-jvm</artifactId>
				<version>1.14.5</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<build>
		<plugins>
			<plugin>
				<!--
					Compiling Kotlin and Java sources - Using Maven - Kotlin Programming Language
					https://kotlinlang.org/docs/reference/using-maven.html#compiling-kotlin-and-java-sources

					Making sure that the kotlin plugin is above the maven-compiler-plugin in your pom.xml file!
				-->
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/main/java</sourceDir>
							</sourceDirs>
						</configuration>
					</execution>
					<execution>
						<id>test-compile</id>
						<goals>
							<goal>test-compile</goal>
						</goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/test/java</sourceDir>
							</sourceDirs>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<!-- Replacing default-compile as it is treated specially by maven -->
					<execution>
						<id>default-compile</id>
						<phase>none</phase>
					</execution>
					<!-- Replacing default-testCompile as it is treated specially by maven -->
					<execution>
						<id>default-testCompile</id>
						<phase>none</phase>
					</execution>
					<execution>
						<id>java-compile</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>java-test-compile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>enforces</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<!-- official docs: https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html -->
								<requireMavenVersion>
									<version>3.3.9</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.4.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.jetbrains.kotlin</groupId>
					<artifactId>kotlin-maven-plugin</artifactId>
					<version>${kotlin.version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.14.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.5.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.4.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-shade-plugin</artifactId>
					<version>3.6.0</version>
					<configuration>
						<shadeSourcesContent>true</shadeSourcesContent>
						<dependencyReducedPomLocation>
							${project.build.directory}/dependency-reduced-pom.xml
						</dependencyReducedPomLocation>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.8.0</version>
				</plugin>
				<plugin>
					<groupId>org.jetbrains.dokka</groupId>
					<artifactId>dokka-maven-plugin</artifactId>
					<version>${dokka.version}</version>
					<executions>
						<execution>
							<phase>prepare-package</phase>
							<goals>
								<goal>javadocJar</goal>
								<goal>dokka</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<jdkVersion>${dokka.link.jdk.version}</jdkVersion>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.2.7</version>
				</plugin>
				<plugin>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.21.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.1.3</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.1.3</version>
				</plugin>
				<plugin>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.5.0</version>
				</plugin>
				<plugin>
					<groupId>io.github.git-commit-id</groupId>
					<artifactId>git-commit-id-maven-plugin</artifactId>
					<version>9.0.1</version>
				</plugin>
				<plugin>
					<groupId>com.github.spotbugs</groupId>
					<artifactId>spotbugs-maven-plugin</artifactId>
					<version>4.8.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.12</version>
				</plugin>
				<plugin>
					<!--
						https://www.mojohaus.org/exec-maven-plugin/
						https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html
					-->
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>3.4.1</version>
					<configuration>
						<executable>${java.home}/bin/java</executable>
						<classpathScope>test</classpathScope>
						<arguments>
							<argument>-Xmx1g</argument>
							<argument>-Xms256m</argument>
							<argument>-ea</argument>
							<argument>-server</argument>
							<argument>-Duser.language=en</argument>
							<argument>-Duser.country=US</argument>

							<argument>-classpath</argument>
							<classpath/>

							<argument>${exec.mainClass}</argument>
						</arguments>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.7.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>gen-src</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-api-doc</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<properties>
				<javadoc.default.exclude.packages>
					*.internal:*.internal.*:*.internal.*.*:*.internal.*.*.*:*.internal.*.*.*.*
				</javadoc.default.exclude.packages>
				<!--
					Apache Maven Javadoc Plugin – Configuring links and offlineLinks Parameters
					https://maven.apache.org/plugins/maven-javadoc-plugin/examples/links-configuration.html

					more infos about link setting:
					Links to JSR 305 in Javadoc are broken https://github.com/google/guava/issues/2479
					Fix links to javadoc.io for Maven Javadoc Plugin #2628 https://github.com/google/guava/pull/2628
					Can't link to JDK10 in Javadoc comments https://stackoverflow.com/questions/49457896

					About package-list vs.element-list
					- Can't link to JDK10 in Javadoc comments
						https://stackoverflow.com/a/49498219/922688
					- Missing javadoc/package-list for release 5.1
						https://github.com/gradle/gradle/issues/8183
						https://github.com/gradle/gradle/commit/5e88351dd456a5252d21f3a7ad25bff1b62a2fd2


					Using the linkoffline Option
					https://docs.oracle.com/en/java/javase/21/javadoc/javadoc-command.html#GUID-51213F2C-6E01-4A03-A82A-17428A258A0F
				-->
				<javadoc.package.list.dir>${maven.multiModuleProjectDirectory}/src/package-list</javadoc.package.list.dir>
				<!-- dummy/repeated value, overridden by submodule -->
				<javadoc.extra.offlineLinks>-quiet</javadoc.extra.offlineLinks>
			</properties>
			<build>
				<plugins>
					<plugin>
						<!--
							https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html
							https://docs.oracle.com/en/java/javase/21/javadoc/javadoc-command.html
						-->
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<source>8</source>
							<show>protected</show>
							<charset>UTF-8</charset>
							<encoding>UTF-8</encoding>
							<docencoding>UTF-8</docencoding>
							<quiet>true</quiet>
							<!--
								How to disable Javadoc warnings in Maven Javadoc Plugin? - Stack Overflow
								https://stackoverflow.com/questions/39616344
							-->
							<doclint>all,-missing</doclint>
							<overview>${project.basedir}/src/main/javadoc/overview.html</overview>
							<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html -->
							<excludePackageNames>${javadoc.default.exclude.packages}</excludePackageNames>
							<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#detectOfflineLinks -->
							<detectOfflineLinks>false</detectOfflineLinks>
							<additionalOptions>
								<!--
									Maven javadoc Search redirects to "/undefined/.." url - Stack Overflow
									https://stackoverflow.com/questions/52326318
								-->
								<additionalOption>-html5</additionalOption>

								<additionalOption>-linkoffline</additionalOption>
								<additionalOption>
									https://www.javadoc.io/doc/com.github.spotbugs/spotbugs-annotations/${spotbugs.annotations.version}/
								</additionalOption>
								<additionalOption>${javadoc.package.list.dir}/spotbugs-annotations/</additionalOption>
								<additionalOption>-linkoffline</additionalOption>
								<additionalOption>
									https://www.javadoc.io/doc/org.jetbrains/annotations/${jetbrains.annotations.version}/
								</additionalOption>
								<additionalOption>${javadoc.package.list.dir}/jetbrains-annotations/</additionalOption>
								<additionalOption>-linkoffline</additionalOption>
								<additionalOption>
									https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/${jsr305.version}/
								</additionalOption>
								<additionalOption>${javadoc.package.list.dir}/jsr305/</additionalOption>
								<additionalOption>-linkoffline</additionalOption>
								<additionalOption>https://docs.oracle.com/en/java/javase/21/docs/api/java.base/</additionalOption>
								<additionalOption>${javadoc.package.list.dir}/java/</additionalOption>

								<additionalOption>${javadoc.extra.offlineLinks}</additionalOption>
							</additionalOptions>
							<additionalJOptions>
								<additionalJOption>-J-Duser.language=en</additionalJOption>
								<additionalJOption>-J-Duser.country=US</additionalJOption>
							</additionalJOptions>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-sign</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>lint</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<!--
							https://spotbugs.github.io/
							https://spotbugs.readthedocs.io/en/latest/introduction.html
							https://spotbugs.readthedocs.io/en/latest/maven.html

							https://spotbugs.github.io/spotbugs-maven-plugin/check-mojo.html
								Binds by default to the lifecycle phase: verify.

							Spotbugs support @SuppressWarnings
							https://github.com/spotbugs/spotbugs/issues/737#issuecomment-416118033
						-->
						<groupId>com.github.spotbugs</groupId>
						<artifactId>spotbugs-maven-plugin</artifactId>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-git-properties</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!--
						Maven plugin which includes build-time git repository information into an POJO / *.properties).
						Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments.
							https://github.com/git-commit-id/git-commit-id-maven-plugin
					-->
					<plugin>
						<groupId>io.github.git-commit-id</groupId>
						<artifactId>git-commit-id-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>get-the-git-infos</id>
								<goals>
									<goal>revision</goal>
								</goals>
							</execution>
							<execution>
								<id>validate-the-git-infos</id>
								<goals>
									<goal>validateRevision</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<validationProperties>
								<!-- verify that the current repository is not dirty -->
								<validationProperty>
									<name>validating git dirty</name>
									<value>${git.dirty}</value>
									<shouldMatchTo>false</shouldMatchTo>
								</validationProperty>
							</validationProperties>
							<generateGitPropertiesFile>true</generateGitPropertiesFile>
							<generateGitPropertiesFilename>
								${project.build.outputDirectory}/META-INF/scm/${project.groupId}/${project.artifactId}/git.properties
							</generateGitPropertiesFilename>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gen-code-cov</id>
			<activation>
				<property>
					<!-- https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables -->
					<name>env.CI</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<!-- for codecov.io -->
						<!-- config example: https://github.com/codecov/example-java -->
						<!-- plugin docs: https://eclemma.org/jacoco/trunk/doc/ -->
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>report</id>
								<phase>test</phase>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>enforce-when-release</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>enforces</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<!--
											add maven-enforcer-plugin to make sure the right jdk is used
											https://stackoverflow.com/a/18420462/922688
										-->
										<requireJavaVersion>
											<version>17</version>
										</requireJavaVersion>
										<!-- https://maven.apache.org/enforcer/enforcer-rules/requireProperty.html -->
										<requireProperty>
											<property>project.version</property>
											<regex>^\d\.\d+\.\d+(-(Alpha|Beta|RC)\d+)?$|^\d(\.\d+)?\.(\d+|x)-SNAPSHOT$</regex>
											<regexMessage>"Project version(${project.version}) format is invalid!"</regexMessage>
										</requireProperty>
										<enforceBytecodeVersion>
											<maxJdkVersion>${maven.compiler.source}</maxJdkVersion>
										</enforceBytecodeVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.codehaus.mojo</groupId>
								<artifactId>extra-enforcer-rules</artifactId>
								<version>1.8.0</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-settings</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<extensions>true</extensions>
						<!--
							In multi-module builds using the deploy-at-end feature,
							the deployment of all components is performed in the last module based on the reactor order.
							If this property is set to true in the last module,
							all staging deployment for all modules will be skipped.
							so, we'll config nexus deploy after every moudle's deploy phase

							see: https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin#configuring-the-plugin
						-->
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
							<!--
								If you are deploying to Maven Central, it is the Nexus Staging Plugin that is
								doing the deployment instead of the Deploy plugin,
								so the configuration of the deploy plugin has no effect.
								To make the Nexus deploy plugin skip, set skipNexusStagingDeployMojo
								in its configuration to true.

								see: https://stackoverflow.com/questions/59552549/preventing-maven-modules-from-being-deployed
							-->
							<skipNexusStagingDeployMojo>${maven.deploy.skip}</skipNexusStagingDeployMojo>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>


================================================
FILE: scripts/bump-ttl-version.sh
================================================
#!/bin/bash
set -eEuo pipefail
# adjust current dir to script dir
cd "$(dirname "$(readlink -f "$0")")"

# shellcheck disable=SC2154
[ $# -ne 1 ] && cu::die "need only 1 argument for version!$nl${nl}usage:$nl  $0 4.x.y"
readonly bump_version="$1"

cd ..

echo "bump TTL version of lib to $bump_version"
./mvnw versions:set \
  -DgenerateBackupPoms=false \
  -DprocessAllModules=true \
  -DnewVersion="$bump_version"


================================================
FILE: scripts/check-japi-compliance.sh
================================================
#!/bin/bash
# Java API Compliance Checker (JAPICC),
# a tool for checking backward binary and source-level compatibility of a Java library API.
#   https://github.com/lvc/japi-compliance-checker
set -eEuo pipefail
cd "$(dirname "$(readlink -f "$0")")"


JCC="$(readlink -f "$(command -v japi-compliance-checker.pl)")"



cd ..
mvn clean package

ttl_jar_path=$(echo "target/transmittable-thread-local-"*.jar)

work_dir="target/japi-compliance-checker"
mkdir -p $work_dir
cd $work_dir
rm -rf compat_reports

for base_version in 2.5.0 2.6.0 2.7.0 2.10.2; do
    url="https://repo1.maven.org/maven2/com/alibaba/transmittable-thread-local/$base_version/transmittable-thread-local-$base_version.jar"
    base_jar="transmittable-thread-local-$base_version.jar"
    if [ ! -f "$base_jar" ]; then
        cu::log_then_run wget --quiet "$url"
    fi

    "$JCC" -show-packages -check-annotations -skip-internal-packages '\.(javassist|utils?|internal)(\.|$)' \
        "$base_jar" \
        "$ttl_jar_path" || true
done


================================================
FILE: scripts/codecov.sh
================================================
#!/bin/bash
set -eEuo pipefail
cd "$(dirname "$(readlink -f "$0")")"

source bash-buddy/lib/trap_error_info.sh
source bash-buddy/lib/common_utils.sh
source bash-buddy/lib/prepare_jdks.sh
source bash-buddy/lib/java_build_utils.sh

cd ..

prepare_jdks::switch_to_jdk 8

# about codecov: example-java-maven
# https://github.com/codecov/example-java-maven/blob/master/.travis.yml

if [ "${1:-}" = "-s" ]; then
  jvb::mvn_cmd -Pgen-code-cov jacoco:prepare-agent surefire:test jacoco:report
else
  jvb::mvn_cmd -Pgen-code-cov clean test
fi

bash <(curl -s htt
Download .txt
gitextract_ll2vt13l/

├── .editorconfig
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yaml
│       └── strong_ci.yaml
├── .gitignore
├── .gitmodules
├── .mvn/
│   └── wrapper/
│       └── maven-wrapper.properties
├── CONTRIBUTING.md
├── LICENSE
├── README-EN.md
├── README.md
├── SECURITY.md
├── docs/
│   ├── TransmittableThreadLocal.asta
│   ├── TransmittableThreadLocal.pptx
│   ├── developer-guide-en.md
│   ├── developer-guide.md
│   ├── logo.md
│   ├── performance-test.md
│   ├── release-action-list.md
│   └── requirement-scenario.md
├── mvnw
├── mvnw.cmd
├── pom.xml
├── scripts/
│   ├── bump-ttl-version.sh
│   ├── check-japi-compliance.sh
│   ├── codecov.sh
│   ├── integration-test.sh
│   ├── perf-test/
│   │   ├── memoryleak-ThreadLocal.sh
│   │   ├── memoryleak-TransmittableThreadLocal.sh
│   │   ├── tps-ThreadLocal.sh
│   │   └── tps-TransmittableThreadLocal.sh
│   ├── release.sh
│   └── run-agent-demo.sh
├── src/
│   └── package-list/
│       ├── java/
│       │   └── package-list
│       ├── jetbrains-annotations/
│       │   └── package-list
│       ├── jsr305/
│       │   └── package-list
│       └── spotbugs-annotations/
│           └── package-list
├── ttl-agent/
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── alibaba/
│                       └── ttl3/
│                           └── agent/
│                               ├── TtlAgent.java
│                               ├── TtlAgentHelper.java
│                               ├── TtlExtensionTransformletManager.java
│                               ├── TtlTransformer.java
│                               ├── logging/
│                               │   ├── Logger.java
│                               │   └── package-info.java
│                               ├── package-info.java
│                               └── transformlet/
│                                   ├── ClassInfo.java
│                                   ├── TtlTransformlet.java
│                                   ├── helper/
│                                   │   ├── AbstractExecutorTtlTransformlet.java
│                                   │   ├── TtlTransformletHelper.java
│                                   │   └── package-info.java
│                                   ├── internal/
│                                   │   ├── ForkJoinTtlTransformlet.java
│                                   │   ├── JdkExecutorTtlTransformlet.java
│                                   │   ├── PriorityBlockingQueueTtlTransformlet.java
│                                   │   ├── TimerTaskTtlTransformlet.java
│                                   │   └── package-info.java
│                                   └── package-info.java
├── ttl-bom/
│   └── pom.xml
├── ttl-core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── alibaba/
│       │   │           ├── crr/
│       │   │           │   ├── TransmitCallback.java
│       │   │           │   ├── Transmittable.java
│       │   │           │   ├── composite/
│       │   │           │   │   ├── Backup.java
│       │   │           │   │   ├── Capture.java
│       │   │           │   │   ├── CompositeTransmitCallback.java
│       │   │           │   │   ├── CompositeTransmittable.java
│       │   │           │   │   └── package-info.java
│       │   │           │   └── package-info.java
│       │   │           └── ttl3/
│       │   │               ├── TransmittableThreadLocal.java
│       │   │               ├── TtlCallable.java
│       │   │               ├── TtlRecursiveAction.java
│       │   │               ├── TtlRecursiveTask.java
│       │   │               ├── TtlRunnable.java
│       │   │               ├── TtlTimerTask.java
│       │   │               ├── TtlWrappers.java
│       │   │               ├── agent/
│       │   │               │   ├── EmptyTtlAgentStatus.java
│       │   │               │   ├── TtlAgentStatus.java
│       │   │               │   └── package-info.java
│       │   │               ├── executor/
│       │   │               │   ├── ComparableComparator.java
│       │   │               │   ├── DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
│       │   │               │   ├── DisableInheritableThreadFactoryWrapper.java
│       │   │               │   ├── ExecutorServiceTtlWrapper.java
│       │   │               │   ├── ExecutorTtlWrapper.java
│       │   │               │   ├── ScheduledExecutorServiceTtlWrapper.java
│       │   │               │   ├── TtlExecutors.java
│       │   │               │   ├── TtlUnwrapComparator.java
│       │   │               │   └── package-info.java
│       │   │               ├── internal/
│       │   │               │   └── util/
│       │   │               │       ├── Assert.java
│       │   │               │       ├── ConcurrentReferenceHashMap.java
│       │   │               │       ├── ObjectUtils.java
│       │   │               │       └── Utils.java
│       │   │               ├── package-info.java
│       │   │               ├── spi/
│       │   │               │   ├── TtlAttachments.java
│       │   │               │   ├── TtlAttachmentsDelegate.java
│       │   │               │   ├── TtlEnhanced.java
│       │   │               │   ├── TtlWrapper.java
│       │   │               │   └── package-info.java
│       │   │               └── transmitter/
│       │   │                   ├── ThreadLocalTransmitRegistry.java
│       │   │                   ├── Transmittee.java
│       │   │                   ├── TransmitteeRegistry.java
│       │   │                   ├── Transmitter.java
│       │   │                   └── package-info.java
│       │   └── javadoc/
│       │       └── overview.html
│       └── test/
│           └── java/
│               └── com/
│                   └── alibaba/
│                       ├── Utils.kt
│                       ├── demo/
│                       │   ├── cow/
│                       │   │   └── CowDemo.kt
│                       │   ├── forkjoinpool/
│                       │   │   ├── ForkJoinPoolDemo.kt
│                       │   │   └── ParallelStreamDemo.kt
│                       │   ├── scheduled_thread_pool_executor/
│                       │   │   └── ScheduledFutureTaskDemo.kt
│                       │   ├── session_cache/
│                       │   │   └── SessionCacheDemo.kt
│                       │   ├── timer/
│                       │   │   └── TimerTaskDemo.kt
│                       │   └── ttl3/
│                       │       ├── CustomizedBlockingQueueWithTtlDemo.java
│                       │       ├── SimpleDemo.kt
│                       │       ├── TtlExecutorServiceWithPriorityBlockingQueueDemo.kt
│                       │       ├── TtlExecutorWrapperDemo.kt
│                       │       ├── TtlForkJoinTaskDemo.kt
│                       │       └── TtlWrapperDemo.kt
│                       ├── perf/
│                       │   ├── Utils.kt
│                       │   ├── memoryleak/
│                       │   │   ├── NoMemoryLeak_ThreadLocal_NoRemove.kt
│                       │   │   └── NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt
│                       │   ├── package-info.java
│                       │   └── tps/
│                       │       ├── CreateThreadLocalInstanceTps.kt
│                       │       ├── CreateTransmittableThreadLocalInstanceTps.kt
│                       │       └── TpsCounter.kt
│                       ├── third_part_lib_test/
│                       │   ├── ExecutorsTest.kt
│                       │   └── ForkJoinPoolTest.kt
│                       ├── ttl3/
│                       │   ├── TtlCallableTest.kt
│                       │   ├── TtlFlowTester.kt
│                       │   ├── TtlRunnableTest.kt
│                       │   └── TtlTimerTaskTest.kt
│                       └── user_api_test/
│                           └── ttl3/
│                               ├── DisableIgnoreNullValueSemanticsTest.kt
│                               ├── TransmittableThreadLocal_Transmitter_UserTest.kt
│                               ├── TransmittableThreadLocal_Transmitter_registerTransmittee_UserTest.kt
│                               ├── TransmittableThreadLocal_withInit_Null_Test.java
│                               └── TransmittableThreadLocal_withInit_Test.kt
├── ttl-integrations/
│   ├── sample-ttl-agent-extension-transformlet/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   ├── scripts/
│   │   │   ├── integration-test.sh
│   │   │   └── run.sh
│   │   └── src/
│   │       ├── main/
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── alibaba/
│   │       │   │           └── ttl/
│   │       │   │               └── agent/
│   │       │   │                   └── extension_transformlet/
│   │       │   │                       └── sample/
│   │       │   │                           ├── biz/
│   │       │   │                           │   ├── SampleMain.java
│   │       │   │                           │   └── ToBeTransformedClass.java
│   │       │   │                           └── transformlet/
│   │       │   │                               └── SampleExtensionTransformlet.java
│   │       │   └── resources/
│   │       │       └── META-INF/
│   │       │           └── ttl.agent.transformlets
│   │       └── test/
│   │           └── java/
│   │               └── com/
│   │                   └── alibaba/
│   │                       └── ttl/
│   │                           └── agent/
│   │                               └── extension_transformlet/
│   │                                   └── sample/
│   │                                       └── biz/
│   │                                           └── ToBeTransformedClassTest.java
│   ├── vertx3-ttl-integration/
│   │   ├── README-EN.md
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   ├── java/
│   │       │   │   └── com/
│   │       │   │       └── alibaba/
│   │       │   │           └── ttl/
│   │       │   │               └── integration/
│   │       │   │                   └── vertx3/
│   │       │   │                       ├── TtlVertxHandler.java
│   │       │   │                       └── agent/
│   │       │   │                           └── transformlet/
│   │       │   │                               ├── NettySingleThreadEventExecutorTtlTransformlet.java
│   │       │   │                               └── VertxFutureTtlTransformlet.java
│   │       │   └── resources/
│   │       │       └── META-INF/
│   │       │           └── ttl.agent.transformlets
│   │       └── test/
│   │           └── java/
│   │               └── com/
│   │                   └── alibaba/
│   │                       └── ttl/
│   │                           └── integration/
│   │                               └── vertx3/
│   │                                   └── VertxTransformletTest.java
│   └── vertx4-ttl-integration/
│       ├── README-EN.md
│       ├── README.md
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   ├── java/
│           │   │   └── com/
│           │   │       └── alibaba/
│           │   │           └── ttl/
│           │   │               └── integration/
│           │   │                   └── vertx4/
│           │   │                       ├── TtlVertxHandler.java
│           │   │                       └── agent/
│           │   │                           └── transformlet/
│           │   │                               ├── NettySingleThreadEventExecutorTtlTransformlet.java
│           │   │                               └── VertxFutureTtlTransformlet.java
│           │   └── resources/
│           │       └── META-INF/
│           │           └── ttl.agent.transformlets
│           └── test/
│               └── java/
│                   └── com/
│                       └── alibaba/
│                           └── ttl/
│                               └── integration/
│                                   └── vertx4/
│                                       └── VertxTransformletTest.java
├── ttl-kotlin/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── kotlin/
│       │       └── com/
│       │           └── alibaba/
│       │               └── ttl3/
│       │                   └── kotlin/
│       │                       ├── Transmitter.kt
│       │                       └── TtlExtensions.kt
│       └── test/
│           └── kotlin/
│               └── com/
│                   └── alibaba/
│                       ├── Utils.kt
│                       └── ttl3/
│                           └── kotlin/
│                               └── TtlExtensionsTests.kt
└── ttl2-compatible/
    ├── pom.xml
    └── src/
        ├── main/
        │   ├── java/
        │   │   └── com/
        │   │       └── alibaba/
        │   │           └── ttl/
        │   │               ├── TransmittableThreadLocal.java
        │   │               ├── TtlCallable.java
        │   │               ├── TtlCopier.java
        │   │               ├── TtlEnhanced.java
        │   │               ├── TtlRecursiveAction.java
        │   │               ├── TtlRecursiveTask.java
        │   │               ├── TtlRunnable.java
        │   │               ├── TtlTimerTask.java
        │   │               ├── TtlUnwrap.java
        │   │               ├── TtlWrappers.java
        │   │               ├── package-info.java
        │   │               ├── spi/
        │   │               │   ├── TtlAttachments.java
        │   │               │   ├── TtlAttachmentsDelegate.java
        │   │               │   ├── TtlEnhanced.java
        │   │               │   ├── TtlWrapper.java
        │   │               │   └── package-info.java
        │   │               └── threadpool/
        │   │                   ├── ComparableComparator.java
        │   │                   ├── DisableInheritableForkJoinWorkerThreadFactory.java
        │   │                   ├── DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
        │   │                   ├── DisableInheritableThreadFactory.java
        │   │                   ├── DisableInheritableThreadFactoryWrapper.java
        │   │                   ├── ExecutorServiceTtlWrapper.java
        │   │                   ├── ExecutorTtlWrapper.java
        │   │                   ├── ScheduledExecutorServiceTtlWrapper.java
        │   │                   ├── TtlExecutors.java
        │   │                   ├── TtlForkJoinPoolHelper.java
        │   │                   ├── TtlUnwrapComparator.java
        │   │                   ├── agent/
        │   │                   │   ├── TtlAgent.java
        │   │                   │   ├── TtlAgentHelper.java
        │   │                   │   ├── TtlExtensionTransformletManager.java
        │   │                   │   ├── TtlTransformer.java
        │   │                   │   ├── logging/
        │   │                   │   │   ├── Logger.java
        │   │                   │   │   └── package-info.java
        │   │                   │   ├── package-info.java
        │   │                   │   └── transformlet/
        │   │                   │       ├── ClassInfo.java
        │   │                   │       ├── TtlTransformlet.java
        │   │                   │       ├── helper/
        │   │                   │       │   ├── AbstractExecutorTtlTransformlet.java
        │   │                   │       │   ├── TtlTransformletHelper.java
        │   │                   │       │   └── package-info.java
        │   │                   │       ├── internal/
        │   │                   │       │   ├── ForkJoinTtlTransformlet.java
        │   │                   │       │   ├── JdkExecutorTtlTransformlet.java
        │   │                   │       │   ├── PriorityBlockingQueueTtlTransformlet.java
        │   │                   │       │   ├── TimerTaskTtlTransformlet.java
        │   │                   │       │   └── package-info.java
        │   │                   │       └── package-info.java
        │   │                   └── package-info.java
        │   └── javadoc/
        │       └── overview.html
        └── test/
            ├── java/
            │   └── com/
            │       └── alibaba/
            │           ├── Utils.kt
            │           ├── demo/
            │           │   ├── coroutine/
            │           │   │   ├── CoroutineDemo.kt
            │           │   │   ├── CoroutineThreadContextElementDemo.kt
            │           │   │   ├── CoroutineThreadContextElementTest.kt
            │           │   │   ├── CoroutineThreadLocalContextContinuationInterceptorDemo.kt
            │           │   │   └── ttl_intergration/
            │           │   │       ├── TtlCoroutineContext.kt
            │           │   │       └── usage/
            │           │   │           ├── TtlCoroutineContextDemo.kt
            │           │   │           └── TtlCoroutineContextTest.kt
            │           │   ├── cow/
            │           │   │   └── CowDemo.kt
            │           │   ├── distributed_tracer/
            │           │   │   ├── refcount/
            │           │   │   │   └── DistributedTracerUseDemo.kt
            │           │   │   └── weakref/
            │           │   │       └── DistributedTracerUseDemo_WeakReferenceInsteadOfRefCounter.kt
            │           │   ├── forkjoinpool/
            │           │   │   ├── ForkJoinPoolDemo.kt
            │           │   │   └── ParallelStreamDemo.kt
            │           │   ├── scheduled_thread_pool_executor/
            │           │   │   └── ScheduledFutureTaskDemo.kt
            │           │   ├── session_cache/
            │           │   │   └── SessionCacheDemo.kt
            │           │   ├── timer/
            │           │   │   └── TimerTaskDemo.kt
            │           │   └── ttl/
            │           │       ├── CustomizedBlockingQueueWithTtlDemo.java
            │           │       ├── SimpleDemo.kt
            │           │       ├── TtlExecutorServiceWithPriorityBlockingQueueDemo.kt
            │           │       ├── TtlExecutorWrapperDemo.kt
            │           │       ├── TtlForkJoinTaskDemo.kt
            │           │       ├── TtlWrapperDemo.kt
            │           │       ├── TtlWrapperTypeInferenceProblemShowcase.java
            │           │       └── agent/
            │           │           ├── AgentDemo.kt
            │           │           └── YourXxxAgent.java
            │           ├── it/
            │           │   ├── README.md
            │           │   └── TimerAgentCheck.kt
            │           ├── perf/
            │           │   ├── Utils.kt
            │           │   ├── memoryleak/
            │           │   │   ├── NoMemoryLeak_ThreadLocal_NoRemove.kt
            │           │   │   └── NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt
            │           │   └── tps/
            │           │       ├── CreateThreadLocalInstanceTps.kt
            │           │       ├── CreateTransmittableThreadLocalInstanceTps.kt
            │           │       └── TpsCounter.kt
            │           ├── third_part_lib_test/
            │           │   ├── ExecutorsTest.kt
            │           │   ├── ForkJoinPoolTest.kt
            │           │   └── JavassistTest.kt
            │           ├── ttl/
            │           │   ├── InheritableTest.kt
            │           │   ├── README.md
            │           │   ├── TtlCallableTest.kt
            │           │   ├── TtlRunnableTest.kt
            │           │   ├── TtlTimerTaskTest.kt
            │           │   ├── TtlWrappersTest.kt
            │           │   ├── forkjoin/
            │           │   │   ├── ForkJoinPool4RunnableCallableTest.kt
            │           │   │   ├── ForkJoinPool4StreamTest.kt
            │           │   │   ├── recursive_action/
            │           │   │   │   └── TtlRecursiveActionTest.kt
            │           │   │   └── recursive_task/
            │           │   │       └── TtlRecursiveTaskTest.kt
            │           │   ├── reported_bugs/
            │           │   │   └── Bug70_Test.kt
            │           │   ├── testmodel/
            │           │   │   ├── Call.kt
            │           │   │   ├── DeepCopyFooTransmittableThreadLocal.kt
            │           │   │   ├── FooPojo.kt
            │           │   │   ├── FooTask.kt
            │           │   │   └── Task.kt
            │           │   ├── threadlocal_integration/
            │           │   │   └── ThreadLocalIntegrationTest.kt
            │           │   └── threadpool/
            │           │       ├── BeforeAndAfterExecuteMethodOfExecutorSubclassTest.kt
            │           │       ├── ExecutorClassesTest.kt
            │           │       ├── ScheduledExecutorServiceTtlWrapperTest.kt
            │           │       ├── TtlExecutorsTest.kt
            │           │       ├── TtlForkJoinPoolHelperTest.kt
            │           │       └── agent/
            │           │           ├── TtlAgentHelperTest.kt
            │           │           ├── TtlExtensionTransformletManagerTest.kt
            │           │           └── transformlet/
            │           │               ├── helper/
            │           │               │   └── TtlTransformletHelperTest.kt
            │           │               └── internal/
            │           │                   └── UtilsTest.java
            │           └── user_api_test/
            │               ├── README.md
            │               └── ttl/
            │                   ├── DisableIgnoreNullValueSemanticsTest.kt
            │                   ├── TransmittableThreadLocal_Transmitter_UserTest.kt
            │                   ├── TransmittableThreadLocal_Transmitter_registerTransmittee_UserTest.kt
            │                   ├── TransmittableThreadLocal_withInit_Null_Test.java
            │                   └── TransmittableThreadLocal_withInit_Test.kt
            └── resources/
                ├── io/
                │   └── mockk/
                │       └── settings.properties
                ├── log4j.xml
                └── test_extension/
                    └── foo.txt
Download .txt
SYMBOL INDEX (970 symbols across 105 files)

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java
  class TtlAgent (line 158) | public final class TtlAgent implements TtlAgentStatus {
    method premain (line 200) | public static void premain(final String agentArgs, @NonNull final Inst...
    method logTtlAgentConfig (line 234) | private static String logTtlAgentConfig() {
    method isTtlAgentLoaded (line 245) | public boolean isTtlAgentLoaded() {
    method isDisableInheritableForThreadPool (line 263) | public static boolean isDisableInheritableForThreadPool() {
    method isEnableTimerTask (line 278) | public static boolean isEnableTimerTask() {
    method isLogClassTransform (line 291) | public static boolean isLogClassTransform() {
    method getLoggerType (line 307) | @NonNull
    method isBooleanOptionSet (line 322) | public static boolean isBooleanOptionSet(@NonNull String key) {
    method isBooleanOptionSet (line 331) | public static boolean isBooleanOptionSet(@NonNull String key, boolean ...
    method getStringOptionValue (line 346) | @NonNull
    method getOptionStringListValues (line 363) | @NonNull
    method TtlAgent (line 369) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgentHelper.java
  class TtlAgentHelper (line 12) | final class TtlAgentHelper {
    method isBooleanOptionSet (line 16) | static boolean isBooleanOptionSet(
    method isBooleanOptionSet (line 23) | static boolean isBooleanOptionSet(
    method getStringOptionValue (line 47) | @NonNull
    method getOptionStringListValues (line 72) | @NonNull
    method splitCommaColonStringToKV (line 94) | @NonNull
    method splitListStringToStringList (line 114) | @NonNull
    method TtlAgentHelper (line 130) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlExtensionTransformletManager.java
  class TtlExtensionTransformletManager (line 24) | final class TtlExtensionTransformletManager {
    method TtlExtensionTransformletManager (line 29) | public TtlExtensionTransformletManager() {
    method extensionTransformletDoTransform (line 32) | public String extensionTransformletDoTransform(@NonNull final ClassInf...
    method collectExtensionTransformlet (line 60) | public void collectExtensionTransformlet(@NonNull final ClassInfo clas...
    method readExtensionTransformletClassNames (line 88) | private LinkedHashSet<String> readExtensionTransformletClassNames(Clas...
    method mergeToClassLoader2ExtensionTransformlet (line 101) | private static void mergeToClassLoader2ExtensionTransformlet(
    method updateClassLoader2ExtensionTransformletsIncludeParentCL (line 120) | static void updateClassLoader2ExtensionTransformletsIncludeParentCL(
    method childClassLoaderFirstMergeTransformlets (line 131) | static Map<String, TtlTransformlet> childClassLoaderFirstMergeTransfor...
    method loadExtensionInstances (line 156) | static <T> Map<ClassLoader, Set<T>> loadExtensionInstances(
    method readLinesFromExtensionFiles (line 198) | @NonNull
    method readLines (line 230) | @SuppressWarnings("StatementWithEmptyBody")
    method parseLine (line 259) | private static int parseLine(URL url, BufferedReader reader, int lineN...
    class Pair (line 297) | static class Pair<T, U> {
      method Pair (line 301) | public Pair(T first, U second) {

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlTransformer.java
  class TtlTransformer (line 24) | public class TtlTransformer implements ClassFileTransformer {
    method TtlTransformer (line 41) | TtlTransformer(List<? extends TtlTransformlet> transformletList, boole...
    method transform (line 56) | @Override

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/logging/Logger.java
  class Logger (line 17) | public abstract class Logger {
    method setLoggerImplType (line 23) | public static void setLoggerImplType(String type) {
    method setLoggerImplTypeIfNotSetYet (line 36) | public static void setLoggerImplTypeIfNotSetYet(String type) {
    method getLogger (line 40) | public static Logger getLogger(Class<?> clazz) {
    method Logger (line 53) | private Logger(Class<?> logClass) {
    method info (line 57) | public void info(String msg) {
    method warn (line 61) | public void warn(String msg) {
    method warn (line 65) | public void warn(String msg, Throwable thrown) {
    method error (line 69) | public void error(String msg) {
    method error (line 73) | public void error(String msg, Throwable thrown) {
    method log (line 77) | protected abstract void log(Level level, String msg, Throwable thrown);
    class StdErrorLogger (line 79) | private static class StdErrorLogger extends Logger {
      method StdErrorLogger (line 80) | StdErrorLogger(Class<?> clazz) {
      method log (line 84) | @Override
    class StdOutLogger (line 94) | private static class StdOutLogger extends Logger {
      method StdOutLogger (line 95) | StdOutLogger(Class<?> clazz) {
      method log (line 99) | @Override

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/ClassInfo.java
  class ClassInfo (line 24) | public class ClassInfo {
    method ClassInfo (line 34) | public ClassInfo(@NonNull String transformerClassFile,
    method getClassName (line 43) | @NonNull
    method getLocationUrl (line 50) | public URL getLocationUrl() throws IOException {
    method getCtClass (line 54) | @NonNull
    method isModified (line 78) | public boolean isModified() {
    method setModified (line 82) | public void setModified() {
    method getClassLoader (line 86) | @SuppressFBWarnings({"EI_EXPOSE_REP"})
    method toClassName (line 94) | private static String toClassName(@NonNull final String classFile) {

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/TtlTransformlet.java
  type TtlTransformlet (line 15) | public interface TtlTransformlet {
    method doTransform (line 24) | void doTransform(@NonNull ClassInfo classInfo) throws CannotCompileExc...

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/helper/AbstractExecutorTtlTransformlet.java
  class AbstractExecutorTtlTransformlet (line 35) | public abstract class AbstractExecutorTtlTransformlet implements TtlTran...
    method AbstractExecutorTtlTransformlet (line 55) | public AbstractExecutorTtlTransformlet(Set<String> executorClassNames,...
    method doTransform (line 63) | @Override
    method updateSubmitMethodsOfExecutorClass_decorateToTtlWrapperAndSetAutoWrapperAttachment (line 96) | @SuppressFBWarnings("VA_FORMAT_STRING_USES_NEWLINE") // [ERROR] Format...
    method updateConstructorDisableInheritable (line 124) | private void updateConstructorDisableInheritable(@NonNull final CtClas...
    method updateBeforeAndAfterExecuteMethodOfExecutorSubclass (line 146) | private boolean updateBeforeAndAfterExecuteMethodOfExecutorSubclass(@N...

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/helper/TtlTransformletHelper.java
  class TtlTransformletHelper (line 27) | public final class TtlTransformletHelper {
    method signatureOfMethod (line 39) | @NonNull
    method getLocationUrlOfClass (line 61) | public static URL getLocationUrlOfClass(CtClass clazz) {
    method getLocationFileOfClass (line 73) | public static String getLocationFileOfClass(CtClass clazz) {
    method getLocationUrlOfClass (line 80) | public static URL getLocationUrlOfClass(Class<?> clazz) {
    method getLocationFileOfClass (line 98) | public static String getLocationFileOfClass(Class<?> clazz) {
    method renamedMethodNameByTtl (line 107) | @NonNull
    method addTryFinallyToMethod (line 112) | public static String addTryFinallyToMethod(@NonNull CtMethod method, @...
    method addTryFinallyToMethod (line 121) | public static String addTryFinallyToMethod(@NonNull CtMethod method, @...
    method doCaptureIfNotTtlEnhanced (line 154) | @Nullable
    method doAutoWrap (line 162) | @Nullable
    method doAutoWrap (line 175) | @Nullable
    method getPackageName (line 189) | @NonNull
    method isClassAtPackage (line 197) | public static boolean isClassAtPackage(@NonNull String className, @Non...
    method isClassUnderPackage (line 201) | public static boolean isClassUnderPackage(@NonNull String className, @...
    method isClassAtPackageJavaUtil (line 206) | public static boolean isClassAtPackageJavaUtil(@NonNull String classNa...
    method TtlTransformletHelper (line 210) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/ForkJoinTtlTransformlet.java
  class ForkJoinTtlTransformlet (line 24) | public final class ForkJoinTtlTransformlet implements TtlTransformlet {
    method ForkJoinTtlTransformlet (line 33) | public ForkJoinTtlTransformlet() {
    method doTransform (line 37) | @Override
    method updateForkJoinTaskClass (line 51) | private void updateForkJoinTaskClass(@NonNull final CtClass clazz) thr...
    method updateConstructorDisableInheritable (line 74) | private void updateConstructorDisableInheritable(@NonNull final CtClas...

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/JdkExecutorTtlTransformlet.java
  class JdkExecutorTtlTransformlet (line 19) | public final class JdkExecutorTtlTransformlet extends AbstractExecutorTt...
    method getExecutorClassNames (line 21) | private static Set<String> getExecutorClassNames() {
    method JdkExecutorTtlTransformlet (line 30) | public JdkExecutorTtlTransformlet() {

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/PriorityBlockingQueueTtlTransformlet.java
  class PriorityBlockingQueueTtlTransformlet (line 40) | public class PriorityBlockingQueueTtlTransformlet implements TtlTransfor...
    method doTransform (line 47) | @Override
    method updatePriorityBlockingQueueClass (line 62) | private void updatePriorityBlockingQueueClass(@NonNull final CtClass c...
    method updateBlockingQueueClass (line 74) | private void updateBlockingQueueClass(@NonNull final CtClass clazz) th...
    method haveComparatorField (line 83) | private static boolean haveComparatorField(CtClass clazz) {
    method modifyConstructors (line 102) | private static void modifyConstructors(@NonNull CtClass clazz) throws ...
    method overwriteComparatorField$by$ttl (line 114) | public static Comparator<Runnable> overwriteComparatorField$by$ttl(Com...

FILE: ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/TimerTaskTtlTransformlet.java
  class TimerTaskTtlTransformlet (line 22) | public final class TimerTaskTtlTransformlet implements TtlTransformlet {
    method doTransform (line 28) | @Override
    method updateTimerTaskClass (line 60) | private void updateTimerTaskClass(@NonNull final CtClass clazz) throws...

FILE: ttl-core/src/main/java/com/alibaba/crr/TransmitCallback.java
  type TransmitCallback (line 9) | public interface TransmitCallback {
    method beforeReplay (line 13) | default void beforeReplay() {
    method afterReplay (line 19) | default void afterReplay() {
    method beforeRestore (line 25) | default void beforeRestore() {
    method afterRestore (line 31) | default void afterRestore() {

FILE: ttl-core/src/main/java/com/alibaba/crr/Transmittable.java
  type Transmittable (line 13) | public interface Transmittable<C, B> {
    method capture (line 22) | @NonNull
    method replay (line 34) | @NonNull
    method clear (line 53) | @NonNull
    method restore (line 63) | void restore(@NonNull B backup);

FILE: ttl-core/src/main/java/com/alibaba/crr/composite/Backup.java
  type Backup (line 11) | @ApiStatus.NonExtendable

FILE: ttl-core/src/main/java/com/alibaba/crr/composite/Capture.java
  type Capture (line 11) | @ApiStatus.NonExtendable

FILE: ttl-core/src/main/java/com/alibaba/crr/composite/CompositeTransmitCallback.java
  class CompositeTransmitCallback (line 20) | public final class CompositeTransmitCallback {
    method beforeReplay (line 25) | Object beforeReplay() {
    method afterReplay (line 41) | Object afterReplay(Object data) {
    method beforeRestore (line 58) | Object beforeRestore(Object data) {
    method afterRestore (line 75) | void afterRestore(Object data) {
    method registerCallback (line 98) | public boolean registerCallback(@NonNull TransmitCallback callback) {
    method unregisterCallback (line 108) | public boolean unregisterCallback(@NonNull TransmitCallback callback) {

FILE: ttl-core/src/main/java/com/alibaba/crr/composite/CompositeTransmittable.java
  class CompositeTransmittable (line 29) | public final class CompositeTransmittable implements Transmittable<Captu...
    method CompositeTransmittable (line 36) | public CompositeTransmittable(CompositeTransmitCallback callback) {
    method capture (line 45) | @NonNull
    method replay (line 70) | @NonNull
    method clear (line 109) | @NonNull
    method restore (line 137) | public void restore(@NonNull Backup backup) {
    class Snapshot (line 158) | private static class Snapshot implements Capture, Backup {
      method Snapshot (line 162) | Snapshot(HashMap<Transmittable<Object, Object>, Object> transmit2Val...
    method registerTransmittable (line 177) | @SuppressWarnings("unchecked")
    method unregisterTransmittable (line 190) | @SuppressWarnings("unchecked")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java
  class TransmittableThreadLocal (line 68) | public class TransmittableThreadLocal<T> extends InheritableThreadLocal<...
    method TransmittableThreadLocal (line 99) | public TransmittableThreadLocal() {
    method TransmittableThreadLocal (line 110) | public TransmittableThreadLocal(boolean disableIgnoreNullValueSemantic...
    method withInitial (line 125) | @NonNull
    method withInitialAndGenerator (line 147) | @NonNull
    method withInitialAndGenerator (line 178) | @NonNull
    class SuppliedTransmittableThreadLocal (line 193) | private static final class SuppliedTransmittableThreadLocal<T> extends...
      method SuppliedTransmittableThreadLocal (line 198) | SuppliedTransmittableThreadLocal(Supplier<? extends T> supplier, Una...
      method initialValue (line 205) | @Override
      method childValue (line 210) | @Override
      method transmitteeValue (line 216) | @Override
    method childValue (line 238) | @Override
    method transmitteeValue (line 256) | protected T transmitteeValue(T parentValue) {
    method get (line 263) | @Override
    method set (line 273) | @Override
    method remove (line 287) | @Override
    method superRemove (line 293) | private void superRemove() {
    method getTransmitteeValue (line 297) | private T getTransmitteeValue() {
    method initialValue (line 309) | @Override
    method childValue (line 314) | @Override
    method addThisToHolder (line 320) | @SuppressWarnings("unchecked")
    method removeThisFromHolder (line 327) | private void removeThisFromHolder() {
    class TtlTransmittee (line 332) | private static class TtlTransmittee implements Transmittee<HashMap<Tra...
      method capture (line 333) | @NonNull
      method replay (line 343) | @NonNull
      method clear (line 368) | @NonNull
      method restore (line 374) | @Override
      method setTtlValuesTo (line 391) | private static void setTtlValuesTo(@NonNull HashMap<TransmittableThr...

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java
  class TtlCallable (line 42) | public final class TtlCallable<V> implements Callable<V>, TtlWrapper<Cal...
    method TtlCallable (line 47) | private TtlCallable(@NonNull Callable<V> callable, boolean releaseTtlV...
    method call (line 56) | @Override
    method getCallable (line 75) | @NonNull
    method unwrap (line 85) | @NonNull
    method toString (line 91) | @Override
    method get (line 104) | @Nullable
    method get (line 120) | @Nullable
    method get (line 136) | @Nullable
    method gets (line 155) | @NonNull
    method gets (line 167) | @NonNull
    method gets (line 180) | @NonNull
    method unwrap (line 202) | @Nullable
    method unwraps (line 219) | @NonNull
    method setTtlAttachment (line 236) | @Override
    method getTtlAttachment (line 244) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlRecursiveAction.java
  class TtlRecursiveAction (line 22) | public abstract class TtlRecursiveAction extends ForkJoinTask<Void> impl...
    method TtlRecursiveAction (line 28) | protected TtlRecursiveAction() {
    method compute (line 34) | protected abstract void compute();
    method getRawResult (line 39) | public final Void getRawResult() {
    method setRawResult (line 46) | protected final void setRawResult(Void mustBeNull) {
    method exec (line 52) | protected final boolean exec() {

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlRecursiveTask.java
  class TtlRecursiveTask (line 22) | public abstract class TtlRecursiveTask<V> extends ForkJoinTask<V> implem...
    method TtlRecursiveTask (line 28) | protected TtlRecursiveTask() {
    method compute (line 41) | protected abstract V compute();
    method getRawResult (line 46) | public final V getRawResult() {
    method setRawResult (line 53) | protected final void setRawResult(V value) {
    method exec (line 60) | protected final boolean exec() {

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java
  class TtlRunnable (line 38) | public final class TtlRunnable implements Runnable, TtlWrapper<Runnable>...
    method TtlRunnable (line 43) | private TtlRunnable(@NonNull Runnable runnable, boolean releaseTtlValu...
    method run (line 52) | @Override
    method getRunnable (line 70) | @NonNull
    method unwrap (line 80) | @NonNull
    method toString (line 86) | @Override
    method get (line 98) | @Nullable
    method get (line 112) | @Nullable
    method get (line 129) | @Nullable
    method gets (line 149) | @NonNull
    method gets (line 162) | @NonNull
    method gets (line 178) | @NonNull
    method unwrap (line 200) | @Nullable
    method unwraps (line 217) | @NonNull
    method setTtlAttachment (line 234) | @Override
    method getTtlAttachment (line 242) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlTimerTask.java
  class TtlTimerTask (line 37) | @Deprecated
    method TtlTimerTask (line 43) | private TtlTimerTask(@NonNull TimerTask timerTask, boolean releaseTtlV...
    method run (line 52) | @Override
    method cancel (line 67) | @Override
    method getTimerTask (line 76) | @NonNull
    method unwrap (line 86) | @NonNull
    method toString (line 92) | @Override
    method get (line 105) | @Nullable
    method get (line 120) | @Nullable
    method get (line 136) | @Nullable
    method unwrap (line 157) | @Nullable

FILE: ttl-core/src/main/java/com/alibaba/ttl3/TtlWrappers.java
  class TtlWrappers (line 44) | public final class TtlWrappers {
    method wrapSupplier (line 52) | @Nullable
    method wrapConsumer (line 67) | @Nullable
    method wrapBiConsumer (line 82) | @Nullable
    method wrapFunction (line 97) | @Nullable
    method wrapBiFunction (line 112) | @Nullable
    method unwrap (line 145) | @Nullable
    method isWrapper (line 158) | public static <T> boolean isWrapper(@Nullable T obj) {
    class TtlSupplier (line 166) | private static class TtlSupplier<T> implements Supplier<T>, TtlWrapper...
      method TtlSupplier (line 170) | TtlSupplier(@NonNull Supplier<T> supplier) {
      method get (line 175) | @Override
      method unwrap (line 185) | @NonNull
      method toString (line 191) | @Override
    class TtlConsumer (line 197) | private static class TtlConsumer<T> implements Consumer<T>, TtlWrapper...
      method TtlConsumer (line 201) | TtlConsumer(@NonNull Consumer<T> consumer) {
      method accept (line 206) | @Override
      method unwrap (line 216) | @NonNull
      method toString (line 222) | @Override
    class TtlBiConsumer (line 228) | private static class TtlBiConsumer<T, U> implements BiConsumer<T, U>, ...
      method TtlBiConsumer (line 232) | TtlBiConsumer(@NonNull BiConsumer<T, U> consumer) {
      method accept (line 237) | @Override
      method unwrap (line 247) | @NonNull
      method toString (line 253) | @Override
    class TtlFunction (line 259) | private static class TtlFunction<T, R> implements Function<T, R>, TtlW...
      method TtlFunction (line 263) | TtlFunction(@NonNull Function<T, R> fn) {
      method apply (line 268) | @Override
      method unwrap (line 278) | @NonNull
      method toString (line 284) | @Override
    class TtlBiFunction (line 290) | private static class TtlBiFunction<T, U, R> implements BiFunction<T, U...
      method TtlBiFunction (line 294) | TtlBiFunction(@NonNull BiFunction<T, U, R> fn) {
      method apply (line 299) | @Override
      method unwrap (line 309) | @NonNull
      method toString (line 315) | @Override
    method TtlWrappers (line 321) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/agent/EmptyTtlAgentStatus.java
  class EmptyTtlAgentStatus (line 7) | final class EmptyTtlAgentStatus implements TtlAgentStatus {
    method isTtlAgentLoaded (line 8) | @Override
    method EmptyTtlAgentStatus (line 13) | private EmptyTtlAgentStatus() {
    method getLoadedAgentOrEmpty (line 23) | @NonNull

FILE: ttl-core/src/main/java/com/alibaba/ttl3/agent/TtlAgentStatus.java
  type TtlAgentStatus (line 7) | public interface TtlAgentStatus {
    method isTtlAgentLoaded (line 11) | boolean isTtlAgentLoaded();
    method getInstance (line 13) | @NonNull

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/ComparableComparator.java
  class ComparableComparator (line 53) | final class ComparableComparator<E extends Comparable<? super E>> implem...
    method comparableComparator (line 73) | @SuppressWarnings("unchecked")
    method ComparableComparator (line 84) | public ComparableComparator() {
    method compare (line 102) | @Override
    method hashCode (line 114) | @Override
    method equals (line 131) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
  class DisableInheritableForkJoinWorkerThreadFactoryWrapper (line 17) | final class DisableInheritableForkJoinWorkerThreadFactoryWrapper impleme...
    method DisableInheritableForkJoinWorkerThreadFactoryWrapper (line 20) | DisableInheritableForkJoinWorkerThreadFactoryWrapper(@NonNull ForkJoin...
    method newThread (line 24) | @Override
    method unwrap (line 34) | @Override
    method equals (line 40) | @Override
    method hashCode (line 50) | @Override
    method toString (line 55) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/DisableInheritableThreadFactoryWrapper.java
  class DisableInheritableThreadFactoryWrapper (line 16) | final class DisableInheritableThreadFactoryWrapper implements ThreadFact...
    method DisableInheritableThreadFactoryWrapper (line 19) | DisableInheritableThreadFactoryWrapper(@NonNull ThreadFactory threadFa...
    method newThread (line 23) | @Override
    method unwrap (line 33) | @NonNull
    method equals (line 39) | @Override
    method hashCode (line 49) | @Override
    method toString (line 54) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/ExecutorServiceTtlWrapper.java
  class ExecutorServiceTtlWrapper (line 21) | @SuppressFBWarnings({"EQ_DOESNT_OVERRIDE_EQUALS"})
    method ExecutorServiceTtlWrapper (line 25) | ExecutorServiceTtlWrapper(@NonNull ExecutorService executorService, bo...
    method shutdown (line 30) | @Override
    method shutdownNow (line 35) | @NonNull
    method isShutdown (line 41) | @Override
    method isTerminated (line 46) | @Override
    method awaitTermination (line 51) | @Override
    method submit (line 56) | @NonNull
    method submit (line 62) | @NonNull
    method submit (line 68) | @NonNull
    method invokeAll (line 74) | @NonNull
    method invokeAll (line 80) | @NonNull
    method invokeAny (line 86) | @NonNull
    method invokeAny (line 92) | @Override
    method unwrap (line 97) | @NonNull

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/ExecutorTtlWrapper.java
  class ExecutorTtlWrapper (line 18) | class ExecutorTtlWrapper implements Executor, TtlWrapper<Executor>, TtlE...
    method ExecutorTtlWrapper (line 22) | ExecutorTtlWrapper(@NonNull Executor executor, boolean idempotent) {
    method execute (line 27) | @Override
    method unwrap (line 32) | @NonNull
    method equals (line 38) | @Override
    method hashCode (line 49) | @Override
    method toString (line 56) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/ScheduledExecutorServiceTtlWrapper.java
  class ScheduledExecutorServiceTtlWrapper (line 22) | @SuppressFBWarnings({"EQ_DOESNT_OVERRIDE_EQUALS"})
    method ScheduledExecutorServiceTtlWrapper (line 26) | public ScheduledExecutorServiceTtlWrapper(@NonNull ScheduledExecutorSe...
    method schedule (line 31) | @NonNull
    method schedule (line 37) | @NonNull
    method scheduleAtFixedRate (line 43) | @NonNull
    method scheduleWithFixedDelay (line 49) | @NonNull
    method unwrap (line 55) | @NonNull

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlExecutors.java
  class TtlExecutors (line 52) | public final class TtlExecutors {
    method getTtlExecutor (line 68) | @Nullable
    method getTtlExecutorService (line 87) | @Nullable
    method getTtlScheduledExecutorService (line 107) | @Nullable
    method isTtlExecutor (line 130) | public static <T extends Executor> boolean isTtlExecutor(@Nullable T e...
    method unwrapTtlExecutor (line 150) | @Nullable
    method getDisableInheritableThreadFactory (line 165) | @Nullable
    method getDefaultDisableInheritableThreadFactory (line 179) | @NonNull
    method isDisableInheritableThreadFactory (line 190) | public static boolean isDisableInheritableThreadFactory(@Nullable Thre...
    method unwrapDisableInheritableThreadFactory (line 203) | @Nullable
    method getDisableInheritableForkJoinWorkerThreadFactory (line 221) | @Nullable
    method getDefaultDisableInheritableForkJoinWorkerThreadFactory (line 236) | @NonNull
    method isDisableInheritableForkJoinWorkerThreadFactory (line 247) | public static boolean isDisableInheritableForkJoinWorkerThreadFactory(...
    method unwrapDisableInheritableForkJoinWorkerThreadFactory (line 257) | @Nullable
    method getTtlRunnableUnwrapComparator (line 286) | @Nullable
    method getTtlRunnableUnwrapComparatorForComparableRunnable (line 302) | @NonNull
    method isTtlRunnableUnwrapComparator (line 314) | public static boolean isTtlRunnableUnwrapComparator(@Nullable Comparat...
    method unwrapTtlRunnableUnwrapComparator (line 326) | @Nullable
    method TtlExecutors (line 334) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlUnwrapComparator.java
  class TtlUnwrapComparator (line 14) | final class TtlUnwrapComparator<T> implements Comparator<T>, TtlWrapper<...
    method TtlUnwrapComparator (line 17) | public TtlUnwrapComparator(@NonNull Comparator<T> comparator) {
    method compare (line 21) | @Override
    method unwrap (line 26) | @NonNull
    method equals (line 32) | @Override
    method hashCode (line 42) | @Override
    method toString (line 47) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/internal/util/Assert.java
  class Assert (line 70) | final class Assert {
    method state (line 83) | public static void state(boolean expression, String message) {
    method isTrue (line 98) | public static void isTrue(boolean expression, String message) {
    method notNull (line 112) | public static void notNull(@Nullable Object object, String message) {

FILE: ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ConcurrentReferenceHashMap.java
  class ConcurrentReferenceHashMap (line 75) | @SuppressWarnings("ALL")
    method ConcurrentReferenceHashMap (line 124) | public ConcurrentReferenceHashMap() {
    method ConcurrentReferenceHashMap (line 133) | public ConcurrentReferenceHashMap(int initialCapacity) {
    method ConcurrentReferenceHashMap (line 144) | public ConcurrentReferenceHashMap(int initialCapacity, float loadFacto...
    method ConcurrentReferenceHashMap (line 155) | public ConcurrentReferenceHashMap(int initialCapacity, int concurrency...
    method ConcurrentReferenceHashMap (line 165) | public ConcurrentReferenceHashMap(int initialCapacity, ReferenceType r...
    method ConcurrentReferenceHashMap (line 178) | public ConcurrentReferenceHashMap(int initialCapacity, float loadFacto...
    method ConcurrentReferenceHashMap (line 192) | @SuppressWarnings("unchecked")
    method getLoadFactor (line 215) | protected final float getLoadFactor() {
    method getSegmentsSize (line 219) | protected final int getSegmentsSize() {
    method getSegment (line 223) | protected final Segment getSegment(int index) {
    method createReferenceManager (line 233) | protected ReferenceManager createReferenceManager() {
    method getHash (line 245) | protected int getHash(@Nullable Object o) {
    method get (line 256) | @Override
    method getOrDefault (line 264) | @Override
    method containsKey (line 272) | @Override
    method getReference (line 287) | @Nullable
    method put (line 293) | @Override
    method putIfAbsent (line 299) | @Override
    method put (line 305) | @Nullable
    method remove (line 325) | @Override
    method remove (line 343) | @Override
    method replace (line 360) | @Override
    method replace (line 375) | @Override
    method clear (line 392) | @Override
    method purgeUnreferencedEntries (line 405) | public void purgeUnreferencedEntries() {
    method size (line 412) | @Override
    method isEmpty (line 421) | @Override
    method entrySet (line 431) | @Override
    method doTask (line 441) | @Nullable
    method getSegmentForHash (line 447) | private Segment getSegmentForHash(int hash) {
    method calculateShift (line 459) | protected static int calculateShift(int minimumValue, int maximumValue) {
    type ReferenceType (line 473) | public enum ReferenceType {
    class Segment (line 490) | @SuppressWarnings("serial")
      method Segment (line 516) | public Segment(int initialSize, int resizeThreshold) {
      method getReference (line 523) | @Nullable
      method doTask (line 547) | @Nullable
      method clear (line 581) | public void clear() {
      method restructureIfNecessary (line 602) | protected final void restructureIfNecessary(boolean allowResize) {
      method restructure (line 611) | private void restructure(boolean allowResize, @Nullable Reference<K,...
      method findInChain (line 670) | @Nullable
      method createReferenceArray (line 688) | @SuppressWarnings({"unchecked"})
      method getIndex (line 693) | private int getIndex(int hash, Reference<K, V>[] references) {
      method getSize (line 700) | public final int getSize() {
      method getCount (line 707) | public final int getCount() {
    type Reference (line 720) | protected interface Reference<K, V> {
      method get (line 725) | @Nullable
      method getHash (line 731) | int getHash();
      method getNext (line 736) | @Nullable
      method release (line 743) | void release();
    class Entry (line 753) | @SuppressFBWarnings("NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION")
      method Entry (line 762) | public Entry(@Nullable K key, @Nullable V value) {
      method getKey (line 767) | @Override
      method getValue (line 773) | @Override
      method setValue (line 779) | @Override
      method toString (line 787) | @Override
      method equals (line 792) | @Override
      method hashCode (line 806) | @Override
    class Task (line 816) | private abstract class Task<T> {
      method Task (line 820) | public Task(TaskOption... options) {
      method hasOption (line 824) | public boolean hasOption(TaskOption option) {
      method execute (line 837) | @Nullable
      method execute (line 850) | @Nullable
    type TaskOption (line 860) | private enum TaskOption {
    type Entries (line 869) | private interface Entries<V> {
      method add (line 876) | void add(@Nullable V value);
    class EntrySet (line 883) | private class EntrySet extends AbstractSet<Map.Entry<K, V>> {
      method iterator (line 885) | @Override
      method contains (line 890) | @Override
      method remove (line 903) | @Override
      method size (line 912) | @Override
      method clear (line 917) | @Override
    class EntryIterator (line 927) | private class EntryIterator implements Iterator<Map.Entry<K, V>> {
      method EntryIterator (line 945) | public EntryIterator() {
      method hasNext (line 949) | @Override
      method next (line 955) | @Override
      method getNextIfNecessary (line 966) | private void getNextIfNecessary() {
      method moveToNextReference (line 976) | private void moveToNextReference() {
      method moveToNextSegment (line 991) | private void moveToNextSegment() {
      method remove (line 1000) | @Override
    type Restructure (line 1012) | protected enum Restructure {
    class ReferenceManager (line 1022) | protected class ReferenceManager {
      method createReference (line 1034) | public Reference<K, V> createReference(Entry<K, V> entry, int hash, ...
      method pollForPurge (line 1049) | @SuppressWarnings("unchecked")
    class SoftEntryReference (line 1060) | private static final class SoftEntryReference<K, V> extends SoftRefere...
      method SoftEntryReference (line 1067) | public SoftEntryReference(Entry<K, V> entry, int hash, @Nullable Ref...
      method getHash (line 1075) | @Override
      method getNext (line 1080) | @Override
      method release (line 1086) | @Override
    class WeakEntryReference (line 1097) | private static final class WeakEntryReference<K, V> extends WeakRefere...
      method WeakEntryReference (line 1104) | public WeakEntryReference(Entry<K, V> entry, int hash, @Nullable Ref...
      method getHash (line 1112) | @Override
      method getNext (line 1117) | @Override
      method release (line 1123) | @Override

FILE: ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java
  class ObjectUtils (line 50) | final class ObjectUtils {
    method nullSafeEquals (line 72) | public static boolean nullSafeEquals(@Nullable Object o1, @Nullable Ob...
    method arrayEquals (line 98) | private static boolean arrayEquals(Object o1, Object o2) {
    method nullSafeHashCode (line 147) | public static int nullSafeHashCode(@Nullable Object obj) {
    method nullSafeHashCode (line 187) | public static int nullSafeHashCode(@Nullable Object[] array) {
    method nullSafeHashCode (line 202) | public static int nullSafeHashCode(@Nullable boolean[] array) {
    method nullSafeHashCode (line 217) | public static int nullSafeHashCode(@Nullable byte[] array) {
    method nullSafeHashCode (line 232) | public static int nullSafeHashCode(@Nullable char[] array) {
    method nullSafeHashCode (line 247) | public static int nullSafeHashCode(@Nullable double[] array) {
    method nullSafeHashCode (line 262) | public static int nullSafeHashCode(@Nullable float[] array) {
    method nullSafeHashCode (line 277) | public static int nullSafeHashCode(@Nullable int[] array) {
    method nullSafeHashCode (line 292) | public static int nullSafeHashCode(@Nullable long[] array) {
    method nullSafeHashCode (line 307) | public static int nullSafeHashCode(@Nullable short[] array) {

FILE: ttl-core/src/main/java/com/alibaba/ttl3/internal/util/Utils.java
  class Utils (line 22) | @ApiStatus.Internal
    method newHashMap (line 43) | public static <K, V> HashMap<K, V> newHashMap(int expectedSize) {
    method newConcurrentWeakHashMap (line 55) | public static <K, V> ConcurrentMap<K, V> newConcurrentWeakHashMap(int ...
    method computeMapInitialCapacity (line 59) | private static int computeMapInitialCapacity(int expectedSize) {
    method propagateIfFatal (line 67) | public static void propagateIfFatal(@Nullable Throwable throwable) {
    method sneakyThrow (line 78) | @SuppressWarnings("unchecked")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlAttachments.java
  type TtlAttachments (line 11) | public interface TtlAttachments extends TtlEnhanced {
    method setTtlAttachment (line 18) | void setTtlAttachment(@NonNull String key, Object value);
    method getTtlAttachment (line 25) | <T> T getTtlAttachment(@NonNull String key);

FILE: ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlAttachmentsDelegate.java
  class TtlAttachmentsDelegate (line 17) | public class TtlAttachmentsDelegate implements TtlAttachments {
    method setTtlAttachment (line 20) | @Override
    method getTtlAttachment (line 25) | @Override
    method isAutoWrapper (line 36) | public static boolean isAutoWrapper(@Nullable Object ttlAttachments) {
    method setAutoWrapperAttachment (line 48) | public static void setAutoWrapperAttachment(@Nullable Object ttlAttach...
    method unwrapIfIsAutoWrapper (line 57) | @Nullable

FILE: ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlEnhanced.java
  type TtlEnhanced (line 14) | public interface TtlEnhanced {

FILE: ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlWrapper.java
  type TtlWrapper (line 28) | public interface TtlWrapper<T> extends TtlEnhanced {
    method unwrap (line 34) | @NonNull

FILE: ttl-core/src/main/java/com/alibaba/ttl3/transmitter/ThreadLocalTransmitRegistry.java
  class ThreadLocalTransmitRegistry (line 53) | public final class ThreadLocalTransmitRegistry {
    method registerThreadLocal (line 77) | public static <T> boolean registerThreadLocal(@NonNull ThreadLocal<T> ...
    method registerThreadLocal (line 100) | @SuppressWarnings("unchecked")
    method unregisterThreadLocal (line 125) | public static <T> boolean unregisterThreadLocal(@NonNull ThreadLocal<T...
    class ThreadLocalTransmittee (line 142) | private static class ThreadLocalTransmittee implements Transmittee<Has...
      method capture (line 145) | @NonNull
      method replay (line 158) | @NonNull
      method clear (line 175) | @NonNull
      method restore (line 188) | @Override
    method ThreadLocalTransmitRegistry (line 203) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmittee.java
  type Transmittee (line 22) | public interface Transmittee<C, B> extends Transmittable<C, B> {
    method capture (line 34) | @NonNull
    method replay (line 49) | @NonNull
    method clear (line 71) | @NonNull
    method restore (line 84) | void restore(@NonNull B backup);

FILE: ttl-core/src/main/java/com/alibaba/ttl3/transmitter/TransmitteeRegistry.java
  class TransmitteeRegistry (line 29) | public final class TransmitteeRegistry {
    method registerTransmittee (line 38) | public static <C, B> boolean registerTransmittee(@NonNull Transmittee<...
    method unregisterTransmittee (line 50) | public static <C, B> boolean unregisterTransmittee(@NonNull Transmitte...
    method TransmitteeRegistry (line 54) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java
  class Transmitter (line 111) | public final class Transmitter {
    method capture (line 121) | @NonNull
    method replay (line 134) | @NonNull
    method clear (line 155) | @NonNull
    method restore (line 168) | public static void restore(@NonNull Backup backup) {
    method runSupplierWithCaptured (line 183) | public static <R> R runSupplierWithCaptured(@NonNull Capture captured,...
    method runSupplierWithClear (line 201) | public static <R> R runSupplierWithClear(@NonNull Supplier<R> bizLogic) {
    method runCallableWithCaptured (line 222) | @SuppressFBWarnings("THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION")
    method runCallableWithClear (line 242) | @SuppressFBWarnings("THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION")
    method registerCallback (line 258) | public static boolean registerCallback(@NonNull TransmitCallback callb...
    method unregisterCallback (line 268) | public static boolean unregisterCallback(@NonNull TransmitCallback cal...
    method Transmitter (line 272) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl-core/src/test/java/com/alibaba/demo/ttl3/CustomizedBlockingQueueWithTtlDemo.java
  class CustomizedBlockingQueueWithTtlDemo (line 16) | public class CustomizedBlockingQueueWithTtlDemo {
    method main (line 17) | public static void main(String[] args) throws Exception {
    class MyTask (line 34) | private static class MyTask implements Runnable {
      method MyTask (line 37) | private MyTask(String msg) {
      method run (line 41) | @Override
    class MyBlockingQueue (line 47) | private static class MyBlockingQueue extends ArrayBlockingQueue<Runnab...
      method MyBlockingQueue (line 48) | public MyBlockingQueue() {
      method offer (line 52) | @Override
      method put (line 71) | @Override

FILE: ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/TransmittableThreadLocal_withInit_Null_Test.java
  class TransmittableThreadLocal_withInit_Null_Test (line 11) | public class TransmittableThreadLocal_withInit_Null_Test {
    method test_null__withInitial (line 13) | @Test
    method test_null__withInitialAndGenerator_2 (line 23) | @Test
    method test_null__withInitialAndGenerator_3 (line 40) | @Test

FILE: ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/SampleMain.java
  class SampleMain (line 6) | public class SampleMain {
    method main (line 11) | public static void main(String[] args) throws Exception {

FILE: ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/ToBeTransformedClass.java
  class ToBeTransformedClass (line 3) | public class ToBeTransformedClass {
    method toBeTransformedMethod (line 4) | public int toBeTransformedMethod(int input) {

FILE: ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/transformlet/SampleExtensionTransformlet.java
  class SampleExtensionTransformlet (line 24) | public class SampleExtensionTransformlet implements TtlTransformlet {
    method doTransform (line 30) | public void doTransform(ClassInfo classInfo) throws IOException, NotFo...

FILE: ttl-integrations/sample-ttl-agent-extension-transformlet/src/test/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/ToBeTransformedClassTest.java
  class ToBeTransformedClassTest (line 10) | public class ToBeTransformedClassTest {
    method test_method1 (line 11) | @Test

FILE: ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/TtlVertxHandler.java
  class TtlVertxHandler (line 34) | public class TtlVertxHandler<E> implements Handler<E>, TtlWrapper<Handle...
    method TtlVertxHandler (line 39) | private TtlVertxHandler(@NonNull Handler<E> handler, boolean releaseTt...
    method handle (line 48) | @Override
    method getHandler (line 66) | @NonNull
    method unwrap (line 76) | @NonNull
    method equals (line 82) | @Override
    method hashCode (line 97) | @Override
    method toString (line 102) | @Override
    method get (line 114) | @Nullable
    method get (line 127) | @Nullable
    method get (line 143) | @Nullable
    method gets (line 167) | @NonNull
    method gets (line 180) | @NonNull
    method gets (line 196) | @NonNull
    method unwrap (line 220) | @Nullable
    method unwraps (line 239) | @NonNull
    method setTtlAttachment (line 261) | @Override
    method getTtlAttachment (line 269) | @Override

FILE: ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/agent/transformlet/NettySingleThreadEventExecutorTtlTransformlet.java
  class NettySingleThreadEventExecutorTtlTransformlet (line 18) | public final class NettySingleThreadEventExecutorTtlTransformlet extends...
    method getExecutorClassNames (line 20) | private static Set<String> getExecutorClassNames() {
    method NettySingleThreadEventExecutorTtlTransformlet (line 28) | public NettySingleThreadEventExecutorTtlTransformlet() {

FILE: ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/agent/transformlet/VertxFutureTtlTransformlet.java
  class VertxFutureTtlTransformlet (line 27) | public class VertxFutureTtlTransformlet implements TtlTransformlet {
    method doTransform (line 47) | @Override
    method updateSetHandlerMethodsOfFutureClass_decorateToTtlWrapperAndSetAutoWrapperAttachment (line 58) | private void updateSetHandlerMethodsOfFutureClass_decorateToTtlWrapper...
    method checkMethodNeedToBeDecorated (line 82) | private boolean checkMethodNeedToBeDecorated(int modifiers) {

FILE: ttl-integrations/vertx3-ttl-integration/src/test/java/com/alibaba/ttl/integration/vertx3/VertxTransformletTest.java
  class VertxTransformletTest (line 16) | public class VertxTransformletTest {
    method testTransmitThreadLocal_InEventbus (line 17) | @Test
    method testCallbackInHttpClient (line 61) | @Test
    method testCallbackInVertxImpl (line 98) | @Test

FILE: ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/TtlVertxHandler.java
  class TtlVertxHandler (line 34) | public class TtlVertxHandler<E> implements Handler<E>, TtlWrapper<Handle...
    method TtlVertxHandler (line 39) | private TtlVertxHandler(@NonNull Handler<E> handler, boolean releaseTt...
    method handle (line 48) | @Override
    method getHandler (line 66) | @NonNull
    method unwrap (line 76) | @NonNull
    method equals (line 82) | @Override
    method hashCode (line 97) | @Override
    method toString (line 102) | @Override
    method get (line 114) | @Nullable
    method get (line 127) | @Nullable
    method get (line 143) | @Nullable
    method gets (line 167) | @NonNull
    method gets (line 180) | @NonNull
    method gets (line 196) | @NonNull
    method unwrap (line 220) | @Nullable
    method unwraps (line 239) | @NonNull
    method setTtlAttachment (line 261) | @Override
    method getTtlAttachment (line 269) | @Override

FILE: ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/agent/transformlet/NettySingleThreadEventExecutorTtlTransformlet.java
  class NettySingleThreadEventExecutorTtlTransformlet (line 18) | public final class NettySingleThreadEventExecutorTtlTransformlet extends...
    method getExecutorClassNames (line 20) | private static Set<String> getExecutorClassNames() {
    method NettySingleThreadEventExecutorTtlTransformlet (line 28) | public NettySingleThreadEventExecutorTtlTransformlet() {

FILE: ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/agent/transformlet/VertxFutureTtlTransformlet.java
  class VertxFutureTtlTransformlet (line 27) | public class VertxFutureTtlTransformlet implements TtlTransformlet {
    method doTransform (line 42) | @Override
    method updateSetHandlerMethodsOfFutureClass_decorateToTtlWrapperAndSetAutoWrapperAttachment (line 53) | private void updateSetHandlerMethodsOfFutureClass_decorateToTtlWrapper...
    method checkMethodNeedToBeDecorated (line 77) | private boolean checkMethodNeedToBeDecorated(int modifiers) {

FILE: ttl-integrations/vertx4-ttl-integration/src/test/java/com/alibaba/ttl/integration/vertx4/VertxTransformletTest.java
  class VertxTransformletTest (line 23) | public class VertxTransformletTest {
    method testTransmitThreadLocal_InEventbus (line 24) | @Test
    method testCallback (line 70) | @Test

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TransmittableThreadLocal.java
  class TransmittableThreadLocal (line 69) | public class TransmittableThreadLocal<T> extends InheritableThreadLocal<...
    method TransmittableThreadLocal (line 102) | public TransmittableThreadLocal() {
    method TransmittableThreadLocal (line 114) | public TransmittableThreadLocal(boolean disableIgnoreNullValueSemantic...
    method withInitial (line 130) | @NonNull
    method withInitialAndCopier (line 153) | @NonNull
    method withInitialAndCopier (line 185) | @NonNull
    class SuppliedTransmittableThreadLocal (line 200) | private static final class SuppliedTransmittableThreadLocal<T> extends...
      method SuppliedTransmittableThreadLocal (line 205) | SuppliedTransmittableThreadLocal(Supplier<? extends T> supplier, Ttl...
      method initialValue (line 212) | @Override
      method childValue (line 217) | @Override
      method copy (line 223) | @Override
    method copy (line 243) | public T copy(T parentValue) {
    method beforeExecute (line 257) | protected void beforeExecute() {
    method afterExecute (line 270) | protected void afterExecute() {
    method get (line 276) | @Override
    method set (line 286) | @Override
    method remove (line 300) | @Override
    method superRemove (line 306) | private void superRemove() {
    method copyValue (line 310) | private T copyValue() {
    method initialValue (line 322) | @Override
    method childValue (line 327) | @Override
    method addThisToHolder (line 333) | @SuppressWarnings("unchecked")
    method removeThisFromHolder (line 340) | private void removeThisFromHolder() {
    method doExecuteCallback (line 344) | private static void doExecuteCallback(boolean isBefore) {
    method dump (line 364) | @TestOnly
    method dump (line 381) | @TestOnly
    class Transmitter (line 494) | public static class Transmitter {
      method capture (line 501) | @NonNull
      method replay (line 526) | @NonNull
      method clear (line 563) | @NonNull
      method restore (line 588) | public static void restore(@NonNull Object backup) {
      class Snapshot (line 603) | private static class Snapshot {
        method Snapshot (line 606) | public Snapshot(HashMap<Transmittee<Object, Object>, Object> trans...
      method registerTransmittee (line 620) | @SuppressWarnings("unchecked")
      method unregisterTransmittee (line 634) | @SuppressWarnings("unchecked")
      type Transmittee (line 651) | public interface Transmittee<C, B> {
        method capture (line 664) | @NonNull
        method replay (line 680) | @NonNull
        method clear (line 703) | @NonNull
        method restore (line 717) | void restore(@NonNull B backup);
      method capture (line 722) | @NonNull
      method replay (line 732) | @NonNull
      method clear (line 760) | @NonNull
      method restore (line 766) | @Override
      method setTtlValuesTo (line 787) | private static void setTtlValuesTo(@NonNull HashMap<TransmittableThr...
      method capture (line 796) | @NonNull
      method replay (line 809) | @NonNull
      method clear (line 826) | @NonNull
      method restore (line 839) | @Override
      method runSupplierWithCaptured (line 867) | public static <R> R runSupplierWithCaptured(@NonNull Object captured...
      method runSupplierWithClear (line 886) | public static <R> R runSupplierWithClear(@NonNull Supplier<R> bizLog...
      method runCallableWithCaptured (line 908) | @SuppressFBWarnings("THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION")
      method runCallableWithClear (line 929) | @SuppressFBWarnings("THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION")
      method registerThreadLocal (line 961) | public static <T> boolean registerThreadLocal(@NonNull ThreadLocal<T...
      method registerThreadLocalWithShadowCopier (line 987) | @SuppressWarnings("unchecked")
      method registerThreadLocal (line 1012) | @SuppressWarnings("unchecked")
      method registerThreadLocalWithShadowCopier (line 1053) | @SuppressWarnings("unchecked")
      method unregisterThreadLocal (line 1068) | public static <T> boolean unregisterThreadLocal(@NonNull ThreadLocal...
      method Transmitter (line 1086) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlCallable.java
  class TtlCallable (line 41) | public final class TtlCallable<V> implements Callable<V>, TtlWrapper<Cal...
    method TtlCallable (line 46) | private TtlCallable(@NonNull Callable<V> callable, boolean releaseTtlV...
    method call (line 55) | @Override
    method getCallable (line 74) | @NonNull
    method unwrap (line 85) | @NonNull
    method equals (line 91) | @Override
    method hashCode (line 101) | @Override
    method toString (line 106) | @Override
    method get (line 119) | @Nullable
    method get (line 135) | @Nullable
    method get (line 151) | @Nullable
    method gets (line 170) | @NonNull
    method gets (line 182) | @NonNull
    method gets (line 195) | @NonNull
    method unwrap (line 218) | @Nullable
    method unwraps (line 236) | @NonNull
    method setTtlAttachment (line 255) | @Override
    method getTtlAttachment (line 265) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlCopier.java
  type TtlCopier (line 12) | @FunctionalInterface
    method copy (line 28) | T copy(T parentValue);

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlEnhanced.java
  type TtlEnhanced (line 9) | @Deprecated

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRecursiveAction.java
  class TtlRecursiveAction (line 22) | public abstract class TtlRecursiveAction extends ForkJoinTask<Void> impl...
    method TtlRecursiveAction (line 28) | protected TtlRecursiveAction() {
    method compute (line 34) | protected abstract void compute();
    method getRawResult (line 39) | public final Void getRawResult() {
    method setRawResult (line 46) | protected final void setRawResult(Void mustBeNull) {
    method exec (line 52) | protected final boolean exec() {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRecursiveTask.java
  class TtlRecursiveTask (line 22) | public abstract class TtlRecursiveTask<V> extends ForkJoinTask<V> implem...
    method TtlRecursiveTask (line 28) | protected TtlRecursiveTask() {
    method compute (line 41) | protected abstract V compute();
    method getRawResult (line 46) | public final V getRawResult() {
    method setRawResult (line 53) | protected final void setRawResult(V value) {
    method exec (line 60) | protected final boolean exec() {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRunnable.java
  class TtlRunnable (line 37) | public final class TtlRunnable implements Runnable, TtlWrapper<Runnable>...
    method TtlRunnable (line 42) | private TtlRunnable(@NonNull Runnable runnable, boolean releaseTtlValu...
    method run (line 51) | @Override
    method getRunnable (line 69) | @NonNull
    method unwrap (line 80) | @NonNull
    method equals (line 86) | @Override
    method hashCode (line 96) | @Override
    method toString (line 101) | @Override
    method get (line 113) | @Nullable
    method get (line 127) | @Nullable
    method get (line 144) | @Nullable
    method gets (line 164) | @NonNull
    method gets (line 177) | @NonNull
    method gets (line 193) | @NonNull
    method unwrap (line 216) | @Nullable
    method unwraps (line 234) | @NonNull
    method setTtlAttachment (line 253) | @Override
    method getTtlAttachment (line 263) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlTimerTask.java
  class TtlTimerTask (line 32) | @Deprecated
    method TtlTimerTask (line 38) | private TtlTimerTask(@NonNull TimerTask timerTask, boolean releaseTtlV...
    method run (line 47) | @Override
    method cancel (line 62) | @Override
    method getTimerTask (line 71) | @NonNull
    method unwrap (line 82) | @NonNull
    method equals (line 88) | @Override
    method hashCode (line 98) | @Override
    method toString (line 103) | @Override
    method get (line 116) | @Nullable
    method get (line 131) | @Nullable
    method get (line 147) | @Nullable
    method unwrap (line 169) | @Nullable
    method unwraps (line 186) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlUnwrap.java
  class TtlUnwrap (line 29) | public final class TtlUnwrap {
    method unwrap (line 50) | @Nullable
    method isWrapper (line 64) | public static <T> boolean isWrapper(@Nullable T obj) {
    method TtlUnwrap (line 68) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/TtlWrappers.java
  class TtlWrappers (line 31) | public final class TtlWrappers {
    method wrapSupplier (line 40) | @Nullable
    method wrap (line 59) | @Deprecated
    class TtlSupplier (line 66) | private static class TtlSupplier<T> implements Supplier<T>, TtlWrapper...
      method TtlSupplier (line 70) | TtlSupplier(@NonNull Supplier<T> supplier) {
      method get (line 75) | @Override
      method unwrap (line 85) | @NonNull
      method equals (line 91) | @Override
      method hashCode (line 101) | @Override
      method toString (line 106) | @Override
    method wrapConsumer (line 121) | @Nullable
    method wrap (line 140) | @Deprecated
    class TtlConsumer (line 147) | private static class TtlConsumer<T> implements Consumer<T>, TtlWrapper...
      method TtlConsumer (line 151) | TtlConsumer(@NonNull Consumer<T> consumer) {
      method accept (line 156) | @Override
      method unwrap (line 166) | @NonNull
      method equals (line 172) | @Override
      method hashCode (line 182) | @Override
      method toString (line 187) | @Override
    method wrapBiConsumer (line 202) | @Nullable
    method wrap (line 221) | @Deprecated
    class TtlBiConsumer (line 228) | private static class TtlBiConsumer<T, U> implements BiConsumer<T, U>, ...
      method TtlBiConsumer (line 232) | TtlBiConsumer(@NonNull BiConsumer<T, U> consumer) {
      method accept (line 237) | @Override
      method unwrap (line 247) | @NonNull
      method equals (line 253) | @Override
      method hashCode (line 263) | @Override
      method toString (line 268) | @Override
    method wrapFunction (line 283) | @Nullable
    method wrap (line 302) | @Deprecated
    class TtlFunction (line 309) | private static class TtlFunction<T, R> implements Function<T, R>, TtlW...
      method TtlFunction (line 313) | TtlFunction(@NonNull Function<T, R> fn) {
      method apply (line 318) | @Override
      method unwrap (line 328) | @NonNull
      method equals (line 334) | @Override
      method hashCode (line 344) | @Override
      method toString (line 349) | @Override
    method wrapBiFunction (line 364) | @Nullable
    method wrap (line 383) | @Deprecated
    class TtlBiFunction (line 390) | private static class TtlBiFunction<T, U, R> implements BiFunction<T, U...
      method TtlBiFunction (line 394) | TtlBiFunction(@NonNull BiFunction<T, U, R> fn) {
      method apply (line 399) | @Override
      method unwrap (line 409) | @NonNull
      method equals (line 415) | @Override
      method hashCode (line 425) | @Override
      method toString (line 430) | @Override
    method TtlWrappers (line 437) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlAttachments.java
  type TtlAttachments (line 12) | public interface TtlAttachments extends TtlEnhanced {
    method setTtlAttachment (line 20) | void setTtlAttachment(@NonNull String key, Object value);
    method getTtlAttachment (line 28) | <T> T getTtlAttachment(@NonNull String key);

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlAttachmentsDelegate.java
  class TtlAttachmentsDelegate (line 18) | public class TtlAttachmentsDelegate implements TtlAttachments {
    method setTtlAttachment (line 21) | @Override
    method getTtlAttachment (line 26) | @Override
    method isAutoWrapper (line 38) | public static boolean isAutoWrapper(@Nullable Object ttlAttachments) {
    method setAutoWrapperAttachment (line 51) | public static void setAutoWrapperAttachment(@Nullable Object ttlAttach...
    method unwrapIfIsAutoWrapper (line 61) | @Nullable

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlEnhanced.java
  type TtlEnhanced (line 15) | public interface TtlEnhanced {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlWrapper.java
  type TtlWrapper (line 25) | public interface TtlWrapper<T> extends TtlEnhanced {
    method unwrap (line 31) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ComparableComparator.java
  class ComparableComparator (line 54) | class ComparableComparator<E extends Comparable<? super E>> implements C...
    method comparableComparator (line 75) | @SuppressWarnings("unchecked")
    method ComparableComparator (line 86) | public ComparableComparator() {
    method compare (line 104) | @Override
    method hashCode (line 117) | @Override
    method equals (line 135) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableForkJoinWorkerThreadFactory.java
  type DisableInheritableForkJoinWorkerThreadFactory (line 14) | public interface DisableInheritableForkJoinWorkerThreadFactory extends F...
    method unwrap (line 18) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableForkJoinWorkerThreadFactoryWrapper.java
  class DisableInheritableForkJoinWorkerThreadFactoryWrapper (line 16) | class DisableInheritableForkJoinWorkerThreadFactoryWrapper implements Di...
    method DisableInheritableForkJoinWorkerThreadFactoryWrapper (line 19) | DisableInheritableForkJoinWorkerThreadFactoryWrapper(@NonNull ForkJoin...
    method newThread (line 23) | @Override
    method unwrap (line 33) | @Override
    method equals (line 39) | @Override
    method hashCode (line 49) | @Override
    method toString (line 54) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableThreadFactory.java
  type DisableInheritableThreadFactory (line 15) | public interface DisableInheritableThreadFactory extends ThreadFactory, ...
    method unwrap (line 19) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableThreadFactoryWrapper.java
  class DisableInheritableThreadFactoryWrapper (line 14) | class DisableInheritableThreadFactoryWrapper implements DisableInheritab...
    method DisableInheritableThreadFactoryWrapper (line 17) | DisableInheritableThreadFactoryWrapper(@NonNull ThreadFactory threadFa...
    method newThread (line 21) | @Override
    method unwrap (line 31) | @NonNull
    method equals (line 37) | @Override
    method hashCode (line 47) | @Override
    method toString (line 52) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ExecutorServiceTtlWrapper.java
  class ExecutorServiceTtlWrapper (line 22) | @SuppressFBWarnings({"EQ_DOESNT_OVERRIDE_EQUALS"})
    method ExecutorServiceTtlWrapper (line 26) | ExecutorServiceTtlWrapper(@NonNull ExecutorService executorService, bo...
    method shutdown (line 31) | @Override
    method shutdownNow (line 36) | @NonNull
    method isShutdown (line 42) | @Override
    method isTerminated (line 47) | @Override
    method awaitTermination (line 52) | @Override
    method submit (line 57) | @NonNull
    method submit (line 63) | @NonNull
    method submit (line 69) | @NonNull
    method invokeAll (line 75) | @NonNull
    method invokeAll (line 81) | @NonNull
    method invokeAny (line 87) | @NonNull
    method invokeAny (line 93) | @Override
    method unwrap (line 98) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ExecutorTtlWrapper.java
  class ExecutorTtlWrapper (line 19) | class ExecutorTtlWrapper implements Executor, TtlWrapper<Executor>, TtlE...
    method ExecutorTtlWrapper (line 23) | ExecutorTtlWrapper(@NonNull Executor executor, boolean idempotent) {
    method execute (line 28) | @Override
    method unwrap (line 33) | @NonNull
    method equals (line 39) | @Override
    method hashCode (line 49) | @Override
    method toString (line 54) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ScheduledExecutorServiceTtlWrapper.java
  class ScheduledExecutorServiceTtlWrapper (line 23) | @SuppressFBWarnings({"EQ_DOESNT_OVERRIDE_EQUALS"})
    method ScheduledExecutorServiceTtlWrapper (line 27) | public ScheduledExecutorServiceTtlWrapper(@NonNull ScheduledExecutorSe...
    method schedule (line 32) | @NonNull
    method schedule (line 38) | @NonNull
    method scheduleAtFixedRate (line 44) | @NonNull
    method scheduleWithFixedDelay (line 50) | @NonNull
    method unwrap (line 56) | @NonNull

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlExecutors.java
  class TtlExecutors (line 48) | public final class TtlExecutors {
    method getTtlExecutor (line 66) | @Nullable
    method getTtlExecutorService (line 92) | @Nullable
    method getTtlScheduledExecutorService (line 119) | @Nullable
    method isTtlWrapper (line 143) | public static <T extends Executor> boolean isTtlWrapper(@Nullable T ex...
    method unwrap (line 164) | @Nullable
    method getDisableInheritableThreadFactory (line 181) | @Nullable
    method getDefaultDisableInheritableThreadFactory (line 196) | @NonNull
    method isDisableInheritableThreadFactory (line 209) | public static boolean isDisableInheritableThreadFactory(@Nullable Thre...
    method unwrap (line 224) | @Nullable
    method getTtlRunnableUnwrapComparator (line 250) | @Nullable
    method getTtlRunnableUnwrapComparatorForComparableRunnable (line 267) | @NonNull
    method isTtlRunnableUnwrapComparator (line 280) | public static boolean isTtlRunnableUnwrapComparator(@Nullable Comparat...
    method unwrap (line 293) | @Nullable
    method TtlExecutors (line 301) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlForkJoinPoolHelper.java
  class TtlForkJoinPoolHelper (line 29) | public final class TtlForkJoinPoolHelper {
    method getDisableInheritableForkJoinWorkerThreadFactory (line 38) | @Nullable
    method getDefaultDisableInheritableForkJoinWorkerThreadFactory (line 54) | @NonNull
    method isDisableInheritableForkJoinWorkerThreadFactory (line 67) | public static boolean isDisableInheritableForkJoinWorkerThreadFactory(...
    method unwrap (line 79) | @Nullable
    method TtlForkJoinPoolHelper (line 87) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlUnwrapComparator.java
  class TtlUnwrapComparator (line 15) | final class TtlUnwrapComparator<T> implements Comparator<T>, TtlWrapper<...
    method TtlUnwrapComparator (line 18) | public TtlUnwrapComparator(@NonNull Comparator<T> comparator) {
    method compare (line 22) | @Override
    method unwrap (line 27) | @NonNull
    method equals (line 33) | @Override
    method hashCode (line 43) | @Override
    method toString (line 48) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java
  class TtlAgent (line 154) | public final class TtlAgent {
    method premain (line 200) | public static void premain(final String agentArgs, @NonNull final Inst...
    method logTtlAgentConfig (line 234) | private static String logTtlAgentConfig() {
    method isTtlAgentLoaded (line 247) | public static boolean isTtlAgentLoaded() {
    method isDisableInheritableForThreadPool (line 268) | public static boolean isDisableInheritableForThreadPool() {
    method isEnableTimerTask (line 284) | public static boolean isEnableTimerTask() {
    method isLogClassTransform (line 298) | public static boolean isLogClassTransform() {
    method getLoggerType (line 315) | @NonNull
    method isBooleanOptionSet (line 331) | public static boolean isBooleanOptionSet(@NonNull String key) {
    method isBooleanOptionSet (line 341) | public static boolean isBooleanOptionSet(@NonNull String key, boolean ...
    method getStringOptionValue (line 357) | @NonNull
    method getOptionStringListValues (line 374) | @NonNull
    method TtlAgent (line 380) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgentHelper.java
  class TtlAgentHelper (line 13) | final class TtlAgentHelper {
    method isBooleanOptionSet (line 17) | static boolean isBooleanOptionSet(
    method isBooleanOptionSet (line 24) | static boolean isBooleanOptionSet(
    method getStringOptionValue (line 48) | @NonNull
    method getOptionStringListValues (line 73) | @NonNull
    method splitCommaColonStringToKV (line 95) | @NonNull
    method splitListStringToStringList (line 115) | @NonNull
    method TtlAgentHelper (line 131) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlExtensionTransformletManager.java
  class TtlExtensionTransformletManager (line 26) | final class TtlExtensionTransformletManager {
    method TtlExtensionTransformletManager (line 31) | public TtlExtensionTransformletManager() {
    method extensionTransformletDoTransform (line 34) | public String extensionTransformletDoTransform(@NonNull final ClassInf...
    method collectExtensionTransformlet (line 62) | public void collectExtensionTransformlet(@NonNull final ClassInfo clas...
    method readExtensionTransformletClassNames (line 90) | private LinkedHashSet<String> readExtensionTransformletClassNames(Clas...
    method mergeToClassLoader2ExtensionTransformlet (line 103) | private static void mergeToClassLoader2ExtensionTransformlet(
    method updateClassLoader2ExtensionTransformletsIncludeParentCL (line 122) | static void updateClassLoader2ExtensionTransformletsIncludeParentCL(
    method childClassLoaderFirstMergeTransformlets (line 133) | static Map<String, TtlTransformlet> childClassLoaderFirstMergeTransfor...
    method loadExtensionInstances (line 158) | static <T> Map<ClassLoader, Set<T>> loadExtensionInstances(
    method readLinesFromExtensionFiles (line 200) | @NonNull
    method readLines (line 232) | @SuppressWarnings("StatementWithEmptyBody")
    method parseLine (line 261) | private static int parseLine(URL url, BufferedReader reader, int lineN...
    class Pair (line 299) | static class Pair<T, U> {
      method Pair (line 303) | public Pair(T first, U second) {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlTransformer.java
  class TtlTransformer (line 25) | public class TtlTransformer implements ClassFileTransformer {
    method TtlTransformer (line 42) | TtlTransformer(List<? extends TtlTransformlet> transformletList, boole...
    method transform (line 57) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/logging/Logger.java
  class Logger (line 15) | public abstract class Logger {
    method setLoggerImplType (line 21) | public static void setLoggerImplType(String type) {
    method setLoggerImplTypeIfNotSetYet (line 34) | public static void setLoggerImplTypeIfNotSetYet(String type) {
    method getLogger (line 38) | public static Logger getLogger(Class<?> clazz) {
    method Logger (line 51) | private Logger(Class<?> logClass) {
    method info (line 55) | public void info(String msg) {
    method warn (line 59) | public void warn(String msg) {
    method warn (line 63) | public void warn(String msg, Throwable thrown) {
    method error (line 67) | public void error(String msg) {
    method error (line 71) | public void error(String msg, Throwable thrown) {
    method log (line 75) | protected abstract void log(Level level, String msg, Throwable thrown);
    class StdErrorLogger (line 77) | private static class StdErrorLogger extends Logger {
      method StdErrorLogger (line 78) | StdErrorLogger(Class<?> clazz) {
      method log (line 82) | @Override
    class StdOutLogger (line 92) | private static class StdOutLogger extends Logger {
      method StdOutLogger (line 93) | StdOutLogger(Class<?> clazz) {
      method log (line 97) | @Override

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/ClassInfo.java
  class ClassInfo (line 25) | public class ClassInfo {
    method ClassInfo (line 35) | public ClassInfo(@NonNull String transformerClassFile,
    method getClassName (line 44) | @NonNull
    method getLocationUrl (line 51) | public URL getLocationUrl() throws IOException {
    method getCtClass (line 55) | @NonNull
    method isModified (line 79) | public boolean isModified() {
    method setModified (line 83) | public void setModified() {
    method getClassLoader (line 87) | @SuppressFBWarnings({"EI_EXPOSE_REP"})
    method toClassName (line 95) | private static String toClassName(@NonNull final String classFile) {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/TtlTransformlet.java
  type TtlTransformlet (line 15) | public interface TtlTransformlet {
    method doTransform (line 24) | void doTransform(@NonNull ClassInfo classInfo) throws CannotCompileExc...

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/helper/AbstractExecutorTtlTransformlet.java
  class AbstractExecutorTtlTransformlet (line 35) | public abstract class AbstractExecutorTtlTransformlet implements TtlTran...
    method AbstractExecutorTtlTransformlet (line 55) | public AbstractExecutorTtlTransformlet(Set<String> executorClassNames,...
    method doTransform (line 63) | @Override
    method updateSubmitMethodsOfExecutorClass_decorateToTtlWrapperAndSetAutoWrapperAttachment (line 96) | @SuppressFBWarnings("VA_FORMAT_STRING_USES_NEWLINE") // [ERROR] Format...
    method updateConstructorDisableInheritable (line 124) | private void updateConstructorDisableInheritable(@NonNull final CtClas...
    method updateBeforeAndAfterExecuteMethodOfExecutorSubclass (line 146) | private boolean updateBeforeAndAfterExecuteMethodOfExecutorSubclass(@N...

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/helper/TtlTransformletHelper.java
  class TtlTransformletHelper (line 28) | public final class TtlTransformletHelper {
    method signatureOfMethod (line 40) | @NonNull
    method getLocationUrlOfClass (line 62) | public static URL getLocationUrlOfClass(CtClass clazz) {
    method getLocationFileOfClass (line 74) | public static String getLocationFileOfClass(CtClass clazz) {
    method getLocationUrlOfClass (line 81) | public static URL getLocationUrlOfClass(Class<?> clazz) {
    method getLocationFileOfClass (line 99) | public static String getLocationFileOfClass(Class<?> clazz) {
    method renamedMethodNameByTtl (line 108) | @NonNull
    method addTryFinallyToMethod (line 113) | public static String addTryFinallyToMethod(@NonNull CtMethod method, @...
    method addTryFinallyToMethod (line 122) | public static String addTryFinallyToMethod(@NonNull CtMethod method, @...
    method doCaptureIfNotTtlEnhanced (line 155) | @Nullable
    method doAutoWrap (line 163) | @Nullable
    method doAutoWrap (line 176) | @Nullable
    method getPackageName (line 190) | @NonNull
    method isClassAtPackage (line 198) | public static boolean isClassAtPackage(@NonNull String className, @Non...
    method isClassUnderPackage (line 202) | public static boolean isClassUnderPackage(@NonNull String className, @...
    method isClassAtPackageJavaUtil (line 207) | public static boolean isClassAtPackageJavaUtil(@NonNull String classNa...
    method TtlTransformletHelper (line 211) | @SuppressFBWarnings("CT_CONSTRUCTOR_THROW")

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/ForkJoinTtlTransformlet.java
  class ForkJoinTtlTransformlet (line 24) | public final class ForkJoinTtlTransformlet implements TtlTransformlet {
    method ForkJoinTtlTransformlet (line 33) | public ForkJoinTtlTransformlet() {
    method doTransform (line 37) | @Override
    method updateForkJoinTaskClass (line 51) | private void updateForkJoinTaskClass(@NonNull final CtClass clazz) thr...
    method updateConstructorDisableInheritable (line 74) | private void updateConstructorDisableInheritable(@NonNull final CtClas...

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/JdkExecutorTtlTransformlet.java
  class JdkExecutorTtlTransformlet (line 20) | public final class JdkExecutorTtlTransformlet extends AbstractExecutorTt...
    method getExecutorClassNames (line 22) | private static Set<String> getExecutorClassNames() {
    method JdkExecutorTtlTransformlet (line 31) | public JdkExecutorTtlTransformlet() {

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/PriorityBlockingQueueTtlTransformlet.java
  class PriorityBlockingQueueTtlTransformlet (line 41) | public class PriorityBlockingQueueTtlTransformlet implements TtlTransfor...
    method doTransform (line 48) | @Override
    method updatePriorityBlockingQueueClass (line 63) | private void updatePriorityBlockingQueueClass(@NonNull final CtClass c...
    method updateBlockingQueueClass (line 75) | private void updateBlockingQueueClass(@NonNull final CtClass clazz) th...
    method haveComparatorField (line 84) | private static boolean haveComparatorField(CtClass clazz) {
    method modifyConstructors (line 103) | private static void modifyConstructors(@NonNull CtClass clazz) throws ...
    method overwriteComparatorField$by$ttl (line 115) | public static Comparator<Runnable> overwriteComparatorField$by$ttl(Com...

FILE: ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/TimerTaskTtlTransformlet.java
  class TimerTaskTtlTransformlet (line 22) | public final class TimerTaskTtlTransformlet implements TtlTransformlet {
    method doTransform (line 28) | @Override
    method updateTimerTaskClass (line 60) | private void updateTimerTaskClass(@NonNull final CtClass clazz) throws...

FILE: ttl2-compatible/src/test/java/com/alibaba/demo/ttl/CustomizedBlockingQueueWithTtlDemo.java
  class CustomizedBlockingQueueWithTtlDemo (line 15) | public class CustomizedBlockingQueueWithTtlDemo {
    method main (line 16) | public static void main(String[] args) throws Exception {
    class MyTask (line 33) | private static class MyTask implements Runnable {
      method MyTask (line 36) | private MyTask(String msg) {
      method run (line 40) | @Override
    class MyBlockingQueue (line 46) | private static class MyBlockingQueue extends ArrayBlockingQueue<Runnab...
      method MyBlockingQueue (line 47) | public MyBlockingQueue() {
      method offer (line 51) | @Override
      method put (line 70) | @Override

FILE: ttl2-compatible/src/test/java/com/alibaba/demo/ttl/TtlWrapperTypeInferenceProblemShowcase.java
  class TtlWrapperTypeInferenceProblemShowcase (line 13) | public class TtlWrapperTypeInferenceProblemShowcase {
    method wrapFunction (line 14) | @Test
    method foo (line 31) | private int foo(int i) {
    method buildSourceList (line 35) | private List<Integer> buildSourceList(int length) {

FILE: ttl2-compatible/src/test/java/com/alibaba/demo/ttl/agent/YourXxxAgent.java
  class YourXxxAgent (line 11) | public final class YourXxxAgent {
    method premain (line 14) | public static void premain(String agentArgs, Instrumentation inst) thr...

FILE: ttl2-compatible/src/test/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/UtilsTest.java
  class UtilsTest (line 10) | public class UtilsTest {
    method test_get_unboxing_boolean_fromMap (line 11) | @Test
    method getUnboxingBoolean (line 23) | private static boolean getUnboxingBoolean(Map<String, Object> map, Str...

FILE: ttl2-compatible/src/test/java/com/alibaba/user_api_test/ttl/TransmittableThreadLocal_withInit_Null_Test.java
  class TransmittableThreadLocal_withInit_Null_Test (line 11) | public class TransmittableThreadLocal_withInit_Null_Test {
    method test_null__withInitial (line 13) | @Test
    method test_null__withInitialAndCopier_2 (line 23) | @Test
    method test_null__withInitialAndCopier_3 (line 40) | @Test
Condensed preview — 281 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,255K chars).
[
  {
    "path": ".editorconfig",
    "chars": 469,
    "preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\n\ntab_width = 2\nindent_size = 2\nij_continua"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 234,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: maven\n    directory: \"/\"\n    schedule:\n      interval: daily\n    open-pull-re"
  },
  {
    "path": ".github/workflows/ci.yaml",
    "chars": 1954,
    "preview": "# Quickstart for GitHub Actions\n# https://docs.github.com/en/actions/quickstart\nname: fast CI\non: [ push, pull_request, "
  },
  {
    "path": ".github/workflows/strong_ci.yaml",
    "chars": 1340,
    "preview": "# Quickstart for GitHub Actions\n# https://docs.github.com/en/actions/quickstart\n\nname: Strong CI\non: [ push, pull_reques"
  },
  {
    "path": ".gitmodules",
    "chars": 111,
    "preview": "[submodule \"scripts/bash-buddy\"]\n\tpath = scripts/bash-buddy\n\turl = https://github.com/foldright/bash-buddy.git\n"
  },
  {
    "path": ".mvn/wrapper/maven-wrapper.properties",
    "chars": 951,
    "preview": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE f"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 15615,
    "preview": "# Welcome! Thank you for contributing to TransmittableThreadLocal(TTL)!\n\n> ⚠️ This contribution guide is still in progre"
  },
  {
    "path": "LICENSE",
    "chars": 11361,
    "preview": "\n\n                                 Apache License\n                           Version 2.0, January 2004\n                 "
  },
  {
    "path": "README-EN.md",
    "chars": 40996,
    "preview": "# <div align=\"center\"><a href=\"#dummy\"><img src=\"https://user-images.githubusercontent.com/1063891/233595946-4493119e-4e"
  },
  {
    "path": "README.md",
    "chars": 45441,
    "preview": "# <div align=\"center\"><a href=\"#dummy\"><img src=\"https://user-images.githubusercontent.com/1063891/233595946-4493119e-4e"
  },
  {
    "path": "SECURITY.md",
    "chars": 4251,
    "preview": "# 漏洞奖励计划\n\n## 报告\n\n如果您认为自己在本程序中发现了任何安全(技术)漏洞,欢迎您通过 https://security.alibaba.com 向我们提交漏洞报告。\n如果您报告任何安全漏洞,请注意您可能包含以下信息(合格报告):"
  },
  {
    "path": "docs/developer-guide-en.md",
    "chars": 3191,
    "preview": "# 🎓 Developer Guide\n\n---------------------------\n\n<!-- START doctoc generated TOC please keep comment here to allow auto"
  },
  {
    "path": "docs/developer-guide.md",
    "chars": 8773,
    "preview": "# 🎓 Developer Guide\n\n---------------------------\n\n<!-- START doctoc generated TOC please keep comment here to allow auto"
  },
  {
    "path": "docs/logo.md",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "docs/performance-test.md",
    "chars": 7018,
    "preview": "# ☔️ 性能测试\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTIO"
  },
  {
    "path": "docs/release-action-list.md",
    "chars": 1239,
    "preview": "发布操作列表\n===============================\n\n1. 准备发布分支\n    1. 如`POM`中有降开发版本,注意 修改 新加`API`的 **_`@since`_** !!\n    2. 从`master`"
  },
  {
    "path": "docs/requirement-scenario.md",
    "chars": 5884,
    "preview": "# 🎨 需求场景\n\n在`ThreadLocal`的需求场景即是`TTL`的潜在需求场景,如果你的业务需要『在使用线程池等会池化复用线程的组件情况下传递`ThreadLocal`』则是`TTL`目标场景。\n\n下面是几个典型场景例子。\n\n---"
  },
  {
    "path": "mvnw",
    "chars": 10665,
    "preview": "#!/bin/sh\n# ----------------------------------------------------------------------------\n# Licensed to the Apache Softwa"
  },
  {
    "path": "mvnw.cmd",
    "chars": 6912,
    "preview": "<# : batch portion\n@REM ----------------------------------------------------------------------------\n@REM Licensed to th"
  },
  {
    "path": "pom.xml",
    "chars": 28727,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t\t\t xsi:schema"
  },
  {
    "path": "scripts/bump-ttl-version.sh",
    "chars": 416,
    "preview": "#!/bin/bash\nset -eEuo pipefail\n# adjust current dir to script dir\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\n# shellcheck di"
  },
  {
    "path": "scripts/check-japi-compliance.sh",
    "chars": 1010,
    "preview": "#!/bin/bash\n# Java API Compliance Checker (JAPICC),\n# a tool for checking backward binary and source-level compatibility"
  },
  {
    "path": "scripts/codecov.sh",
    "chars": 575,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\nsource bash-buddy/lib/trap_error_info.sh\nsource ba"
  },
  {
    "path": "scripts/integration-test.sh",
    "chars": 3421,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\nBASH_BUDDY_ROOT=\"$(readlink -f bash-buddy)\"\nreadon"
  },
  {
    "path": "scripts/perf-test/memoryleak-ThreadLocal.sh",
    "chars": 229,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\ncd ../..\n\nreadonly mainClass=com.alibaba.perf.memo"
  },
  {
    "path": "scripts/perf-test/memoryleak-TransmittableThreadLocal.sh",
    "chars": 242,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\ncd ../..\n\nreadonly mainClass=com.alibaba.perf.memo"
  },
  {
    "path": "scripts/perf-test/tps-ThreadLocal.sh",
    "chars": 217,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\ncd ../..\n\nreadonly mainClass=com.alibaba.perf.tps."
  },
  {
    "path": "scripts/perf-test/tps-TransmittableThreadLocal.sh",
    "chars": 230,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\ncd ../..\n\nreadonly mainClass=com.alibaba.perf.tps."
  },
  {
    "path": "scripts/release.sh",
    "chars": 2173,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\nreadonly BASE=\"$(pwd)\"\n\nupdate_version=false\ndeploy"
  },
  {
    "path": "scripts/run-agent-demo.sh",
    "chars": 247,
    "preview": "#!/bin/bash\nset -eEuo pipefail\ncd \"$(dirname \"$(readlink -f \"$0\")\")\"\n\ncd ..\n\nreadonly mainClass=${1:-com.alibaba.demo.tt"
  },
  {
    "path": "src/package-list/java/package-list",
    "chars": 6299,
    "preview": "com.sun.jarsigner\ncom.sun.java.accessibility.util\ncom.sun.javadoc\ncom.sun.jdi\ncom.sun.jdi.connect\ncom.sun.jdi.connect.sp"
  },
  {
    "path": "src/package-list/jetbrains-annotations/package-list",
    "chars": 56,
    "preview": "org.intellij.lang.annotations\norg.jetbrains.annotations\n"
  },
  {
    "path": "src/package-list/jsr305/package-list",
    "chars": 67,
    "preview": "javax.annotation\njavax.annotation.concurrent\njavax.annotation.meta\n"
  },
  {
    "path": "src/package-list/spotbugs-annotations/package-list",
    "chars": 32,
    "preview": "edu.umd.cs.findbugs.annotations\n"
  },
  {
    "path": "ttl-agent/pom.xml",
    "chars": 8924,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java",
    "chars": 15663,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba.ttl3.agent.transformle"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgentHelper.java",
    "chars": 4121,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.cs.findbugs.annotations."
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlExtensionTransformletManager.java",
    "chars": 13545,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba.ttl3.agent.transformle"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlTransformer.java",
    "chars": 4899,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba.ttl3.agent.transformle"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/logging/Logger.java",
    "chars": 3296,
    "preview": "package com.alibaba.ttl3.agent.logging;\n\nimport com.alibaba.ttl3.agent.TtlAgent;\nimport com.alibaba.ttl3.agent.transform"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/logging/package-info.java",
    "chars": 212,
    "preview": "/**\n * TTL Agent Logger. <b>Only</b> use for TTL agent/transformlet.\n *\n * @author Jerry Lee (oldratlee at gmail dot com"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/package-info.java",
    "chars": 312,
    "preview": "/**\n * TTL Agent.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see com.alibaba.ttl3.agent.TtlAgent\n * @see <"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/ClassInfo.java",
    "chars": 3328,
    "preview": "package com.alibaba.ttl3.agent.transformlet;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.cs.findbugs"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/TtlTransformlet.java",
    "chars": 922,
    "preview": "package com.alibaba.ttl3.agent.transformlet;\n\nimport com.alibaba.ttl3.agent.TtlTransformer;\nimport edu.umd.cs.findbugs.a"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/helper/AbstractExecutorTtlTransformlet.java",
    "chars": 9049,
    "preview": "package com.alibaba.ttl3.agent.transformlet.helper;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba.tt"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/helper/TtlTransformletHelper.java",
    "chars": 7809,
    "preview": "package com.alibaba.ttl3.agent.transformlet.helper;\n\nimport com.alibaba.ttl3.TtlCallable;\nimport com.alibaba.ttl3.TtlRun"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/helper/package-info.java",
    "chars": 245,
    "preview": "/**\n * Helper API for TTL Agent extension {@code Transformlet} development.\n *\n * @author Jerry Lee (oldratlee at gmail "
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/ForkJoinTtlTransformlet.java",
    "chars": 4897,
    "preview": "package com.alibaba.ttl3.agent.transformlet.internal;\n\nimport com.alibaba.ttl3.agent.TtlAgent;\nimport com.alibaba.ttl3.a"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/JdkExecutorTtlTransformlet.java",
    "chars": 1205,
    "preview": "package com.alibaba.ttl3.agent.transformlet.internal;\n\nimport com.alibaba.ttl3.agent.TtlAgent;\nimport com.alibaba.ttl3.a"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/PriorityBlockingQueueTtlTransformlet.java",
    "chars": 5421,
    "preview": "package com.alibaba.ttl3.agent.transformlet.internal;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba."
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/TimerTaskTtlTransformlet.java",
    "chars": 3396,
    "preview": "package com.alibaba.ttl3.agent.transformlet.internal;\n\nimport com.alibaba.ttl3.agent.logging.Logger;\nimport com.alibaba."
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/internal/package-info.java",
    "chars": 464,
    "preview": "/**\n * TTL built-in {@code Transformlet} implementations.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see c"
  },
  {
    "path": "ttl-agent/src/main/java/com/alibaba/ttl3/agent/transformlet/package-info.java",
    "chars": 388,
    "preview": "/**\n * TTL {@code Transformlet} API for TTL Agent extension {@code Transformlet} development.\n * <p>\n * TTL built-in {@c"
  },
  {
    "path": "ttl-bom/pom.xml",
    "chars": 4579,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-core/pom.xml",
    "chars": 3489,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/TransmitCallback.java",
    "chars": 590,
    "preview": "package com.alibaba.crr;\n\n/**\n * The callback of {@link Transmittable} process.\n *\n * @author Jerry Lee (oldratlee at gm"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/Transmittable.java",
    "chars": 1724,
    "preview": "package com.alibaba.crr;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\n/**\n * Transmittance process is represented b"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/composite/Backup.java",
    "chars": 295,
    "preview": "package com.alibaba.crr.composite;\n\nimport org.jetbrains.annotations.ApiStatus;\n\n/**\n * The composite backup data type o"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/composite/Capture.java",
    "chars": 297,
    "preview": "package com.alibaba.crr.composite;\n\nimport org.jetbrains.annotations.ApiStatus;\n\n/**\n * The composite capture data type "
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/composite/CompositeTransmitCallback.java",
    "chars": 3967,
    "preview": "package com.alibaba.crr.composite;\n\nimport com.alibaba.crr.TransmitCallback;\nimport edu.umd.cs.findbugs.annotations.NonN"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/composite/CompositeTransmittable.java",
    "chars": 7744,
    "preview": "package com.alibaba.crr.composite;\n\nimport com.alibaba.crr.Transmittable;\nimport edu.umd.cs.findbugs.annotations.NonNull"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/composite/package-info.java",
    "chars": 347,
    "preview": "/**\n * Provide composite transmittance implementation\n * {@link com.alibaba.crr.composite.CompositeTransmittable}\n * for"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/crr/package-info.java",
    "chars": 425,
    "preview": "/**\n * The base independent abstraction of {@code CRR}\n * transmittance({@code interface} {@link com.alibaba.crr.Transmi"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TransmittableThreadLocal.java",
    "chars": 18580,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.ttl3.executor.TtlExecutors;\nimport com.alibaba.ttl3.transmitter.Transmitte"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlCallable.java",
    "chars": 9590,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlRecursiveAction.java",
    "chars": 1676,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlRecursiveTask.java",
    "chars": 1812,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlRunnable.java",
    "chars": 10294,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlTimerTask.java",
    "chars": 6130,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/TtlWrappers.java",
    "chars": 11557,
    "preview": "package com.alibaba.ttl3;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.crr.composite.Capture;\nimport com"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/agent/EmptyTtlAgentStatus.java",
    "chars": 1570,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\nimport static com.alibaba.ttl3.interna"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/agent/TtlAgentStatus.java",
    "chars": 385,
    "preview": "package com.alibaba.ttl3.agent;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\nimport static com.alibaba.ttl3.agent.E"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/agent/package-info.java",
    "chars": 232,
    "preview": "/**\n * Provide {@link com.alibaba.ttl3.agent.TtlAgentStatus}\n * to get {@code TTL Agent status}.\n *\n * @author Jerry Lee"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/ComparableComparator.java",
    "chars": 5516,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOT"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/DisableInheritableForkJoinWorkerThreadFactoryWrapper.java",
    "chars": 1801,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.ttl3.spi.TtlWrapper;\nimp"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/DisableInheritableThreadFactoryWrapper.java",
    "chars": 1542,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.crr.composite.Backup;\nimport com.alibaba.ttl3.spi.TtlWrapper;\nimp"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/ExecutorServiceTtlWrapper.java",
    "chars": 3433,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport com.alibaba.ttl3.TtlCallabl"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/ExecutorTtlWrapper.java",
    "chars": 1713,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport com.alibaba.ttl3.TtlRunnabl"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/ScheduledExecutorServiceTtlWrapper.java",
    "chars": 2535,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport com.alibaba.ttl3.TtlCallabl"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlExecutors.java",
    "chars": 15002,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport com.alibaba.ttl3.agent.TtlA"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/TtlUnwrapComparator.java",
    "chars": 1369,
    "preview": "package com.alibaba.ttl3.executor;\n\nimport com.alibaba.ttl3.TtlWrappers;\nimport com.alibaba.ttl3.spi.TtlWrapper;\nimport "
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/executor/package-info.java",
    "chars": 203,
    "preview": "/**\n * {@code TTL} wrap/decoration utils for {@code executor}s.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * "
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/internal/util/Assert.java",
    "chars": 4764,
    "preview": "/*\n * Copyright 2002-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ConcurrentReferenceHashMap.java",
    "chars": 38315,
    "preview": "/*\n * Copyright 2002-2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/internal/util/ObjectUtils.java",
    "chars": 10544,
    "preview": "/*\n * Copyright 2002-2021 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/internal/util/Utils.java",
    "chars": 3510,
    "preview": "package com.alibaba.ttl3.internal.util;\n\nimport org.jetbrains.annotations.ApiStatus;\nimport org.jetbrains.annotations.Nu"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/package-info.java",
    "chars": 260,
    "preview": "/**\n * TTL API.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see com.alibaba.ttl3.TransmittableThreadLocal\n "
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlAttachments.java",
    "chars": 896,
    "preview": "package com.alibaba.ttl3.spi;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\n/**\n * The TTL attachments for TTL tasks"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlAttachmentsDelegate.java",
    "chars": 1871,
    "preview": "package com.alibaba.ttl3.spi;\n\nimport com.alibaba.ttl3.TtlWrappers;\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimpo"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlEnhanced.java",
    "chars": 479,
    "preview": "package com.alibaba.ttl3.spi;\n\n/**\n * a Ttl marker/tag interface, for ttl enhanced class, for example {@code TTL wrapper"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlWrapper.java",
    "chars": 1555,
    "preview": "package com.alibaba.ttl3.spi;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\n/**\n * Ttl Wrapper interface.\n * <p>\n * "
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/spi/package-info.java",
    "chars": 399,
    "preview": "/**\n * TTL SPI contains internal types for {@code TTL} developer to integrate with {@code TTL};\n * You will <b><i>never<"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/transmitter/ThreadLocalTransmitRegistry.java",
    "chars": 10031,
    "preview": "package com.alibaba.ttl3.transmitter;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport edu.umd.cs.findbugs.anno"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmittee.java",
    "chars": 2565,
    "preview": "package com.alibaba.ttl3.transmitter;\n\nimport com.alibaba.crr.Transmittable;\nimport edu.umd.cs.findbugs.annotations.NonN"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/transmitter/TransmitteeRegistry.java",
    "chars": 2440,
    "preview": "package com.alibaba.ttl3.transmitter;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport edu.umd.cs.findbugs.anno"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/transmitter/Transmitter.java",
    "chars": 10909,
    "preview": "package com.alibaba.ttl3.transmitter;\n\nimport com.alibaba.crr.TransmitCallback;\nimport com.alibaba.crr.composite.Backup;"
  },
  {
    "path": "ttl-core/src/main/java/com/alibaba/ttl3/transmitter/package-info.java",
    "chars": 912,
    "preview": "/**\n * The base(under layer) API for {@code TTL} developer to integrate with {@code TTL};\n * You will <b><i>never</i></b"
  },
  {
    "path": "ttl-core/src/main/javadoc/overview.html",
    "chars": 401,
    "preview": "<html>\n<body>\n<p>This is the API documentation for the\n    <a href=\"https://github.com/alibaba/transmittable-thread-loca"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/Utils.kt",
    "chars": 2129,
    "preview": "package com.alibaba\n\nimport com.alibaba.ttl3.TtlCallable\nimport com.alibaba.ttl3.TtlRunnable\nimport com.alibaba.ttl3.age"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/cow/CowDemo.kt",
    "chars": 1742,
    "preview": "package com.alibaba.demo.cow\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimpor"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/forkjoinpool/ForkJoinPoolDemo.kt",
    "chars": 12933,
    "preview": "package com.alibaba.demo.forkjoinpool\n\nimport java.util.concurrent.ForkJoinPool\nimport java.util.concurrent.RecursiveTas"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/forkjoinpool/ParallelStreamDemo.kt",
    "chars": 6127,
    "preview": "package com.alibaba.demo.forkjoinpool\n\nimport java.util.concurrent.ConcurrentSkipListSet\n\n/**\n * Parallel Stream use dem"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/scheduled_thread_pool_executor/ScheduledFutureTaskDemo.kt",
    "chars": 822,
    "preview": "package com.alibaba.demo.scheduled_thread_pool_executor\n\nimport java.util.concurrent.ScheduledThreadPoolExecutor\nimport "
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/session_cache/SessionCacheDemo.kt",
    "chars": 3472,
    "preview": "package com.alibaba.demo.session_cache\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.ttl3.TransmittableThreadL"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/timer/TimerTaskDemo.kt",
    "chars": 834,
    "preview": "package com.alibaba.demo.timer\n\nimport java.text.SimpleDateFormat\nimport java.util.*\n\n/**\n * @see [Java Timer TimerTask "
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/CustomizedBlockingQueueWithTtlDemo.java",
    "chars": 2964,
    "preview": "package com.alibaba.demo.ttl3;\n\nimport com.alibaba.ttl3.TtlRunnable;\nimport com.alibaba.ttl3.executor.TtlExecutors;\nimpo"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/SimpleDemo.kt",
    "chars": 599,
    "preview": "package com.alibaba.demo.ttl3\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport kotlin.concurrent.thread\n\n/**\n * "
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlExecutorServiceWithPriorityBlockingQueueDemo.kt",
    "chars": 3885,
    "preview": "package com.alibaba.demo.ttl3\n\nimport com.alibaba.ttl3.executor.TtlExecutors\nimport java.lang.Thread.sleep\nimport java.u"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlExecutorWrapperDemo.kt",
    "chars": 1217,
    "preview": "package com.alibaba.demo.ttl3\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport com.alibaba.ttl3.executor.TtlExec"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlForkJoinTaskDemo.kt",
    "chars": 17512,
    "preview": "package com.alibaba.demo.ttl3\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport com.alibaba.ttl3.TtlRecursiveTask"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/demo/ttl3/TtlWrapperDemo.kt",
    "chars": 1248,
    "preview": "package com.alibaba.demo.ttl3\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport com.alibaba.ttl3.TtlCallable\nimpo"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/Utils.kt",
    "chars": 530,
    "preview": "package com.alibaba.perf\n\nimport java.util.*\n\nprivate val random = Random()\n\ninternal fun bytes2Hex(bytes: ByteArray): S"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/memoryleak/NoMemoryLeak_ThreadLocal_NoRemove.kt",
    "chars": 403,
    "preview": "package com.alibaba.perf.memoryleak\n\nimport com.alibaba.perf.getRandomString\n\n/**\n * @author Jerry Lee (oldratlee at gma"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/memoryleak/NoMemoryLeak_TransmittableThreadLocal_NoRemove.kt",
    "chars": 465,
    "preview": "package com.alibaba.perf.memoryleak\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport com.alibaba.perf.getRandomS"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/package-info.java",
    "chars": 576,
    "preview": "/**\n * Performance test cases.\n * <p>\n * TPS test:\n * <ul>\n *     <li>{@link com.alibaba.perf.tps.CreateTransmittableThr"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/tps/CreateThreadLocalInstanceTps.kt",
    "chars": 460,
    "preview": "package com.alibaba.perf.tps\n\nimport com.alibaba.perf.getRandomString\n\n/**\n * @author Jerry Lee (oldratlee at gmail dot "
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/tps/CreateTransmittableThreadLocalInstanceTps.kt",
    "chars": 521,
    "preview": "package com.alibaba.perf.tps\n\nimport com.alibaba.ttl3.TransmittableThreadLocal\nimport com.alibaba.perf.getRandomString\n\n"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/perf/tps/TpsCounter.kt",
    "chars": 936,
    "preview": "package com.alibaba.perf.tps\n\nimport com.alibaba.shutdownForTest\nimport java.util.concurrent.ExecutorService\nimport java"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/third_part_lib_test/ExecutorsTest.kt",
    "chars": 991,
    "preview": "package com.alibaba.third_part_lib_test\n\nimport com.alibaba.shutdownForTest\nimport io.kotest.core.spec.style.AnnotationS"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/third_part_lib_test/ForkJoinPoolTest.kt",
    "chars": 1381,
    "preview": "package com.alibaba.third_part_lib_test\n\nimport com.alibaba.shutdownForTest\nimport io.kotest.core.spec.style.AnnotationS"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/ttl3/TtlCallableTest.kt",
    "chars": 4408,
    "preview": "package com.alibaba.ttl3\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.getForTest\nimport com.alibaba.shutdownF"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/ttl3/TtlFlowTester.kt",
    "chars": 12806,
    "preview": "package com.alibaba.ttl3\n\nimport com.alibaba.getForTest\nimport com.alibaba.noTtlAgentRun\nimport io.kotest.assertions.fai"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/ttl3/TtlRunnableTest.kt",
    "chars": 4287,
    "preview": "package com.alibaba.ttl3\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.getForTest\nimport com.alibaba.shutdownF"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/ttl3/TtlTimerTaskTest.kt",
    "chars": 1207,
    "preview": "package com.alibaba.ttl3\n\nimport io.kotest.assertions.throwables.shouldThrow\nimport io.kotest.core.spec.style.Annotation"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/DisableIgnoreNullValueSemanticsTest.kt",
    "chars": 4183,
    "preview": "package com.alibaba.user_api_test.ttl3\n\nimport com.alibaba.getForTest\nimport com.alibaba.ttl3.TransmittableThreadLocal\ni"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/TransmittableThreadLocal_Transmitter_UserTest.kt",
    "chars": 4248,
    "preview": "package com.alibaba.user_api_test.ttl3\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.getForTest\nimport com.ali"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/TransmittableThreadLocal_Transmitter_registerTransmittee_UserTest.kt",
    "chars": 3339,
    "preview": "package com.alibaba.user_api_test.ttl3\n\nimport com.alibaba.ttl3.transmitter.Transmittee\nimport com.alibaba.ttl3.transmit"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/TransmittableThreadLocal_withInit_Null_Test.java",
    "chars": 2018,
    "preview": "package com.alibaba.user_api_test.ttl3;\n\nimport com.alibaba.ttl3.TransmittableThreadLocal;\nimport org.junit.Test;\n\nimpor"
  },
  {
    "path": "ttl-core/src/test/java/com/alibaba/user_api_test/ttl3/TransmittableThreadLocal_withInit_Test.kt",
    "chars": 2654,
    "preview": "package com.alibaba.user_api_test.ttl3\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.getForTest\nimport com.ali"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/README.md",
    "chars": 2219,
    "preview": "# `TTL Agent`扩展`Transformlet`实现的示例工程\n\n## 扩展`Transformlet`的实现\n\n为了提供`TTL Agent`扩展`Transformlet`,包含2部分:\n\n1. `TTL Agent`扩展`T"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/pom.xml",
    "chars": 4210,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/scripts/integration-test.sh",
    "chars": 457,
    "preview": "#!/bin/bash\nset -eEuo pipefail\n# adjust current dir to project dir\ncd \"$(dirname \"$(readlink -f \"$0\")\")/..\"\n\nTTL_ROOT_PR"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/scripts/run.sh",
    "chars": 1200,
    "preview": "#!/bin/bash\nset -eEuo pipefail\n# adjust current dir to project dir\ncd \"$(dirname \"$(readlink -f \"$0\")\")/..\"\n\nTTL_ROOT_PR"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/SampleMain.java",
    "chars": 945,
    "preview": "package com.alibaba.ttl.agent.extension_transformlet.sample.biz;\n\nimport com.alibaba.ttl.threadpool.agent.TtlAgent;\nimpo"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/ToBeTransformedClass.java",
    "chars": 182,
    "preview": "package com.alibaba.ttl.agent.extension_transformlet.sample.biz;\n\npublic class ToBeTransformedClass {\n    public int toB"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/java/com/alibaba/ttl/agent/extension_transformlet/sample/transformlet/SampleExtensionTransformlet.java",
    "chars": 2186,
    "preview": "package com.alibaba.ttl.agent.extension_transformlet.sample.transformlet;\n\nimport com.alibaba.ttl.agent.extension_transf"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/src/main/resources/META-INF/ttl.agent.transformlets",
    "chars": 93,
    "preview": "com.alibaba.ttl.agent.extension_transformlet.sample.transformlet.SampleExtensionTransformlet\n"
  },
  {
    "path": "ttl-integrations/sample-ttl-agent-extension-transformlet/src/test/java/com/alibaba/ttl/agent/extension_transformlet/sample/biz/ToBeTransformedClassTest.java",
    "chars": 845,
    "preview": "package com.alibaba.ttl.agent.extension_transformlet.sample.biz;\n\nimport com.alibaba.ttl.threadpool.agent.TtlAgent;\nimpo"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/README-EN.md",
    "chars": 2041,
    "preview": "#  Vertx 4 integration of TTL\n\n## 1. assure TTL context transmit in callback \n\n## 1.1 Decorate `io.vertx.core.Handler`\n\n"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/README.md",
    "chars": 1787,
    "preview": "# Vertx 4的TTL集成\n\n## 1. 保证异步io回调中传递TTL值\n\n### 1.1修饰`io.vertx.core.Handler`\n\n使用[`TtlVertxHandler`](src/main/java/com/alibab"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/pom.xml",
    "chars": 4456,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/TtlVertxHandler.java",
    "chars": 10977,
    "preview": "package com.alibaba.ttl.integration.vertx3;\n\nimport com.alibaba.ttl.spi.TtlAttachments;\nimport com.alibaba.ttl.spi.TtlAt"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/agent/transformlet/NettySingleThreadEventExecutorTtlTransformlet.java",
    "chars": 1049,
    "preview": "package com.alibaba.ttl.integration.vertx3.agent.transformlet;\n\nimport com.alibaba.ttl.threadpool.agent.transformlet.hel"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx3/agent/transformlet/VertxFutureTtlTransformlet.java",
    "chars": 4247,
    "preview": "package com.alibaba.ttl.integration.vertx3.agent.transformlet;\n\nimport com.alibaba.ttl.threadpool.agent.logging.Logger;\n"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/src/main/resources/META-INF/ttl.agent.transformlets",
    "chars": 181,
    "preview": "com.alibaba.ttl.integration.vertx3.agent.transformlet.NettySingleThreadEventExecutorTtlTransformlet\ncom.alibaba.ttl.inte"
  },
  {
    "path": "ttl-integrations/vertx3-ttl-integration/src/test/java/com/alibaba/ttl/integration/vertx3/VertxTransformletTest.java",
    "chars": 5552,
    "preview": "package com.alibaba.ttl.integration.vertx3;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.thr"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/README-EN.md",
    "chars": 1998,
    "preview": "#  Vertx 4 integration of TTL\n\n## 1. assure TTL context transmit in callback \n\n## 1.1 Decorate `io.vertx.core.Handler`\n\n"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/README.md",
    "chars": 1744,
    "preview": "# Vertx 4的TTL集成\n\n## 1. 保证异步io回调中传递TTL值\n\n### 1.1修饰`io.vertx.core.Handler`\n\n使用[`TtlVertxHandler`](src/main/java/com/alibab"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/pom.xml",
    "chars": 4641,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/TtlVertxHandler.java",
    "chars": 10977,
    "preview": "package com.alibaba.ttl.integration.vertx4;\n\nimport com.alibaba.ttl.spi.TtlAttachments;\nimport com.alibaba.ttl.spi.TtlAt"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/agent/transformlet/NettySingleThreadEventExecutorTtlTransformlet.java",
    "chars": 1049,
    "preview": "package com.alibaba.ttl.integration.vertx4.agent.transformlet;\n\nimport com.alibaba.ttl.threadpool.agent.transformlet.hel"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/src/main/java/com/alibaba/ttl/integration/vertx4/agent/transformlet/VertxFutureTtlTransformlet.java",
    "chars": 3831,
    "preview": "package com.alibaba.ttl.integration.vertx4.agent.transformlet;\n\nimport com.alibaba.ttl.threadpool.agent.logging.Logger;\n"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/src/main/resources/META-INF/ttl.agent.transformlets",
    "chars": 181,
    "preview": "com.alibaba.ttl.integration.vertx4.agent.transformlet.NettySingleThreadEventExecutorTtlTransformlet\ncom.alibaba.ttl.inte"
  },
  {
    "path": "ttl-integrations/vertx4-ttl-integration/src/test/java/com/alibaba/ttl/integration/vertx4/VertxTransformletTest.java",
    "chars": 4890,
    "preview": "package com.alibaba.ttl.integration.vertx4;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.thr"
  },
  {
    "path": "ttl-kotlin/pom.xml",
    "chars": 4834,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl-kotlin/src/main/kotlin/com/alibaba/ttl3/kotlin/Transmitter.kt",
    "chars": 1121,
    "preview": "package com.alibaba.ttl3.kotlin\n\nimport com.alibaba.crr.composite.Capture\nimport com.alibaba.ttl3.transmitter.Transmitte"
  },
  {
    "path": "ttl-kotlin/src/main/kotlin/com/alibaba/ttl3/kotlin/TtlExtensions.kt",
    "chars": 14401,
    "preview": "package com.alibaba.ttl3.kotlin\n\nimport com.alibaba.ttl3.TtlCallable\nimport com.alibaba.ttl3.TtlRunnable\nimport com.alib"
  },
  {
    "path": "ttl-kotlin/src/test/kotlin/com/alibaba/Utils.kt",
    "chars": 1259,
    "preview": "package com.alibaba\n\nimport io.kotest.assertions.withClue\nimport io.kotest.matchers.booleans.shouldBeTrue\nimport java.ti"
  },
  {
    "path": "ttl-kotlin/src/test/kotlin/com/alibaba/ttl3/kotlin/TtlExtensionsTests.kt",
    "chars": 19794,
    "preview": "package com.alibaba.ttl3.kotlin\n\nimport com.alibaba.expandThreadPool\nimport com.alibaba.getForTest\nimport com.alibaba.sh"
  },
  {
    "path": "ttl2-compatible/pom.xml",
    "chars": 10740,
    "preview": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t\t xsi:schemaLo"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TransmittableThreadLocal.java",
    "chars": 51802,
    "preview": "package com.alibaba.ttl;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.cs.findbugs.annotations.Nullabl"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlCallable.java",
    "chars": 10006,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlAttachments;\nimport com.alibaba.ttl.spi.TtlAttachmentsDelegate;\n"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlCopier.java",
    "chars": 1371,
    "preview": "package com.alibaba.ttl;\n\n/**\n * {@code TtlCopier} copies the value when {@link TransmittableThreadLocal.Transmitter#cap"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlEnhanced.java",
    "chars": 520,
    "preview": "package com.alibaba.ttl;\n\nimport edu.umd.cs.findbugs.annotations.SuppressFBWarnings;\n\n/**\n * @see com.alibaba.ttl.spi.Tt"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRecursiveAction.java",
    "chars": 1704,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlEnhanced;\n\nimport java.util.concurrent.ForkJoinTask;\n\nimport sta"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRecursiveTask.java",
    "chars": 1841,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlEnhanced;\n\nimport java.util.concurrent.ForkJoinTask;\n\nimport sta"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlRunnable.java",
    "chars": 10703,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlAttachments;\nimport com.alibaba.ttl.spi.TtlAttachmentsDelegate;\n"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlTimerTask.java",
    "chars": 7350,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlEnhanced;\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu.umd."
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlUnwrap.java",
    "chars": 2995,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu.umd.cs.findbugs.annotations.Nullable;\nimport"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/TtlWrappers.java",
    "chars": 13119,
    "preview": "package com.alibaba.ttl;\n\nimport com.alibaba.ttl.spi.TtlEnhanced;\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu.umd."
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/package-info.java",
    "chars": 289,
    "preview": "/**\n * TTL API.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see com.alibaba.ttl.TransmittableThreadLocal\n *"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlAttachments.java",
    "chars": 980,
    "preview": "package com.alibaba.ttl.spi;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\n/**\n * The TTL attachments for TTL tasks,"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlAttachmentsDelegate.java",
    "chars": 1940,
    "preview": "package com.alibaba.ttl.spi;\n\nimport com.alibaba.ttl.TtlUnwrap;\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport e"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlEnhanced.java",
    "chars": 489,
    "preview": "package com.alibaba.ttl.spi;\n\n/**\n * a Ttl marker/tag interface, for ttl enhanced class, for example {@code TTL wrapper}"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/spi/TtlWrapper.java",
    "chars": 986,
    "preview": "package com.alibaba.ttl.spi;\n\nimport com.alibaba.ttl.TtlUnwrap;\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\n/**\n * "
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/spi/package-info.java",
    "chars": 201,
    "preview": "/**\n * TTL SPI\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see com.alibaba.ttl.spi.TtlEnhanced\n * @see com."
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ComparableComparator.java",
    "chars": 5579,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements.  See the NOT"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableForkJoinWorkerThreadFactory.java",
    "chars": 649,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu.umd.cs.findbugs.annotations.NonNu"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableForkJoinWorkerThreadFactoryWrapper.java",
    "chars": 1744,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\nimport java.util.concurrent.ForkJo"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableThreadFactory.java",
    "chars": 574,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu.umd.cs.findbugs.annotations.NonNu"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/DisableInheritableThreadFactoryWrapper.java",
    "chars": 1498,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\n\nimport java.util.concurrent.Thread"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ExecutorServiceTtlWrapper.java",
    "chars": 3446,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.TtlCallable"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ExecutorTtlWrapper.java",
    "chars": 1587,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.TtlRunnable"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/ScheduledExecutorServiceTtlWrapper.java",
    "chars": 2548,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.TtlCallable"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlExecutors.java",
    "chars": 13387,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.TransmittableThreadLocal;\nimport com.alibaba.ttl.spi.TtlEnha"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlForkJoinPoolHelper.java",
    "chars": 3800,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.cs.findbugs.annotati"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/TtlUnwrapComparator.java",
    "chars": 1352,
    "preview": "package com.alibaba.ttl.threadpool;\n\nimport com.alibaba.ttl.TtlUnwrap;\nimport com.alibaba.ttl.spi.TtlWrapper;\nimport edu"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgent.java",
    "chars": 15943,
    "preview": "package com.alibaba.ttl.threadpool.agent;\n\nimport com.alibaba.ttl.threadpool.agent.logging.Logger;\nimport com.alibaba.tt"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlAgentHelper.java",
    "chars": 4123,
    "preview": "package com.alibaba.ttl.threadpool.agent;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.cs.findbugs.an"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlExtensionTransformletManager.java",
    "chars": 13609,
    "preview": "package com.alibaba.ttl.threadpool.agent;\n\nimport com.alibaba.ttl.threadpool.agent.logging.Logger;\nimport com.alibaba.tt"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/TtlTransformer.java",
    "chars": 5019,
    "preview": "package com.alibaba.ttl.threadpool.agent;\n\nimport com.alibaba.ttl.threadpool.agent.logging.Logger;\nimport com.alibaba.tt"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/logging/Logger.java",
    "chars": 3300,
    "preview": "package com.alibaba.ttl.threadpool.agent.logging;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/logging/package-info.java",
    "chars": 248,
    "preview": "/**\n * TTL Agent Logger. <b>Only</b> use for TTL agent/transformlet.\n *\n * @author Jerry Lee (oldratlee at gmail dot com"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/package-info.java",
    "chars": 332,
    "preview": "/**\n * TTL Agent.\n *\n * @author Jerry Lee (oldratlee at gmail dot com)\n * @see com.alibaba.ttl.threadpool.agent.TtlAgent"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/ClassInfo.java",
    "chars": 3414,
    "preview": "package com.alibaba.ttl.threadpool.agent.transformlet;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport edu.umd.c"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/TtlTransformlet.java",
    "chars": 965,
    "preview": "package com.alibaba.ttl.threadpool.agent.transformlet;\n\nimport edu.umd.cs.findbugs.annotations.NonNull;\nimport javassist"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/helper/AbstractExecutorTtlTransformlet.java",
    "chars": 9087,
    "preview": "package com.alibaba.ttl.threadpool.agent.transformlet.helper;\n\nimport com.alibaba.ttl.threadpool.TtlExecutors;\nimport co"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/helper/TtlTransformletHelper.java",
    "chars": 7863,
    "preview": "package com.alibaba.ttl.threadpool.agent.transformlet.helper;\n\nimport com.alibaba.ttl.TtlCallable;\nimport com.alibaba.tt"
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/helper/package-info.java",
    "chars": 281,
    "preview": "/**\n * Helper API for TTL Agent extension {@code Transformlet} development.\n *\n * @author Jerry Lee (oldratlee at gmail "
  },
  {
    "path": "ttl2-compatible/src/main/java/com/alibaba/ttl/threadpool/agent/transformlet/internal/ForkJoinTtlTransformlet.java",
    "chars": 4982,
    "preview": "package com.alibaba.ttl.threadpool.agent.transformlet.internal;\n\nimport com.alibaba.ttl.spi.TtlEnhanced;\nimport com.alib"
  }
]

// ... and 81 more files (download for full content)

About this extraction

This page contains the full source code of the alibaba/transmittable-thread-local GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 281 files (1.1 MB), approximately 306.9k tokens, and a symbol index with 970 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!