[MAGNOLIA-4311] ioc: add @Named support for properties Created: 07/Jul/11  Updated: 22/Mar/12  Resolved: 22/Dec/11

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

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

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)
Date of First Response:

 Comments   
Comment by Tobias Mattsson [ 08/Jul/11 ]

Ideally this should work so we can get the current value if it is changed run-time

@Named("some.property")
@Inject
Provider<String> someProperty;
Comment by Tobias Mattsson [ 15/Jul/11 ]

It's possible to inject a property set as string to primitive fields like boolean and int, and use a Provider with Boolean or Integer etc to read it. But it's not possible when we register the property as a provider. We want to bind to Providers instead of constant strings if we want to support changing properties runtime.

So there's a trade off, either inject to primitives or support changing properties at runtime.

Or, we find a way to get both, this needs to be investigated a bit more to find out if its possible or down right cannot be done.

See more details at
http://wiki.magnolia-cms.com/display/DEV/Guice+implementation

Comment by Philipp Bärfuss [ 22/Dec/11 ]

Please describe the status.

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