PicoContainer
  1. PicoContainer
  2. PICO-71

Make CachingComponentAdapter more reusable

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: 1.0-beta-4
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      1

      Description

      Hi, i copied the ObjectReference interface from the pico integration kit to the pico project and made CachingComponentAdapter use it internally or if requested otherwise the one supplied in the constructor.

      Sample:

      new CachingComponentAdapter(new ConstructorComponentAdapter(stuff));

      will cache the instance in a serializable class just like it used to.

      new CachingComponentAdapter(delegate, new AppScopeObjectReference("key"));

      will cache the object in an ServletContext attribute referenced by "key". [see picoextras-servlet].

      I believe that storing the reference inside the componentAdapter isnt always the best choice and by applying this it will just let you choose to do it or not.

      All tests passed too.

        Activity

        Hide
        Thomas Heller added a comment -

        extract to pico root and keep folder names.

        Show
        Thomas Heller added a comment - extract to pico root and keep folder names.
        Thomas Heller made changes -
        Field Original Value New Value
        Attachment patch.zip [ 11084 ]
        Aslak Hellesøy made changes -
        Assignee Joe Walnes [ jwalnes1 ]
        Aslak Hellesøy made changes -
        Fix Version/s 1.0.1 [ 10307 ]
        Hide
        Aslak Hellesøy added a comment -

        Good idea! Applied with minor changes.

        Show
        Aslak Hellesøy added a comment - Good idea! Applied with minor changes.
        Aslak Hellesøy made changes -
        Assignee Joe Walnes [ jwalnes1 ] Aslak Hellesoy [ rinkrank ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.0.1 [ 10307 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0 [ 10145 ]
        Aslak Hellesøy made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Aslak Hellesøy made changes -
        Fix Version/s 1.0 [ 10145 ]
        Fix Version/s 1.0-beta-4 [ 10412 ]
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            Thomas Heller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: