I think what i wrote might have made more sense in my own head:) I
apologize for the lousy problem description.
Maybe an actual use case would help:

I would like to use the OSGi serviceregistry to proxy specific interfaces.
For example:
Say that i attempt to get a serviceReference for an interface with a
mybatis annotation on it. What i would like is that the service registry
returns a proxy that i define (My idea was through something like a
ServiceBindingInterceptor). The proxy should then be closed down again when
get unget method is called on the service.

Basically, i would like to supply a proxy implementation of interfaces in
certain situations, but still allow for the serviceregistry lifecycle
(get/unget) to handle opening and closing the proxies.

It doesn't have to use any specific part of the runtime, i just spotted the
interceptors and mistook their purpose a bit i think.

On Thu, Oct 6, 2016 at 12:32 PM, Clement Escoffier <
clement.escoff...@gmail.com> wrote:

> Hi,
>
> The service binding interceptor requires to have a “service” available.
> You should be able to do what you want by either:
>
> - combining a “default-implementation” strategy and a binding interceptor
> (it would require to have the dependency marked as optional)
> - or create your own handler that inject what you want to inject (
> http://felix.apache.org/documentation/subprojects/
> apache-felix-ipojo/apache-felix-ipojo-devguide/how-to-
> write-your-own-handler.html <http://felix.apache.org/
> documentation/subprojects/apache-felix-ipojo/apache-
> felix-ipojo-devguide/how-to-write-your-own-handler.html>)
>
> Clement
>
>
> > On 6 oct. 2016, at 04:02, Martin Nielsen <mny...@gmail.com> wrote:
> >
> > Hello everyone
> >
> > I am looking at the felix servicebinding interceptors with a certain
> amount
> > of enthusiasm, but i am having trouble figuring out if they can solve a
> > specific task.
> >
> > http://felix.apache.org/documentation/subprojects/
> apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-
> advanced-topics/service-binding-interceptors.html
> >
> > What i would like to do is the following: Whenever a ServiceReference is
> > requested for an interface (No matter which one), i want an interceptor
> to
> > examine it. If the interface meets some criteria, the an interceptor
> should
> > create a proxy for that interface, regardless of a matching
> implementation
> > being registered.
> > So: Even if no object is actually registered as a service to that
> > interface, i want the interceptor to return a proxy anyway. Is that
> > possible to do in any way?
> >
> > Thank you in advance.
> >
> > -Martin
>
>

Reply via email to