[
https://issues.apache.org/jira/browse/COMMONSRDF-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14523158#comment-14523158
]
Stian Soiland-Reyes commented on COMMONSRDF-20:
-----------------------------------------------
(Sorry for duplicate, this email didn't show up in Jira)
The ServiceLoader approach is not incompatible with OSGi as long as you don't
have boxed in code that does its own ServiceLoader without providing
alternative ways to inject implementations (e.g. as discovered through OSGi
services).
For an example of a broken one, see FileSystemProvider in Java 8. :-)
My +1 to just insert as Benedikt suggest, and not make the registry. I think
this is mainly of use for in-between libraries that don't want to have to
choose, and don't want injecting of factory from the outside. As our objects
are inter+compatible it may not be of great importance which impl they get, as
long as they get one.
It is very easy and non-intrusive to simultaneously declare an OSGi Declarative
Service as an XML in OSGI-INF/
http://www.vogella.com/tutorials/OSGiServices/article.html#declarativeservices_define
Alternatively you can use @annotations and the maven plugin (added as
<scope>provided</scope> dependencies), which I think is overkill for a single
service with no dependencies to be injected.
> Provide a mechanism for allowing the load of different RDF Term Factories
> --------------------------------------------------------------------------
>
> Key: COMMONSRDF-20
> URL: https://issues.apache.org/jira/browse/COMMONSRDF-20
> Project: Apache Commons RDF
> Issue Type: New Feature
> Affects Versions: 0.1
> Reporter: Sergio Fernández
> Fix For: 0.2
>
>
> Benedikt has asked this questions in the mailing list:
> http://markmail.org/message/az4jb744zfct2uq5
> What [we currently
> have|http://commonsrdf.incubator.apache.org/userguide.html#Creating_Commons_RDF_instances]
> remains valid, but would be great to make easier the life of people.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)