[MAGNOLIA-3736] IoC: startables are started at registration time Created: 15/Jun/11  Updated: 15/Sep/11  Resolved: 15/Sep/11

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Tobias Mattsson Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File StartableTest.java    
Issue Links:
relation
is related to MAGNOLIA-2569 Components: introduce dependency inje... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Comments   
Comment by Tobias Mattsson [ 15/Jun/11 ]

When we register components in the main container, it is already started. When we register a class that is startable and uses @AtStartup it is started as soon as it is registered. When this class depends on another class which has yet to be registered then instantiation fails.

In effect this means that @AtStartup is not usable in the main container.

To resolve this we need to modify the start up sequence so all registration is done before the container is started.

Comment by Tobias Mattsson [ 15/Jun/11 ]

Test case that shows the problem

Generated at Mon Feb 12 03:49:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.