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

On 10/17/2014 6:36 AM, Peter Hermsdorf wrote:
Hi,

I'm providing a Service via DS and would like to add some JMX info to the server to track the count of currently connected clients using this service.

I'm using the ecf.generic.server provider and an edef description for discovery if that matters.

What would be the best approach?

There's a lot here, some of which is provided via the OSGi Remote Service Admin specification, and some of which is provided by ECF's implementation.


To start, you should probably use the org.osgi.service.remoteserviceadmin.RemoteServiceAdmin service. This is an OSGi service, so you can get access to through ServiceTracker, DS, or other normal services access techniques.

ECF provides javadocs of this service. Here [1] are all the ECF javadocs and here [2] is the page for RSA specifically. This service is standardized by the RSA spec, so you can also see all the docs in the OSGi R6 spec, chapter 122 (although I don't necessarily recommend that :).

As you can see, there are the following methods for accessing information about exported (RS host), and imported (RS consumer) remote services handled by a given RSA instance:

Collection<ExportReference> getExportedServices();
Collection<ImportReference> getImportedServices();

The ExportReference and ImportReference classes (in same osgi package) provide access to some information about each remote service. ECF's impl of this standard service provides access to other more specific information if it's needed/desired (i.e. that's not currently available through the standardized RSA API).

It's also possible to receive either synchronous or asynchronous notifications from the RemoteServiceAdmin service using the RemoteServiceAdminListener and RemoteServiceAdminEvent.

ECF has some more docs about RSA [3]...although it would be desirable to add much more as part of our Mars push to improve/extend the Eclipse-based tooling specifically for ECF RSA. I can/will do some of this based upon community-expressed needs.

It's my hope that in the Mars cycle we/ECF committers can build some Eclipse-based UI/tools/views for viewing and possibly manipulating ECF and RSA info. Having input and possibly even tooling contributions on what info/remote service metadata would be most useful to have available for dev, testing, debugging, and runtime monitoring of remote services would be wonderful...so like Peter please speak up if you have specific use cases!

Scott

[1] http://download.eclipse.org/rt/ecf/latest/javadoc/
[2] http://download.eclipse.org/rt/ecf/latest/javadoc/org/osgi/service/remoteserviceadmin/RemoteServiceAdmin.html
[3] https://wiki.eclipse.org/Remote_Services_Admin