[
https://issues.apache.org/jira/browse/SLING-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carsten Ziegeler resolved SLING-4257.
-------------------------------------
Resolution: Won't Fix
> Sling Models Inject OSGi Property
> ---------------------------------
>
> Key: SLING-4257
> URL: https://issues.apache.org/jira/browse/SLING-4257
> Project: Sling
> Issue Type: New Feature
> Components: Sling Models
> Affects Versions: Sling Models API 1.1.0, Sling Models Implementation 1.0.6
> Reporter: Dan Klco
> Priority: Minor
>
> It would be convenient in certain cases to reference an OSGi configuration
> property for another service within a Sling Model. This would allow
> developers to reference the property without having to reference the service
> itself.
> The use case where I encountered this was:
> - I was creating a Sling Model class for representing a Cloud Service
> configuration in AEM.
> - This cloud service implementation would be exposed through a factory
> service which implements an interface provided by Adobe
> - The Model should expose the Web Service host which is configured through
> the service implementation's OSGI configuration, but the service interface
> doesn't expose any methods for doing this
> To get around this I added another interface into my service implementation
> to expose a method for getting at this value, but it seems to be more
> convenient if I could just get at the value directly instead. I was thinking
> you could set it up to parse the @Named attribute, expecting something like
> @Named("com.my.osgi.ServiceImpl/property.name") with the service PID followed
> by the property name.
> Do others see this as a valid use case? Would this be valuable for anyone
> else?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)