eclipse-ee4j / eclipse-ee4j/jersey
DynamicFeature.configure(ResourceInfo, FeatureContext) doesn't give access to ServiceLocator
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
`ServiceLocatorProvider.getServiceLocator(FeatureContext)` doesn't work inside `DynamicFeature` because of this [line](https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java#L243), which calls `.configure()` on a `ResourceMethodConfig` instance, not a wrapped `FeatureContextWrapper` instance.
Should instead pull the available `locator` in as well, to allow injection of services in the dynamically-created beans.
Contributor guide
Research direction
Start at core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java around line 243 and trace how DynamicFeature.configure(ResourceInfo, FeatureContext) receives its context. Compare the ResourceMethodConfig call with the FeatureContextWrapper and the available ServiceLocator; done means ServiceLocatorProvider.getServiceLocator(FeatureContext) works for dynamically created beans.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100