Closed jerseyrobot closed 9 years ago
@glassfishrobot Commented Reported by tedwards@java.net
@glassfishrobot Commented @mpotociar said: This issue has been already deferred to "ice box". Also, it has not collected any support votes and has not been updated this year at all. Closing as won't fix due to not enough interest from the community.
@glassfishrobot Commented This issue was imported from java.net JIRA JERSEY-260
@glassfishrobot Commented Marked as won't fix on Thursday, September 10th 2015, 12:08:51 pm
Changes in Jersey 1.0.0 -> 1.0.2 for better DI integration meant the the Injectable interface method getValue(HttpContext) became getValue(). Any implementers of this interface had to change to using injection to obtain the HttpContext of the current request.
However, the Jersey implementation contains an AbstractHttpContextInjectable class containing a getValue(HttpContext) method, which is treated as a special case by the internals and is a slight optimization over the injection approach.
I'm suggesting making the AbstractHttpContextInjectable (or something similar, it would currently require a small change to the implementation of getValue()) available in the SPI so implementers can also make use of that feature. I believe this is a benifit for a couple of reasons:
1) Implementers have a choice in how to implement Injectables, i.e. if you are developing an injectable that you know will only be used server side then you may wish to benefit from AbstractHttpContextInjectable, if not then you can still implement Injectable directly & use injection for HttpContext if required.
2) The Jersey implementation will become a better example of 'best practices' in how to use the framework, rather than having its own internal way of doing things which will be tempting for implementers to rely on, especially if any other way of achieving the same goal is not clear.
Environment
Operating System: All Platform: All