Skip to content

[LOG4J2-3427] Add a ServiceLoader tool#787

Merged
ppkarwasz merged 2 commits intoapache:release-2.xfrom
ppkarwasz:service-loader
Mar 9, 2022
Merged

[LOG4J2-3427] Add a ServiceLoader tool#787
ppkarwasz merged 2 commits intoapache:release-2.xfrom
ppkarwasz:service-loader

Conversation

@ppkarwasz
Copy link
Contributor

This adds a ServiceLoader which:

  • automatically discards service classes, which can not be instantiated (e.g. classes in the server's classloader of a servlet container), from the list of returned services,
  • implements a common mechanism to override the service found by ServiceLoader,
  • adds warnings if we only need one service, but multiple candidates are found.

This adds a `ServiceLoader` which:

 * automatically discards service classes, which can not be instantiated
(e.g. classes in the server's classloader of a servlet container), from
the list of returned services,
 * implements a common mechanism to override the service found by
`ServiceLoader`,
 * adds warnings if we only need one service, but multiple candidates
are found.
@jochenw
Copy link

jochenw commented Mar 7, 2022

Shouldn't the dependency junit-pioneer have test scope?

@ppkarwasz
Copy link
Contributor Author

@jochenw, yes and it has a test scope.
The scope of dependencies is inherited from the parent POM.

@ppkarwasz ppkarwasz merged commit a536df6 into apache:release-2.x Mar 9, 2022
@ppkarwasz ppkarwasz deleted the service-loader branch March 9, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants