Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ServiceLoader to find implementations instead of ClassFinder #5883

Closed
vlsi opened this issue May 6, 2023 · 1 comment · Fixed by #5885
Closed

Use ServiceLoader to find implementations instead of ClassFinder #5883

vlsi opened this issue May 6, 2023 · 1 comment · Fixed by #5885

Comments

@vlsi
Copy link
Collaborator

vlsi commented May 6, 2023

Use case

There should be a possibility to launch JMeter without hand-crafting a special file layout.
For instance, when running unit tests, it is hard to prepare all the jars in the appropriate folders.

See discussion https://lists.apache.org/thread/4t7wcjh45q61v300j1954c8l8931swrr

Possible solution

Use java.util.ServiceLoader to lookup implementations so the users could provide implementations via Java classpath.

Possible workarounds

No response

JMeter Version

5.5

Java Version

No response

OS Version

No response

@vlsi
Copy link
Collaborator Author

vlsi commented May 6, 2023

Java 9+ has a convenient method ServiceLoader#stream() that returns services without instantiating them first: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ServiceLoader.html#stream()

vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 7, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 9, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 10, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 10, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 10, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 10, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 10, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit to vlsi/jmeter that referenced this issue May 11, 2023
…classes in jars

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes apache#5883
vlsi added a commit that referenced this issue May 11, 2023
…classes in jars (#5885)

ServiceLoader is Java standard approach for locating implementaitons,
and it allows pluggability without relying on a filesystem layout.

Fixes #5883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant