-
Notifications
You must be signed in to change notification settings - Fork 232
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
feat: add synthetic service provider #2373
feat: add synthetic service provider #2373
Conversation
e9ac691
to
e5c2567
Compare
core/common/boot/src/main/java/org/eclipse/edc/boot/system/SyntheticExtension.java
Outdated
Show resolved
Hide resolved
core/common/boot/src/main/java/org/eclipse/edc/boot/system/SyntheticExtension.java
Outdated
Show resolved
Hide resolved
e5c2567
to
9ef9e2e
Compare
@ndr-brt after talking with @jimmarino I think there is a better way than instantiating an "artificial" extension: we could just use the |
Codecov ReportBase: 64.47% // Head: 64.57% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2373 +/- ##
==========================================
+ Coverage 64.47% 64.57% +0.09%
==========================================
Files 839 842 +3
Lines 17390 17491 +101
Branches 1048 1054 +6
==========================================
+ Hits 11213 11295 +82
- Misses 5744 5761 +17
- Partials 433 435 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Looks good to me, so can we get rid of the |
yes of course, forgot to delete, thanks. |
9ef9e2e
to
3101280
Compare
This pull request is stale because it has been open for 7 days with no activity. |
What this PR changes/adds
Adds a "synthetic" extension, whos job is solely to declare a
@Provides
list for theMonitor
,TypeMAnager
,Clock
andTelemetry
, all of which are services that are instantiated in a special way.Why it does that
Avoid cyclic dependencies
Further notes
I opted for adding theSyntheticExtension
and then removing it again, because that seemed to have the least impact on the code base while at the same time satisfying the dependency resolution mechanism.TheSyntheticExtension
is not needed outside of dependency loading, which is why I chose not to instantiate it through the service loader and I removed it again right after the topological sort went through.ServiceExtensionContext
is used as fallback: whenever a feature cannot be satisfied through normal dependency resolution, we check if the context already has that service registered, in which case no error is thrown.Linked Issue(s)
Closes #2372
Checklist
no-changelog
)