Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Communications Framework (ECF) » Using RemoteServices
Using RemoteServices [message #511109] Fri, 29 January 2010 16:44 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 #511209 is a reply to message #511109] Sun, 31 January 2010 01:25 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 975
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);
Re: Using RemoteServices [message #511730 is a reply to message #511209] Tue, 02 February 2010 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-ng.tobiasm.de

Hi Scott,

Scott Lewis wrote:
> Hi Tobias,
>
> Could you post this question on ecf-dev at eclipse.org?
I don't like mailing lists in general and for me it's easier to work
with newsgroups. But maybe i give it a try next time i have a question.

> 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.
Right, ecf generic.

> 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.
Somehow I thought discovery is only for connecting. I already tried to
add the discovery bundles again but it did not change anything. Maybe I
forgot one. Is there a page with descriptions for the single bundles?
The wiki pages are quite confusing for me at this point.


>> 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);
Great.

Thanks for your help.
Re: Using RemoteServices [message #511806 is a reply to message #511730] Wed, 03 February 2010 00:30 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 975
Registered: July 2009
Senior Member
Hi Tobias,

Tobias Mayer wrote:
> Hi Scott,
>
> Scott Lewis wrote:
>> Hi Tobias,
>>
>> Could you post this question on ecf-dev at eclipse.org?
> I don't like mailing lists in general and for me it's easier to work
> with newsgroups. But maybe i give it a try next time i have a question.

That would be appreciated. The reason I ask...there are people on that
list (in addition to me) that might have something to say on given
topics (that can't/don't also participate in the newsgroup). Also, on
many occasions other people can read and get a lot of value out of the
questions and answers...so I would like to expose everything to the
largest and most informed audience possible.

>
>> 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.
> Right, ecf generic.
>
>> 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.
> Somehow I thought discovery is only for connecting. I already tried to
> add the discovery bundles again but it did not change anything. Maybe I
> forgot one. Is there a page with descriptions for the single bundles?
> The wiki pages are quite confusing for me at this point.

The ECF discovery API consists of this API bundle:
org.eclipse.ecf.discovery, plus one or more providers (i.e. zeroconf is:
org.eclipse.ecf.provider.jmdns, jslp is: ch.ethz.iks.slp. Also there
is another bundle that exposes a composite discovery provider (i.e.
supports using *both* network discovery providers in
org.eclipse.ecf.provider.discovery).

Te OSGi remote services discovery *uses* the ECF discovery API (and any
providers), and it is to be found in this bundle:
org.eclipse.ecf.osgi.services.discovery. So to use the discovery for
automatically discovering remote services over the network this bundle
is needed also.

Note there is one other way to use discovery for ECF remote
services...and that's called 'local' discovery or 'file-based'
discovery. What this is that on the *client/consumer* an xml-file is
read to 'discover' the metadata about the remote endpoint.

For examples see the projects/project set files given on this wiki page:

http://wiki.eclipse.org/Getting_Started_with_ECF%27s_OSGi_Re mote_Services_Implementation

In the directory org.eclipse.ecf.examples.remoteservices.hello.consumer
you will see these recently created product files

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (activemq, zeroconf discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, local discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (r-osgi, zeroconf discovery).product

Inside these product files are lists of bundles/plugins (in between
<plugins>
</plugins> markup...and as you can see from the file names the discovery
mechanisms used are different.

Note: I have heard (but can't verify myself) that Macs have problems
with the jmdns implementation of zeroconf (which we are using). I
believe this is because they have zeroconf/bonjour built in...and so
our/jmdns implementation does not work. Like I said I'm not sure of
this as I don't have access to a mac...but it's something to watch out for.

Note: if you use the ECF remote services API *directly* (i.e. don't use
the OSGi remote services implementation), there is *no need* for any
discovery at all. Maybe this is already clear...if so please ignore.

Final Note: For SLP, it's possible to determine how quickly the
discovery is published (the default is around 60 seconds...so give it
some time) by setting some system properties. I need to ask Markus
Kuppe to identify those system properties and make them known here
and/or on a wiki page...so I've copied Markus on this email/post.

Thanks. The network discovery is rather subtle, as it's dependent upon
some less than ubiquitous lan and router configuration.

Scott


>
>
>>> 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);
> Great.
>
> Thanks for your help.
Re: Using RemoteServices [message #625123 is a reply to message #511209] Tue, 02 February 2010 16:35 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-ng.tobiasm.de

Hi Scott,

Scott Lewis wrote:
> Hi Tobias,
>
> Could you post this question on ecf-dev at eclipse.org?
I don't like mailing lists in general and for me it's easier to work
with newsgroups. But maybe i give it a try next time i have a question.

> 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.
Right, ecf generic.

> 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.
Somehow I thought discovery is only for connecting. I already tried to
add the discovery bundles again but it did not change anything. Maybe I
forgot one. Is there a page with descriptions for the single bundles?
The wiki pages are quite confusing for me at this point.


>> 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);
Great.

Thanks for your help.
Re: Using RemoteServices [message #625128 is a reply to message #511730] Wed, 03 February 2010 00:30 Go to previous message
Scott Lewis is currently offline Scott LewisFriend
Messages: 975
Registered: July 2009
Senior Member
Hi Tobias,

Tobias Mayer wrote:
> Hi Scott,
>
> Scott Lewis wrote:
>> Hi Tobias,
>>
>> Could you post this question on ecf-dev at eclipse.org?
> I don't like mailing lists in general and for me it's easier to work
> with newsgroups. But maybe i give it a try next time i have a question.

That would be appreciated. The reason I ask...there are people on that
list (in addition to me) that might have something to say on given
topics (that can't/don't also participate in the newsgroup). Also, on
many occasions other people can read and get a lot of value out of the
questions and answers...so I would like to expose everything to the
largest and most informed audience possible.

>
>> 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.
> Right, ecf generic.
>
>> 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.
> Somehow I thought discovery is only for connecting. I already tried to
> add the discovery bundles again but it did not change anything. Maybe I
> forgot one. Is there a page with descriptions for the single bundles?
> The wiki pages are quite confusing for me at this point.

The ECF discovery API consists of this API bundle:
org.eclipse.ecf.discovery, plus one or more providers (i.e. zeroconf is:
org.eclipse.ecf.provider.jmdns, jslp is: ch.ethz.iks.slp. Also there
is another bundle that exposes a composite discovery provider (i.e.
supports using *both* network discovery providers in
org.eclipse.ecf.provider.discovery).

Te OSGi remote services discovery *uses* the ECF discovery API (and any
providers), and it is to be found in this bundle:
org.eclipse.ecf.osgi.services.discovery. So to use the discovery for
automatically discovering remote services over the network this bundle
is needed also.

Note there is one other way to use discovery for ECF remote
services...and that's called 'local' discovery or 'file-based'
discovery. What this is that on the *client/consumer* an xml-file is
read to 'discover' the metadata about the remote endpoint.

For examples see the projects/project set files given on this wiki page:

http://wiki.eclipse.org/Getting_Started_with_ECF%27s_OSGi_Re mote_Services_Implementation

In the directory org.eclipse.ecf.examples.remoteservices.hello.consumer
you will see these recently created product files

/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (activemq, zeroconf discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, local discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (generic, zeroconf discovery).product
/org.eclipse.ecf.examples.remoteservices.hello.consumer/prod ucts/Hello
Service Consumer (r-osgi, zeroconf discovery).product

Inside these product files are lists of bundles/plugins (in between
<plugins>
</plugins> markup...and as you can see from the file names the discovery
mechanisms used are different.

Note: I have heard (but can't verify myself) that Macs have problems
with the jmdns implementation of zeroconf (which we are using). I
believe this is because they have zeroconf/bonjour built in...and so
our/jmdns implementation does not work. Like I said I'm not sure of
this as I don't have access to a mac...but it's something to watch out for.

Note: if you use the ECF remote services API *directly* (i.e. don't use
the OSGi remote services implementation), there is *no need* for any
discovery at all. Maybe this is already clear...if so please ignore.

Final Note: For SLP, it's possible to determine how quickly the
discovery is published (the default is around 60 seconds...so give it
some time) by setting some system properties. I need to ask Markus
Kuppe to identify those system properties and make them known here
and/or on a wiki page...so I've copied Markus on this email/post.

Thanks. The network discovery is rather subtle, as it's dependent upon
some less than ubiquitous lan and router configuration.

Scott


>
>
>>> 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);
> Great.
>
> Thanks for your help.
Previous Topic:Need further clarification on Distributed Event Admin
Next Topic:Need further clarification on Distributed Event Admin
Goto Forum:
  


Current Time: Sun Dec 21 22:19:44 GMT 2014

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

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