Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Using @annotations to define Declarative Services components(Discussion of future plans for defining ds components via java annotations)
Using @annotations to define Declarative Services components [message #766496] Thu, 15 December 2011 22:13 Go to next message
Eclipse UserFriend
Hello all, I'd like to start a discussion here. My first glance through the search engine here didn't seem to have anything, so I hope I'm not being too redundant.

I am curious if there has been much interest, discussion, future plans, or progress in implementing a definition for declarative service components via @annotations in Equinox.

It strikes me as a very natural and sugary way to express ds components, and offers the added joy of a single centralized definition. Would officially supporting and implementing this fit within the goals of the equinox.ds project?

And would it be reasonable to pursue an approach that processes these annotations at run-time vs pre-processing them into xml at build-time?

Thoughts?

Here are some similar approaches:
http://felix.apache.org/site/scr-annotations.html
http://code.google.com/a/eclipselabs.org/p/org-eclipselabs-osgi-ds-annotations/
http://www.toedter.com/blog/?p=46

[Updated on: Thu, 15 December 2011 22:17] by Moderator

Report message to a moderator

Re: Using @annotations to define Declarative Services components [message #766746 is a reply to message #766496] Fri, 16 December 2011 10:50 Go to previous messageGo to next message
Ivan Larionov is currently offline Ivan LarionovFriend
Messages: 37
Registered: July 2009
Member
Hi Darren,

Bnd tools for Eclipse seem to be able to generate component definition
xml from annotations.

Since you have asked for thoughts...

With reference to your last statement, in my opinion there are some
reasons why annotations have not been considered.

Firstly, deferred loading of classes is constantly mentioned in the OSGi
spec. And processing annotation in runtime would involve component class
discovery which leads to class loading.

Secondly, OSGi may run in java 1.4 jre where there are no annotations.
Though it seems to be a wild guess as I do not know which version of
java the current OSGi spec is aiming at.

Regards,
Ivan

On 16.12.2011 0:13, Darren Janeczek wrote:
> Hello all, I'd like to start a discussion here. My first glance through
> the search engine here didn't seem to have anything, so I hope I'm not
> being too redundant.
>
> I am curious if there has been much interest, discussion, future plans,
> or progress in implementing a definition for declarative service
> components via @annotations in Equinox.
>
> It strikes me as a very natural and sugary way to express ds components,
> and offers the added joy of a single centralized definition. Would
> officially supporting and implementing this fit within the goals of the
> equinox.ds project?
>
> And would it be reasonable to have an approach that processes these
> annotations at run-time vs pre-processing them into xml at build-time?
>
> Thoughts?
>
> Here are some similar approaches:
> http://felix.apache.org/site/scr-annotations.html
> http://code.google.com/a/eclipselabs.org/p/org-eclipselabs-osgi-ds-annotations/
>
> http://www.toedter.com/blog/?p=46
Re: Using @annotations to define Declarative Services components [message #766822 is a reply to message #766746] Fri, 16 December 2011 13:47 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
To add to Ivan's comments. The next revision of the OSGi specification will be standardizing annotations for DS, but they will be compile time annotations which result in the appropriate generation of the DS component XML file for the bundle which is being build, just like the current bnd tools does today for the felix defined scr annotations. Such support belongs in the DS tooling PDE offers. If you are interested in contributing I suggest you ask on the PDE forum or dev mailing list.

Tom.
Re: Using @annotations to define Declarative Services components [message #766910 is a reply to message #766822] Fri, 16 December 2011 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Thank you both. This makes it very clear why a run-time approach shouldn't be a priority.
I'm going to investigate your suggestion further, Tom.


Thanks,
Darren.
Re: Using @annotations to define Declarative Services components [message #766933 is a reply to message #766910] Fri, 16 December 2011 17:25 Go to previous messageGo to next message
Eclipse UserFriend
Here's an interesting blog which further discusses the idea.

http://tux2323.blogspot.com/2011/10/osgi-rfc-0172-declarative-services.html
Re: Using @annotations to define Declarative Services components [message #766940 is a reply to message #766933] Fri, 16 December 2011 17:42 Go to previous message
Eclipse UserFriend
Thanks also for mentioning bndtools;

http://bndtools.org/

It looks very exciting for a whole range of additional uses.

[Updated on: Fri, 16 December 2011 17:51] by Moderator

Report message to a moderator

Previous Topic:Issue with Jetty 7 upgrade because Equinox SDK 3.7.1 includes old Jetty libs - version 6.1.23
Next Topic:publisher eclipse bundles missing
Goto Forum:
  


Current Time: Tue Apr 23 16:26:00 GMT 2024

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

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

Back to the top