Thomas Diesler I don't disagree in some aspects (like TCCL being bad). However, relying on OSGi stuff in libraries that can be used outside OSGi seems just as bad to me TBH. Its swapping one overlord for another.
And Hibernate does in fact leverage ServiceLoader. But we do allClassLoader interactions in a very special way: we use a custom service (Hibernate ServiceRegistry) - ClassLoaderService. The idea being that different environments would either configure the standard one in different ways or provide their own. Thats not going to change.
Thomas Diesler I don't disagree in some aspects (like TCCL being bad). However, relying on OSGi stuff in libraries that can be used outside OSGi seems just as bad to me TBH. Its swapping one overlord for another.
And Hibernate does in fact leverage ServiceLoader. But we do all ClassLoader interactions in a very special way: we use a custom service (Hibernate ServiceRegistry) - ClassLoaderService. The idea being that different environments would either configure the standard one in different ways or provide their own. Thats not going to change.