Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox and Declarative Services Annotations
Equinox and Declarative Services Annotations [message #956159] Wed, 24 October 2012 09:34 Go to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi,
In the OSGi compendium specification (Release 4, Version 4.3) on page 275 annotations are defined as an alternative for the DS XML files. I noticed that the package org.osgi.service.component.annotations which contains those annotations is exported in org.osgi.services (3.3.100) which comes with the latest Equinox SDK.

I was not able to use the annotations with Equinox. Also, there are not dependencies from equinox.ds to org.osgi.service.component.annotations. I think this indicates that it's simply not implemented, right?

Are there any plans to support this or is there a known workaround e.g. using Apache SCR?

Thanks in advance.

Cheers Holger
Re: Equinox and Declarative Services Annotations [message #956195 is a reply to message #956159] Wed, 24 October 2012 10:02 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Hi Holger,

Am 24.10.2012 11:34, schrieb Holger Staudacher:
> In the OSGi compendium specification (Release 4, Version 4.3) on
> page 275 annotations are defined as an alternative for the DS XML files. I
> noticed that the package org.osgi.service.component.annotations which
> contains those annotations is exported in org.osgi.services (3.3.100)
> which comes with the latest Equinox SDK.

AFAIK the annotations are not interpret at runtime. They are only useful
for at build time when the XML file is actually generated. DS still
relies on the XML file currently.

There is a contribution in Bugzilla to add such a build processing step
to PDE. But the activity on the bug is not very promising. Do you know
if there is a Tycho/Maven plug-in which can generate the XML?

-Gunnar

--
Gunnar Wagenknecht
gunnar@xxxxxxxx
http://wagenknecht.org/
Re: Equinox and Declarative Services Annotations [message #956381 is a reply to message #956195] Wed, 24 October 2012 13:11 Go to previous messageGo to next message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
Gunnar Wagenknecht wrote on Wed, 24 October 2012 06:02

AFAIK the annotations are not interpret at runtime. They are only useful
for at build time when the XML file is actually generated. DS still
relies on the XML file currently.


This is correct. These annotations have only class retention and are not runtime visible annotations. They are for tools to use (like bnd or PDE) to generate the xml when packaging the bundle. DS implementation cannot use the annotations at runtime; they must only use the xml.
Re: Equinox and Declarative Services Annotations [message #956450 is a reply to message #956381] Wed, 24 October 2012 14:11 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Thanks BJ for clarifying.

I know there is some improvement work happening for DS.

Has it been discussed to allow those annotations at runtime and add a
"Service-ComponentClass" header to the manifest? DS could do byte code
scanning to scan those classes for annotations and generate the
component at runtime (without loading the class).

-Gunnar

--
Gunnar Wagenknecht
gunnar@xxxxxxxx
http://wagenknecht.org/
Re: Equinox and Declarative Services Annotations [message #956499 is a reply to message #956450] Wed, 24 October 2012 15:09 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Thanks for clarifying this. I simply missed the policy.

@Gunnar: I have openend a bug against tycho, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=392764
Re: Equinox and Declarative Services Annotations [message #956764 is a reply to message #956450] Wed, 24 October 2012 19:44 Go to previous message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
Gunnar Wagenknecht wrote on Wed, 24 October 2012 10:11
Has it been discussed to allow those annotations at runtime and add a
"Service-ComponentClass" header to the manifest? DS could do byte code
scanning to scan those classes for annotations and generate the
component at runtime (without loading the class).


Yes, the idea to support the annotations at runtime has been mentioned for a future spec. Such support would be necessary to allow "inheritance" of annotations so that, for example, @Reference could be used in a super class of the component implementation class.

No actual work has started on this though. The current proposals for the next DS spec update do not include this.
Previous Topic:[SOLVED] ClassLoader problem : How to specify it ?
Next Topic:Redirect std out inside console
Goto Forum:
  


Current Time: Wed Apr 24 21:13:25 GMT 2024

Powered by FUDForum. Page generated in 0.04531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top