Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to use declarative services?
How to use declarative services? [message #140427] Wed, 15 July 2009 04:21 Go to next message
Eclipse UserFriend
Originally posted by: a.loerchner.web.de

Hello everyone,
I am pretty new to RAP, RCP and OSGi development and atm I am struggling
to get a declarative service to provide data for a ViewPart to display.

That service is running and I can use it in a pure OSGi application. But
in a RAP application when my ViewPart is created the bind/unbind methods
given in the OSGI-INF/service_component.xml are not called to make the
service available to that class. Actually when running a RAP app the
ViewPart is instantiated two times. For one instance (created by the
service registry) the bind method is called and the service is provided,
for the other instance (the one that gets displayed and is created by
the workbench) the bind method is not called.

I guess I am a bit off the track here so are there any tutorials or
examples on how to use declarative services in a RAP (or RCP) environment?

Best regards,
Andre
Re: How to use declarative services? [message #140511 is a reply to message #140427] Thu, 16 July 2009 09:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Andre,

I can't imagine how RAP infers with DS. I think the real problem lies in
how you use Declarative Services and has nothing to do with RAP. Maybe
you want to try the equinox newsgroup - and I would attach a snippet or
two to illustrate the problem.

You may also want to take a look at some tutorials like

http://eclipsesource.com/blogs/2009/05/12/osgi-declarative-s ervices/
http://eclipsesource.com/blogs/2009/06/23/eclipse-galileo-fe ature-top-10-list-number-2/

Cheers
Ben

Andre wrote:
> Hello everyone,
> I am pretty new to RAP, RCP and OSGi development and atm I am struggling
> to get a declarative service to provide data for a ViewPart to display.
>
> That service is running and I can use it in a pure OSGi application. But
> in a RAP application when my ViewPart is created the bind/unbind methods
> given in the OSGI-INF/service_component.xml are not called to make the
> service available to that class. Actually when running a RAP app the
> ViewPart is instantiated two times. For one instance (created by the
> service registry) the bind method is called and the service is provided,
> for the other instance (the one that gets displayed and is created by
> the workbench) the bind method is not called.
>
> I guess I am a bit off the track here so are there any tutorials or
> examples on how to use declarative services in a RAP (or RCP) environment?
>
> Best regards,
> Andre


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: How to use declarative services? [message #140551 is a reply to message #140427] Thu, 16 July 2009 10:12 Go to previous messageGo to next message
Eclipse UserFriend
A Component is a Singleton for DS which is thinks it controls and the
same is true for a ViewPart where the workbench controls the instance(s).

To sum up a ViewPart can't act as a DS-Component because of the above.

Tom

Andre schrieb:
> Hello everyone,
> I am pretty new to RAP, RCP and OSGi development and atm I am struggling
> to get a declarative service to provide data for a ViewPart to display.
>
> That service is running and I can use it in a pure OSGi application. But
> in a RAP application when my ViewPart is created the bind/unbind methods
> given in the OSGI-INF/service_component.xml are not called to make the
> service available to that class. Actually when running a RAP app the
> ViewPart is instantiated two times. For one instance (created by the
> service registry) the bind method is called and the service is provided,
> for the other instance (the one that gets displayed and is created by
> the workbench) the bind method is not called.
>
> I guess I am a bit off the track here so are there any tutorials or
> examples on how to use declarative services in a RAP (or RCP) environment?
>
> Best regards,
> Andre
Re: How to use declarative services? [message #553960 is a reply to message #140551] Thu, 19 August 2010 10:17 Go to previous message
Eclipse UserFriend
Hi All,

understand the reason a ViePart cannot act as a DS component, but then, how should a view get a reference to the service exposed by another OSGi bundle ?
In a JSF application @EJB can be used to inject the service in the backing bean, haw can this be obtained in a RAP application ?

Thanks a lot
Patrick
Previous Topic:BrowserFunction support in RAP 1.3 ?
Next Topic:TraverseListener in IE
Goto Forum:
  


Current Time: Wed Apr 02 03:36:53 EDT 2025

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

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

Back to the top