PicoContainer
  1. PicoContainer
  2. PICO-251

DecoratingCA may not extend MonitoringCA

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The DecoratingCA must delegate the new CM to its delegate, otherwise the Pico cannot exchange the monitors. Therefore DecoratingCA may not extend MonitoringCA, but implement only CMStrategy. In case of a change if has to test its delegate for implementing CMStrategy also.

        Activity

        Hide
        peter royal added a comment -

        DecoratingCA does delegate a new CM to its delegate. Thus this issue is resolved?

        Show
        peter royal added a comment - DecoratingCA does delegate a new CM to its delegate. Thus this issue is resolved?
        Hide
        Jörg Schaible added a comment -

        No, it's still in progress by Mauro. We're in discussion, where to put MonitoringCA into the hierarchy. While we talk about "the" CA for a component it is in fact a CA chain, e.g.:

        new ThreadLocalCA(new CachingCA(new HotSwappingCA(new CICA(XY.class))))

        only the inner CA instance must have a monitor!

        • Jörg
        Show
        Jörg Schaible added a comment - No, it's still in progress by Mauro. We're in discussion, where to put MonitoringCA into the hierarchy. While we talk about "the" CA for a component it is in fact a CA chain, e.g.: new ThreadLocalCA(new CachingCA(new HotSwappingCA(new CICA(XY.class)))) only the inner CA instance must have a monitor! Jörg
        Mauro Talevi made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Mauro Talevi added a comment -

        yes - the DecoratingCA has been changed to delegate the new CM.

        But the issue outstanding is how to make only the innermost CA have the monitor. I think this would require adding a method

        ComponentMonitorStrategy#currentMonitor()

        ATM there is no way to have access to the current monitor of the degated CA which is injected into another CA.
        Only be extending MonitoringCA can we do that.

        Objections to adding the new method to CMS?

        Show
        Mauro Talevi added a comment - yes - the DecoratingCA has been changed to delegate the new CM. But the issue outstanding is how to make only the innermost CA have the monitor. I think this would require adding a method ComponentMonitorStrategy#currentMonitor() ATM there is no way to have access to the current monitor of the degated CA which is injected into another CA. Only be extending MonitoringCA can we do that. Objections to adding the new method to CMS?
        Hide
        Jörg Schaible added a comment -

        All the time I thougt, that currentMonitor() is part of CMS ... because it was part of the DecoratingCA! Yes; you'll need it in CMS.

        Show
        Jörg Schaible added a comment - All the time I thougt, that currentMonitor() is part of CMS ... because it was part of the DecoratingCA! Yes; you'll need it in CMS.
        Hide
        Mauro Talevi added a comment -

        That's where the communication wires crossed

        Show
        Mauro Talevi added a comment - That's where the communication wires crossed
        Hide
        Mauro Talevi added a comment -

        Added currentMonitor() to ComponentMonitorStrategy.
        Removed inheritance of DelegatingCA from MonitoringCA.
        DelegatingCA#currentMonitor() will return the current monitor of the delegate
        if it supports CMS. If not, it will throw a PicoIntrospectionException,

        DefaultPC also implements ComponentMonitorStrategy:
        currentMonitor() is retrieved in order from CAF, CAs and child containers.
        If not found in any, it will throw a PicoIntrospectionException.

        Show
        Mauro Talevi added a comment - Added currentMonitor() to ComponentMonitorStrategy. Removed inheritance of DelegatingCA from MonitoringCA. DelegatingCA#currentMonitor() will return the current monitor of the delegate if it supports CMS. If not, it will throw a PicoIntrospectionException, DefaultPC also implements ComponentMonitorStrategy: currentMonitor() is retrieved in order from CAF, CAs and child containers. If not found in any, it will throw a PicoIntrospectionException.
        Mauro Talevi made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Jörg Schaible
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: