Package com.github.mizool.core
Class MetaInfServices
java.lang.Object
com.github.mizool.core.MetaInfServices
-
Method Summary
-
Method Details
-
instances
Deprecated, for removal: This API element is subject to removal in a future version.When it was introduced years ago, the point of this method was to ensure theServiceLoadercall always used the classloader of the service class. At the time, this seemed to be important, even essential, so it was decided to ensure this "correct" usage.Fast-forward to 2025, this turned out to be harmful: in environments with layered classloaders like Quarkus, this limits the returned service implementations to those from library jars and omits those supplied by the application.
For this reason, this method now uses the current thread's context classloader. Consequently, calling it is now equivalent to calling
ServiceLoader.load(Class). Calls should therefore be replaced as this method is going to be removed.
-
ServiceLoadercall always used the classloader of the service class.