Class ComponentClassLoader

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    SubmoduleClassLoader

    public class ComponentClassLoader
    extends URLClassLoader
    A URLClassLoader that restricts which classes can be loaded to those contained within the given classpath, except classes from a given set of packages that are either loaded owner or component-first.

    Depiction of the class loader hierarchy:

           Owner     Bootstrap
               ^         ^
               |---------|
                    |
                Component
     

    For loading classes/resources, class loaders are accessed in one of the following orders:

    • component-only: component -> bootstrap; default.
    • component-first: component -> bootstrap -> owner; opt-in.
    • owner-first: owner -> component -> bootstrap; opt-in.