[MAGNOLIA-4972] Commands should be able to use @Inject Created: 12/Apr/13  Updated: 10/Mar/21  Resolved: 10/Mar/21

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

Type: Bug Priority: Neutral
Reporter: Magnolia International Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MAGNOLIA-5069 Write a test case for commands with i... Closed
relation
is related to MAGNOLIA-2569 Components: introduce dependency inje... Closed
is related to MAGNOLIA-4396 Servlets should be able to use @Inject Closed
is related to MAGNOLIA-7850 Make Commands being a definition/regi... Accepted
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   

Commands are currently instantiated with command.getClass().newInstance(); in info.magnolia.commands.CommandsManager#getCommand, thus can't benefit from DI. They would greatly benefit from it though.
Note: perhaps we need to clarify a command instance lifecycle.



 Comments   
Comment by Magnolia International [ 06/Dec/13 ]

The snippet mentioned above doesn't exist anymore, so this might not be valid anymore. Need to double check.

Comment by Richard Gange [ 10/Mar/21 ]

Cont'd on MAGNOLIA-7850

Generated at Mon Feb 12 04:00:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.