Details

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

      Description

      Jason wants hot swapping of components (A->B), hotswap B at runtime.

      This can easily be achieved by letting A have a ref to a proxy for B (See ImplementationHidingComponentAdapterFactory - IHCAF).

      This feature could be added with something like:

      ImplementationHidingComponentAdapterFactory ihfca = ... MutablePicoContainer pico = new DefaultPicoContainer(ihcfa)
      pico.register(A.class)
      pico.register(B.class)

      Then a while later maybe something like:
      ihcaf.hotswap(B.class, new SomeB())

      This forces the outside to instantiate the component instance and not the container though. How would we do it if we want the container to instantiate the new one?

        Activity

        Aslak Hellesøy made changes -
        Field Original Value New Value
        Description Jason wants hot swapping of components (A->B), hotswap B at runtime.

        This can easily be achieved by letting A have a ref to a proxy for B (See ImplementationHidingComponentAdapterFactory - IHCAF).

        This feature could be added with something like:

        ImplementationHidingComponentAdapterFactory ihfca = ... MutablePicoContainer pico = new DefaultPicoContainer(ihcfa)
        pico.register(A.class)
        pico.register(B.class)

        Then a while later....

        I'm not quite sure what the best API call would be though. Questions we need to ask ourself:

        o Do we ask the container or the ihcaf to do the hotswap? (I prefer ihcaf)
        o Is the new component instantiated by the container/ihcaf or outside? (I prefer the inside)

        One possible solution:
        ImplementationHidingComponentAdapterFactory.hotswap(Object key, Object componentInstance)

        This forces the outside to instantiate the component instance and not the container. How would we do it if we want the container to instantiate the new one?
        Jason wants hot swapping of components (A->B), hotswap B at runtime.

        This can easily be achieved by letting A have a ref to a proxy for B (See ImplementationHidingComponentAdapterFactory - IHCAF).

        This feature could be added with something like:

        ImplementationHidingComponentAdapterFactory ihfca = ... MutablePicoContainer pico = new DefaultPicoContainer(ihcfa)
        pico.register(A.class)
        pico.register(B.class)

        Then a while later maybe something like:
        ImplementationHidingComponentAdapterFactory.hotswap(Object key, Object componentInstance)

        This forces the outside to instantiate the component instance and not the container though. How would we do it if we want the container to instantiate the new one?
        Aslak Hellesøy made changes -
        Description Jason wants hot swapping of components (A->B), hotswap B at runtime.

        This can easily be achieved by letting A have a ref to a proxy for B (See ImplementationHidingComponentAdapterFactory - IHCAF).

        This feature could be added with something like:

        ImplementationHidingComponentAdapterFactory ihfca = ... MutablePicoContainer pico = new DefaultPicoContainer(ihcfa)
        pico.register(A.class)
        pico.register(B.class)

        Then a while later maybe something like:
        ImplementationHidingComponentAdapterFactory.hotswap(Object key, Object componentInstance)

        This forces the outside to instantiate the component instance and not the container though. How would we do it if we want the container to instantiate the new one?
        Jason wants hot swapping of components (A->B), hotswap B at runtime.

        This can easily be achieved by letting A have a ref to a proxy for B (See ImplementationHidingComponentAdapterFactory - IHCAF).

        This feature could be added with something like:

        ImplementationHidingComponentAdapterFactory ihfca = ... MutablePicoContainer pico = new DefaultPicoContainer(ihcfa)
        pico.register(A.class)
        pico.register(B.class)

        Then a while later maybe something like:
        ihcaf.hotswap(B.class, new SomeB())

        This forces the outside to instantiate the component instance and not the container though. How would we do it if we want the container to instantiate the new one?
        Aslak Hellesøy made changes -
        Fix Version/s 1.0.1 [ 10307 ]
        Fix Version/s 1.0-beta-3 [ 10232 ]
        Hide
        Aslak Hellesøy added a comment -

        This would be better:

        ihcaf.hotswap(B.class, SomeB.class)

        Show
        Aslak Hellesøy added a comment - This would be better: ihcaf.hotswap(B.class, SomeB.class)
        Hide
        Aslak Hellesøy added a comment -

        This is now implemented. See docs and test cases for more info.

        Show
        Aslak Hellesøy added a comment - This is now implemented. See docs and test cases for more info.
        Aslak Hellesøy made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0.1 [ 10307 ]
        Fix Version/s 1.0 [ 10145 ]
        Aslak Hellesøy made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Aslak Hellesøy made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 1.0-beta-4 [ 10412 ]
        Fix Version/s 1.0 [ 10145 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: