[MAGNOLIA-2787] InstallContext should not be available to ModuleVersionHandlers at instantiation time Created: 15/Jun/09 Updated: 04/Nov/15 Resolved: 04/Nov/15 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 4.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Magnolia International | Assignee: | Philipp Bärfuss |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| 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
|
||||||||||||
| Date of First Response: | |||||||||||||
| Description |
|
Considering the following code: public class MyModuleVersionHandler extends DefaultModuleVersionHandler { public MyModuleVersionHandler() { super(); final ModuleDefinition currentModule = ModuleManager.Factory.getInstance().getInstallContext().getCurrentModuleDefinition(); System.out.println(currentModule); } } As of 4.1, this print the ModuleDefinition of the module preceding the one corresponding to this version handler. In further versions, this should probably not be feasible at all, since one should only use the InstallContext in the execute method of Tasks. Also see info.magnolia.module.delta.RegisterModuleServletsTask, which uses the InstallContext at execution time to instanciate other tasks, which is something that might need to be simpler/cleaner too. |
| Comments |
| Comment by Jan Haderka [ 09/Oct/12 ] |
|
I would say this is part of bigger bundle - rewrite module management to use guide ioc introduced in 4.5 |
| Comment by Tobias Mattsson [ 02/Dec/13 ] |
|
I'd be in favour of removing the ModuleManager.getInstallContext() completely. It appears to not be in use anywhere, expect for internally of course. |
| Comment by Michael Mühlebach [ 04/Nov/15 ] |
|
Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes. |