You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/06/25 11:26:00 UTC
[jira] [Updated] (SLING-4257) Sling Models Inject OSGi Property
[ https://issues.apache.org/jira/browse/SLING-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konrad Windszus updated SLING-4257:
-----------------------------------
Component/s: Sling Models
> 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.3.4#803005)