[MAGNOLIA-3376] ServletContext should be available to modules during startup Created: 09/Nov/10  Updated: 09/Dec/11  Resolved: 09/Dec/11

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

Type: Improvement Priority: Major
Reporter: Tobias Mattsson Assignee: Tobias Mattsson
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
supersession
is superseded by 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)

 Description   

Currently the ServletContext is not available to modules during startup. This is for instance a problem in integration scenarios where the module starts a framework such as Spring. In blossom this has been solved by adding an extra context listener. A cleaner solution would be to make it available in standard magnolia.

Modules are started using SystemContext. Set in ConfigLoader.load() or ModuleManagerWebUI.execute().

If we add getServletContext() to SystemContext it still has to be taken from somewhere. The implementation we use for SystemContext is configured in mgnl-beans.properties and created by Components. The implementation would have to look for it somewhere, probably a static field.

If we had a DI container in place then ServletContext could have been one of the injectible types and the problem would be solved.



 Comments   
Comment by Tobias Mattsson [ 09/Dec/11 ]

Solved with dependency injection.

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