PicoContainer

Support lazy lifecycles

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.8
  • Fix Version/s: 2.9
  • Component/s: PicoContainer (Java)
  • Labels:
    None
  • Number of attachments :
    4

Description

I need a lazy lifecycle strategy within Pico, as in one that will start a component only once it is required. Currently container.start() will eagerly instantiate lifecycled components before they are actually needed. I'd like to intercept when components are instantiated and start them before they are used.

  1. PICO-355-test.patch
    27/May/09 4:00 AM
    2 kB
    Mark Hobson
  2. PICO-355-test2.patch
    23/Sep/09 6:02 AM
    1 kB
    Mark Hobson
  3. PICO-355-test3.patch
    26/Oct/09 5:55 AM
    1 kB
    Mark Hobson
  4. PICO-355-test4.patch
    27/Oct/09 6:45 AM
    1 kB
    Mark Hobson

Activity

Hide
Mark Hobson added a comment -

Attached StartableLifecycleStrategyTestCase patch to demonstrate requirement.

Show
Mark Hobson added a comment - Attached StartableLifecycleStrategyTestCase patch to demonstrate requirement.
Hide
Mark Hobson added a comment -

Reopening since the fix doesn't fulfil the original requirements.

Show
Mark Hobson added a comment - Reopening since the fix doesn't fulfil the original requirements.
Hide
Mark Hobson added a comment -

Attaching {{PICO-355-test2.patch}} to demonstrate the requirements.

Show
Mark Hobson added a comment - Attaching {{PICO-355-test2.patch}} to demonstrate the requirements.
Hide
Paul Hammant added a comment -

Take a look again Mark.

See http://fisheye.codehaus.org/changelog/picocontainer/?cs=5533

You'll have to extend DefaultPicoContainer to make it work, but it should be what you want.

Show
Paul Hammant added a comment - Take a look again Mark. See http://fisheye.codehaus.org/changelog/picocontainer/?cs=5533 You'll have to extend DefaultPicoContainer to make it work, but it should be what you want.
Hide
Mark Hobson added a comment -

Reopening to attach test improvement patch.

Show
Mark Hobson added a comment - Reopening to attach test improvement patch.
Hide
Mark Hobson added a comment -

Attaching {{PICO-355-test3.patch}} to improve test by not attempting to restart a started component.

Show
Mark Hobson added a comment - Attaching {{PICO-355-test3.patch}} to improve test by not attempting to restart a started component.
Hide
Mark Hobson added a comment -

Found a problem with the current solution: an ISE is thrown when the container is disposed if the component hasn't been instantiated. {{PICO-355-test4.patch}} demonstrates the problem.

Show
Mark Hobson added a comment - Found a problem with the current solution: an ISE is thrown when the container is disposed if the component hasn't been instantiated. {{PICO-355-test4.patch}} demonstrates the problem.
Hide
Paul Hammant added a comment -

Fixed again

Show
Paul Hammant added a comment - Fixed again

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: