jersey
  1. jersey
  2. JERSEY-260

Make AbstractHttpContextInjectable available in the SPI

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      260

      Description

      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.

        Activity

        Hide
        Marek Potociar added a comment -

        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.

        Show
        Marek Potociar added a comment - 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            tedwards
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: