aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bosschaert <>
Subject A utility to help working with OSGi Service Registry Hooks
Date Fri, 20 Sep 2013 11:33:17 GMT
Hi all,

The OSGi service registry hooks provide a powerful way to influence
how clients view the OSGi service registry. To give a few examples
that you can do with the hooks:
* Hide certain services from certain clients
* Extend or otherwise alter the service registration properties the client sees
* Proxy/intercept service invocations
* You can also use the hooks to find out what services clients are looking for

After having used them a few times I found that, while not very hard,
it's not trivial to implement these hooks. Typically you need to
implement 2 or 3 hooks (FindHook, EventListenerHook, ListenerHook)
which need to work together to provide a consistent view to the
service consumers.

So I started creating a utility class that makes working with the
service registry hooks for some of the above use cases a little
simpler and I was thinking that it might make sense to contribute this
utility to Aries.

My implementation, which focuses on the top 3 uses cases above is
currently simply called ServiceProxyUtil (anyone a better name?) and
although it's not very large I find that it makes life a little easier
to work with the service hooks. I think a good place for it would be
in the Aries Util bundle. In some cases it may make sense to use it
together with Aries Proxy, but this is certainly not always necessary.

Thoughts anyone? If people like the idea I can explain a little more
in detail what it does...



View raw message