Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Using RemoteServices
Using RemoteServices [message #625055] Fri, 29 January 2010 21:27 Go to next message
Eclipse UserFriend
Originally posted by: eclipse-ng.tobiasm.de

Hi,

i have built an application with usesg ECF3.1. In a former version of my
app the client connected to the server (on the same host) automatically
using the discovery mechanism. The code was mainly copied from the
examples i found on the internet.
Now i removed they discovery stuff and connect to the server directly.
This is working, i see my log output of my ChannelListener and the
Datashare is working too.

But now i figured out that the remote services are not behave as before.
In the former version i only needed to register a new osgi service on
the server side and it automatically appeared in the clients osgi
registry, now i doesn't do this anymore.

Any ideas/suggestions what i have to change to make this work again? ECF
is still very confusing for me ...

Thanks
Tobias

Btw: Is there an easy way to get all published remote services to check
if they are registered correctly?
Re: Using RemoteServices [message #625119 is a reply to message #625055] Sun, 31 January 2010 01:25 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Hi Tobias,

Could you post this question on ecf-dev at eclipse.org?

Also...could you report what provider you are using (e.g. r-OSGi, ecf
generic, etc?). I assume that you must be using the ecf generic provider.

Tobias Mayer wrote:
> Hi,
>
> i have built an application with usesg ECF3.1. In a former version of my
> app the client connected to the server (on the same host) automatically
> using the discovery mechanism. The code was mainly copied from the
> examples i found on the internet.
> Now i removed they discovery stuff and connect to the server directly.
> This is working, i see my log output of my ChannelListener and the
> Datashare is working too.


Because you have removed the discovery, the client has no way to
discover remote osgi services that are published on the network and put
them into the local OSGi registry. What I describe below is what
happens automatically via the discovery mechanism.

>
> But now i figured out that the remote services are not behave as before.
> In the former version i only needed to register a new osgi service on
> the server side and it automatically appeared in the clients osgi
> registry, now i doesn't do this anymore.

Right. This is because you removed the discovery.

Without discovery, on the client you can use the ECF remote services API
to *explicitly* (i.e. in your own code) lookup/get the
IRemoteServiceReference...and then use this to get the
IRemoteService...and the proxy for usage.

Here's a wiki page that shows how to do this directly with the ECF
remote services API:

http://wiki.eclipse.org/Getting_Started_with_Using_the_ECF_R emote_Services_API

See the section: Using the Service (Consumer)

Note that rather than what's listed on the wiki, you should be able to
make the following getRemoteServiceReferences call:

IRemoteServiceReference[] helloReferences = containerAdapter
.getRemoteServiceReferences((ID)null,IHello.class.getName(), null);

(You should use the fully qualified name of your class, rather than
IHello.class.getName()).

Unlike the example code in the wiki, you have already explicitly
connected to the server...so the first (ID) parameter is not needed.

If you wish, you can add the proxy to the osgi service registry
yourself...or you don't really have to register it at all if you would
prefer not to (you can just use it direction from IRemoteService.getProxy)).


>
> Any ideas/suggestions what i have to change to make this work again? ECF
> is still very confusing for me ...
>
> Thanks
> Tobias
>
> Btw: Is there an easy way to get all published remote services to check
> if they are registered correctly?

Yes:

IRemoteServiceContainerAdapter.getAllRemoteServiceReferences (String
clazz,String filter);
Previous Topic:Getting started with ECF & Dependencies on Eclipse
Next Topic:Need further clarification on Distributed Event Admin
Goto Forum:
  


Current Time: Fri Apr 26 19:45:05 GMT 2024

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

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

Back to the top