Resolution: Won't Fix
Affects Version/s: None
Fix Version/s: None
Operating System: All
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.