Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Clean way of being notified of new OSGi Services?
Clean way of being notified of new OSGi Services? [message #1794529] Fri, 31 August 2018 22:07 Go to next message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 80
Registered: April 2017
Member
Hi all,

I would like know if there is a clean way to be notified of new OSGi services available.
I know that with @Inject + @Service can be used for the injection of the highest service implementation (applied to a single field) or all the implementations if applied to a list.

@Service makes the code really clean and has the advantage of keeping the references updated, but unfortunately cannot be applied to a method (like @Inject) to react when a new service implementation is available.

Is there a clean e(fx)clipe way to do this or should I just add a ServiceListener to the BundleContext in an Activator?

Thanks!
Re: Clean way of being notified of new OSGi Services? [message #1794530 is a reply to message #1794529] Fri, 31 August 2018 23:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Sure it can be applied to a method but there the @Service needs to be put on the argument
Re: Clean way of being notified of new OSGi Services? [message #1794605 is a reply to message #1794530] Mon, 03 September 2018 16:27 Go to previous message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 80
Registered: April 2017
Member
Thank you Tom.
Previous Topic:How can I customize how default elements are rendered?
Next Topic:Cannot use "Generate Javafx getter and setters"
Goto Forum:
  


Current Time: Wed Dec 04 07:18:00 GMT 2024

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

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

Back to the top