Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] XMPP

Hi Ali,

Ali Naddaf wrote:
Thank you Scott. I have made some progress there and hopefully soon will have a complete working example that I can share in case you would be interested in posting that. I am sure I will have some questions on the way but one that I ran into is the following: if I make a connection (using container.connect(...)), and if I lose connectivity (due to network) and gain internet connectivity again, I will not be reconnected automatically. If I were to use the smack libraries directly to connect to a jabber server, it would reconnect automatically so is there an option there that I can enable this feature?

I don't think so, but since it's been quite a few months since I've examined the Smack autoreconnect API I'm not completely certain. For your reference, most of the Smack connection setup/handling code in the ECF provider (in bundle: org.eclipse.ecf.provider.xmpp) is in this class:

org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection

If not, what is the correct approach: should I register a listener and manually reconnect?

Yes, you can/could register a listener and reconnect. You will want to make sure that you do not reconnect in the same thread that calls the listener.

Another option would be to add a reconnect option to the XMPP provider (e.g. upon container creation) and then use the underlying Smack 3.1 autoreconnect (ECF moved to Smack 3.1 last fall). If you decide to do this (modify/enhance the provider: org.eclipse.ecf.provider.xmpp), please open an enhancement request to that effect. It's likely too late to get such a change into the provider for Helios, but it could be in (e.g.) a future release of ECF.

Thanks,

Scott




Thanks
Ali.

On 5/14/2010 10:16 PM, Scott Lewis wrote:
Hi Ali,

Ali Naddaf wrote:
Hello everyone.

I like to use the XMPP container of ECF to do the following: I have two separate instances of OSGi framework running on separate networks. I want to remotely call services of each framework from the other one using, say, Google's jabber server (gtalk). To that effect, I will create two gtalk accounts, one for each framework.

Right.


In the above scenario, do I still need to employ any discovery mechanism?

No, you don't.


If each framework knows about the other framework's jabber id, would that be adequate?

Yes.

Is there a sample code (example) or a test case for this? I see some xmpp examples in the ecf source repository but they are mostly (as far as I can see) concerned with sending a message not calling a remote service.

There is test code for the xmpp usage of remote services.  It's for
testing the ECF remote services API usage...rather than the OSGi remote
services (which is built upon ECF remote services), but it does give
some idea of how to do remote services using XMPP.  We currently don't
run these tests automatically, because we need to setup/run an xmpp
server consistently to be able to do so.   Hopefully we will be able to
do this soon (run an xmpp server consistently).

The test class is:

org.eclipse.ecf.tests.provider.xmpp.remoteservice.RemoteServiceTest

This is in this test plugin:  org.eclipse.ecf.tests.provider.xmpp

This plugin is in <ecf home>/tests/bundles in ECF CVS area.

Hope this helps.  Please keep informed about how this is going, and I
will provide as much support as possible.

Scott





_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top