PicoContainer
  1. PicoContainer
  2. PICO-271

Child containers created from a started MPC are not stopped when parent is stopped

    Details

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

      Description

      Caused by http://svn.picocontainer.codehaus.org/java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/DefaultPicoContainer.java?r1=2780&r2=2787&p1=java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/DefaultPicoContainer.java&p2=java/picocontainer/trunk/container/src/java/org/picocontainer/defaults/DefaultPicoContainer.java

      This fails (roughly, will make testcase later)

      DPC parent = new DPC();

      parent.start();

      MPC child = parent.makeChildContainer();

      child.start();

      parent.stop();
      // child container is never stopped since the parent container didn't start it. this used to work right

        Activity

        Hide
        Jörg Schaible added a comment -

        This is a result of PICO-263, see my comment from 2nd Dec. If we revert the change, I have a critical issue. Maybe we should add the added child containers to the list of started containers, if the container has been started. It seems that we really have to look at the LC in the different situations for the next release.

        Show
        Jörg Schaible added a comment - This is a result of PICO-263 , see my comment from 2nd Dec. If we revert the change, I have a critical issue. Maybe we should add the added child containers to the list of started containers, if the container has been started. It seems that we really have to look at the LC in the different situations for the next release.
        Hide
        peter royal added a comment -

        I think a container needs to have a method to determine if it has been started or not. Then a parent container can stop all of its children that are started, regardless of how they were started. That should solve both needs.

        Show
        peter royal added a comment - I think a container needs to have a method to determine if it has been started or not. Then a parent container can stop all of its children that are started, regardless of how they were started. That should solve both needs.
        Hide
        peter royal added a comment -

        Failing test case added.

        Easiest would be to add PicoContainer.isStarted(). Alternatively, some new interface that DPC could look at to tell if a child container has been started.

        Show
        peter royal added a comment - Failing test case added. Easiest would be to add PicoContainer.isStarted(). Alternatively, some new interface that DPC could look at to tell if a child container has been started.
        Hide
        Jörg Schaible added a comment -

        For now I have assumed, that the added child container will take part on the current LC state of the parent. This is at least compatible.

        Show
        Jörg Schaible added a comment - For now I have assumed, that the added child container will take part on the current LC state of the parent. This is at least compatible.
        Jörg Schaible made changes -
        Field Original Value New Value
        Assignee Joerg Schaible [ joehni ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.2 [ 11330 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            peter royal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: