-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bridge Dagger and Jersey, inject TransitService #5442
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
base: dev-2.x
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5442 +/- ##
=============================================
- Coverage 67.50% 66.76% -0.75%
+ Complexity 16285 15446 -839
=============================================
Files 1888 1799 -89
Lines 71547 69795 -1752
Branches 7408 7354 -54
=============================================
- Hits 48301 46600 -1701
+ Misses 20747 20733 -14
+ Partials 2499 2462 -37 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Thomas Gran <[email protected]>
Summary
This PR is a POK on how to BRIDGE Dagger and Jersey. The ideal would be to replace Jersey DI with Dagger, but bridging is much simpler. The only code needed to do this is in the
JerseyToDaggerBridge
, the rest of the changes is to proof that it works by injecting the TransitService.In the current design the
OtpServerRequestContext
is responsible for providing a consistent set of Services for a Request coped Resource. I think we can merge this PR, but before we continue injecting other services directly into Resources we need to make sure we can provide a consistent set of RequestScopedServices.Also, I do NOT want to inject anything else then Services into the Resources, so if resource
AbcResource
is using the e.g. RouterConfig then aAbcResourceService
class should be created. Dagger should then wire theAbcResourceService
and Jersey should injectAbcResourceService
intoAbcResource
.Unit tests
Fixed.
Documentation
TODO: I would like to document the layers and injection strategy:
Changelog
Not relevant
Bumping the serialization version id
No.