afsun
V2EX  ›  问与答

为什么会引入 ThreadContextClassLoader 呢

  •  
  •   afsun · Dec 10, 2020 · 690 views
    This topic created in 1988 days ago, the information mentioned may be changed or developed.

    在看ServiceLoader加载JDBC的时候一直很疑惑,因为ServiceLoader是由启动类加载器去加载的。而启动类加载器无法加载 ClassPath 下面的 SPI 的实现类所以要通过 TCCL 来获取系统加载器去加载,那么为什么不直接在ServiceLoader中获取系统类加载器呢?ClassLoader.getSystemClassLoader()。求大神解惑

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   927 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:55 · PVG 05:55 · LAX 14:55 · JFK 17:55
    ♥ Do have faith in what you're doing.