ServiceLoader<?> and OSGi bundles - does OSGi bypass the internal ServiceLoader<?> code? [message #87046] |
Thu, 19 April 2007 23:20 |
No real name Messages: 113 Registered: July 2009 |
Senior Member |
|
|
I need to create a jar file that can run under OSGi as well as a
non-OSGi framework. The jar file provides some services whether OSGi or
non-OSGi.
A reference to an earlier email around this subject is:
http://osdir.com/ml/ide.eclipse.equinox.devel/2007-01/msg000 39.html
it suggests that ServiceLoader<?> can be used with OSGi services thereby
allowing me to build both OSGi and ServiceLoader<?> service
initialization capabilities into the same jar. This would allow me to
enable both service approaches depending on the application.
I tried to build a jar file that is an OSGi bundle with a
ServiceLoader<?> access step (the programmatic approach) in one of my
classes but found as an OSGi bundle, the ServiceLoader<?> is not
returning my sevices as documented in J2SE 1.6 descriptions.
Does OSGi bypass or disable the ServiceLoader<?> capability?
The use of the META.MF/services approach is mentioned in section 702 of
the OSGi comp. document.
|
|
|
Powered by
FUDForum. Page generated in 0.03096 seconds