[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Tracking usage of Remote Service at Serverside

T Hi Peter,

On 12/17/2015 3:58 AM, Peter Hermsdorf wrote:
<stuff deleted>

Collection<ExportReference> getExportedServices(); Collection<ImportReference> getImportedServices();
i tries that and i'm getting a ExportReference for every exported service, but the information I'm seeking seems not to be in there. Basically there is only the EndpointDescription of the exported Servie and the service itself in there.

Yes. One of the things I recently added to ECF's RSA implementation was the ability to get more information from the ExportReference (i.e. more than is specified by RSA ExportReference class). Specifically, see:


The getExportedServices() method returns instances of RemoteServiceAdmin.ExportReference. And there are is also method on RemoteServiceAdmin.getExportedRegistrations() which returns instances of RemoteServiceAdmin.ExportRegistration. SObviously, these are ECF only/not standardized.

You will notice that the ECF RemoteServiceAdmin.ExportReference has methods: getContainerID() and getRemoteServiceId().

It's also possible to receive either synchronous or asynchronous notifications from the RemoteServiceAdmin service using the RemoteServiceAdminListener and RemoteServiceAdminEvent.
same here. I see no event on server side when a client connects or disconnects.

What I'm looking for is the number of connected clients (in other words: the number of times the service has been imported by a client) and preferable the ip and/or hostname of the client(s).

I see. So there is no standardized AP for that (yet). It's possible that it would be added, but so far I've not seen any discussion about it in the EEG. I would happily bring it up for possible standardization, but I can't commit the necessary personal resources right now.

In any event, there are ways to get to it with ECF-generic-provider specific APIs, and I think that's what you are using.

Let me try to help guide that:

The generic provider server is based upon this class:


As you can see, it implements org.eclipse.ecf.core.sharedobject.ISharedObjectContainerGroupManager. What this means is that if you can get the IContainer instance on the server (which you should be able to via the IContainerManager service), then you can adapt it to the ISharedObjectContainerGroupManager...e.g.

ISharedObjectContainerGroupManager cgm = (ISharedObjectContainerGroupManager) container.getAdapter(ISharedObjectContainerGroupManager.class);

Note that if it's not a generic provider (e.g. rosgi or any other) getAdapter will return null.

The ISharedObjectContainerGroupManager has a method: setConnectPolicy(IConnectHandlerPolicy policy) which will be called when clients connect...with information about their tcpip address, their id, etc.

There is another adapter for IContainer: org.eclipse.ecf.core.IReliableContainer all generic provider servers and clients implement this, so you should also be able to do:

IReliableContainer rc = (IReliableContainer) container.getAdapter(IReliableContainer.class);

and get a non-null rc.

IReliableContainer has a method: IReliableContainer.getGroupMemberIDs() that has returns an ID[]. These are all of the current group members (clients and server in TCP). You can associate the information gained in IConnectHandlerPolicy (address, etc) with the ID in the ID[].

I and Wim have been thinking about adding API (and impl) to allow easier access to statistics about remote services (e.g. like client info, usage info, etc). But we haven't gotten to it yet. If I can find someone to support it with my time, I would happily do it (and even suggest standardization in future versions of RSA via the EEG).

Note that there are also container events that are delivered to any listeners (via IContainer.addContainerListener). That's perhaps more involved so I'll leave it at that for now.

Let me know if this helps and we will discuss further if necessary.


Maybe I have misunderstood your suggestions ;)

Any more hints on this would be great!

Thank you!

bye, peter

BTW: I'm using ECF 3.9.3
ecf-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit