ppkarwasz commented on pull request #804:
URL: https://github.com/apache/logging-log4j2/pull/804#issuecomment-1074844988


   After several fixes, this should work now. A summary of changes:
   
   - I removed `LoaderServiceUtil#getService` that I introduced in a previous 
commit, since it's logic is not really needed,
   - OSGI support was also removed from `LoaderServiceUtil`, because it uses an 
artifact (`osgi-resource-locator`) that seems to be abandoned (it is still 
supported by JAXB API and similar, but I found no other references). Log4j 
registers (and probably should register) its services as native OSGI services.
   - all `ServiceLoader#load` call sites have been refactored to use 
`ServiceLoaderUtil`,
   - the number of `ServiceLoader#load` calls has been reduced to at most 2: 
one for the caller's classloader and possibly one for the thread context 
classloader,
   - most `ServiceLoaderUtil#loadServices` call sites store the result in a 
static variable. To prevent memory leaks those calls don't use the TCCL.
   - a Java 9 version of `ServiceLoaderUtil` was introduced to take advantage 
of the new `stream()` method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to