Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Why is that implicit container hierachies must share the same lifecycle?

      From DefaultPicoContainerLifecycleTestCase:

      public void testComponentsAreStartedBreadthFirstAndStoppedDepthFirst()

      { MutablePicoContainer parent = new DefaultPicoContainer(); parent.registerComponentImplementation("recording", StringBuffer.class); parent.registerComponentImplementation(A.class); parent.registerComponentImplementation("child", DefaultPicoContainer.class); DefaultPicoContainer child = (DefaultPicoContainer) parent.getComponentInstance("child"); child.registerComponentImplementation(B.class); parent.registerComponentImplementation(C.class); parent.start(); parent.stop(); assertEquals("<A<C<BB>C>A>", parent.getComponentInstance("recording").toString()); }

      works, while:

      public void testComponentsAreStartedBreadthFirstAndStoppedDepthFirst()

      { MutablePicoContainer parent = new DefaultPicoContainer(); parent.registerComponentImplementation("recording", StringBuffer.class); parent.registerComponentImplementation(A.class); parent.registerComponentImplementation("child", DefaultPicoContainer.class); DefaultPicoContainer child = (DefaultPicoContainer) parent.getComponentInstance("child"); child.registerComponentImplementation(B.class); parent.registerComponentImplementation(C.class); parent.start(); child.start(); child.stop(); parent.stop(); assertEquals("<A<C<BB>C>A>", parent.getComponentInstance("recording").toString()); }

      doesn't as the child tries to start the parent again?

      As long as hierachies are build using child.setParent(parent) the lifecycle will work. I don't know what your intended use of implicit hierachies is as I'm not using them this way but thought I should mention it.

        Activity

        Hide
        Aslak Hellesøy added a comment -

        This is a question, and as such belongs on the mailing list.

        Show
        Aslak Hellesøy added a comment - This is a question , and as such belongs on the mailing list.
        Aslak Hellesøy made changes -
        Field Original Value New Value
        Assignee Aslak Hellesoy [ rinkrank ]
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: