Re: [picocontainer-dev] Lazy lifecycle
Mark Hobson <[email protected]> Wed, 30 Sep 2009 15:38:32 +0100
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Anyone have any pointers regarding this? Cheers, Mark 2009/9/23 Mark Hobson <[email protected]>: > Finally got back to this issue after a slight delay! I've reopened > PICO-355 as the original fix didn't fulfil my requirements. I'll try > to explain better this time.. > > Currently, if you register a startable component, it is started when > the container is started. I want a lifecycle strategy that only > starts components when they are instantiated for use. > > For example, this is what currently happens ('A' is a Startable component): > > 1) pico.as(CACHE).addComponent(A.class) > 2) pico.start() > 3) (A is started) > > This is what I want to achieve: > > 1) pico.as(CACHE).addComponent(A.class) > 2) pico.start() > 3) (A is *not* started) > 4) pico.getComponent(A.class) > 5) (A is started) > > Similarly, stop and dispose need to behave accordingly. > > I've attached the above example as PICO-355-test2.patch under > PICO-355. I'm happy to have a stab at providing a fix if someone > could point me in the right direction. > > Cheers, > > Mark > > 2009/6/11 Paul Hammant <[email protected]>: >> Sure there is plenty of time for me to change it. send me a modified >> testcase if you so desire :) >> >> Regards, >> >> - Paul >> >> On Jun 11, 2009, at 9:14 AM, Mark Hobson wrote: >> >>> Strange, I didn't receive any email notifications. Thanks for the >>> quick fix, although I'm not sure that that's what I need. I'll try to >>> find some time soon to have a proper look and let you know. >>> >>> Cheers, >>> >>> Mark >>> >>> 2009/6/8 Paul Hammant <[email protected]>: >>>> >>>> fixed :) >>>> >>>> Regards, >>>> >>>> - Paul >>>> >>>> On Jun 8, 2009, at 5:31 AM, Mark Hobson wrote: >>>> >>>>> Paul, did you get a chance to take a look at this? >>>>> >>>>> Cheers, >>>>> >>>>> Mark >>>>> >>>>> 2009/5/27 Mark Hobson <[email protected]>: >>>>>> >>>>>> 2009/5/26 Paul Hammant <[email protected]>: >>>>>>> >>>>>>> That should be easy. >>>>>> >>>>>> Cool :) >>>>>> >>>>>>> Can to get us half way by writing a testcase :-) Perhaps a mod to >>>>>>> StartableLifecycleStrategyTestCase >>>>>>> I expect I'll be subclassing (or better) StartableLifecycleStrategy >>>>>>> ... >>>>>> >>>>>> Sure, I raised PICO-355 and attached a test case. I'm not sure how >>>>>> you want to implement this; I changed >>>>>> testThirdPartyStartableAndDisposable to be AUTOMATIC to signify an >>>>>> eager lifecycle, but this is obviously quite a change that will affect >>>>>> users. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Mark >>>>>> >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe from this list, please visit: >>>>> >>>>> http://xircles.codehaus.org/manage_email >>>>> >>>>> >>>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe from this list, please visit: >>>> >>>> http://xircles.codehaus.org/manage_email >>>> >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe from this list, please visit: >>> >>> http://xircles.codehaus.org/manage_email >>> >>> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email