Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Remote OSGi services

Hi Scott,

a couple of month ago we have been discussing the issue below. Have you got an idea whether this issue has been addressed in ECF 2.1?

Cheers,
Eugen

Am 20.06.2008 um 22:03 schrieb Eugen Reiswich:

Hi Scott,


It may be that you are not using the correct ID in the filter.  For XMPP, the userID/rosterID is not the same as the remote clients containerID.  What ID are you passing into the filter?

after spendig some time with the remote OSGi services I discovered that my rosterID actually equals the remote clients containerID. But I've created a workaround for filtering services. 

In addition to that I have a question about registering and retrieving remote services. I have several clients connecting over XMPP and providing remote services. But the last client I connect is not able to get any of the remote services provided by the already connected clients. Only the first client can retrieve all remote services. It seems like a client can only retrieve remote services of clients that connect later on. 

This is the way how I register remote services:
// register ECF remote service
getRemoteServiceContainerAdapter().registerRemoteService(
new String[] { serviceName }, impl, props);

an here how I retrieve remote services:
public <T> List<T> getRemoteService(Class<T> service, ID[] filterIDs,
String filter) throws ECFException, InvalidSyntaxException {
List<T> remoteServices = new ArrayList<T>();

IRemoteServiceContainerAdapter remoteServiceContainerAdapter = (IRemoteServiceContainerAdapter) this.containter
.getAdapter(IRemoteServiceContainerAdapter.class);

IRemoteServiceReference[] refs = remoteServiceContainerAdapter
.getRemoteServiceReferences(null, service.getName(), filter);

// cast the remote service references to proxies
for (int serviceNumber = 0; serviceNumber < refs.length; serviceNumber++) {

IRemoteService remoteService = remoteServiceContainerAdapter
.getRemoteService(refs[serviceNumber]);
Assert.isNotNull(remoteService);

IRemoteServiceReference remoteServiceReference = refs[serviceNumber];
ID containerID = remoteServiceReference.getContainerID();
String containerIDName = containerID.getName();

for (ID userID : filterIDs) {
String userIDName = userID.getName();
if (userIDName.equals(containerIDName)) {

// get proxy for remote service and add service to the
// service list
T castedService = service.cast(remoteService.getProxy());
// T castedService = (T) remoteService.getProxy();
Assert.isNotNull(castedService);
remoteServices.add(castedService);
break;
}
}

}

return remoteServices;
}

Have you got an idea what I'm doing wrong?

Regards,
Eugen


Am 17.06.2008 um 21:12 schrieb Scott Lewis:

Hi Eugen,

Eugen Reiswich wrote:
Hi Scott,

as you already guessed right I'm passing a roster ID to the remote service because that's the only one I have. If this is the wrong way than how do I get the container ID for an IRosterEntry object?

This (getting the containerID given a IRosterEntry object) is probably something that we should add to the presence API (in ECF 2.1).

Another way to get the containerIDs for remote services is to listen for events via the IRemoteServiceContainerAdapter.addRemoteServiceListener(...).

But it would be a good idea to allow the association between containerIDs and rosterIDs in the presence API.


BTW Scott I've checked my remote provisioning source code in. If you would like to run the prototype I can send you a brief how to or drop it in a documentation folder.

I would like to try it sometime soon.  If you are willing, could you create a wiki page and link to it on http://wiki.eclipse.org/ECF?

Thanks much,

Scott



Regards,
Eugen

Am 17.06.2008 um 18:10 schrieb Scott Lewis:

Hi Eugen,

It may be that you are not using the correct ID in the filter.  For XMPP, the userID/rosterID is not the same as the remote clients containerID.  What ID are you passing into the filter?

This may be something we ultimately need to remedy in the XMPP provider...but I'm not sure yet whether that makes sense.

Scott

Eugen Reiswich wrote:
Hi ecf-devs,

I have some problems with the ECF Remote OSGi services. Somehow the filter mechanism using ID[] array doesn't work for me and I wonder whether this is a bug or my incompetence. I try to get some remote services for some IDs that I provide as parameter:

IRemoteServiceContainerAdapter remoteServiceContainerAdapter = (IRemoteServiceContainerAdapter) this.containter
.getAdapter(IRemoteServiceContainerAdapter.class);

IRemoteServiceReference[] refs = remoteServiceContainerAdapter
.getRemoteServiceReferences(*filterIDs*, service.getName(),
null);

Although I've provided some filterIDs as a parameter the IRemoteServiceReference-array containes more services than I expect him to have. There are even some IRemoteServiceReference-references to clients which are not on my contacts list (but they exist on my XMPP server).

Any help would be appreciated but I know that with Ganymede you guys are busy.

Regards,
Eugen


------------------------------------------------------------------------ 

_______________________________________________
ecf-dev mailing list


_______________________________________________
ecf-dev mailing list

_______________________________________________
ecf-dev mailing list

_______________________________________________
ecf-dev mailing list

_______________________________________________
ecf-dev mailing list


Back to the top