You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Christian Schneider <ch...@die-schneider.net> on 2014/02/17 18:17:34 UTC

Why does aries blueprint publish a proxy instead of the real object into the service registry?

I am using blueprint <service> to publish an object to the service registry.

The problem is that instead of a service it seems to publish a proxy. So 
I can not introspect the object.
I know that blueprint needs to inject a proxy if you use <reference> but 
why does it also create a proxy when publishing a service.
Jean Baptiste showed me some code using ProxyManager to unproxy the 
object but this is quite ugly and makes me depend on aries proxy.

So why is the proxy created and can this be turned off?

Christian


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Why does aries blueprint publish a proxy instead of the real object into the service registry?

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi David and Chris,

I am not sure if we are talking about the same effect.
As I wrote in my original mail I am aware of the proxy that is created 
when injecting a service using blueprint. It is necessary as blueprint 
does the inject statically.
In contrast to this I am observing a proxy when I export the service. I 
import the service using a service tracker. So I did not expect to 
encounter a proxy for this case.

Guillaume mentioned the security layer as the source of the proxy. I 
think this should also not apply. The etc/system.properties contains this:
karaf.secured.services = (&(osgi.command.scope=*)(osgi.command.function=*))

So while this should match for the commands it should not match for my 
case where I simply export an Action without any properties. I will dig 
a bit more.

Christian


Am 17.02.2014 20:59, schrieb David Jencks:
> The proxy is a blueprint thing and as Chris says is there to damp 
> bouncing services.  I think the DS technique of binding a replacement 
> service before unbinding the old one is a more appropriate solution to 
> this problem, although it certainly has different effects and produces 
> more bouncing.
>
> thanks
> david jencks
>
>

-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Why does aries blueprint publish a proxy instead of the real object into the service registry?

Posted by David Jencks <da...@yahoo.com>.
The proxy is a blueprint thing and as Chris says is there to damp bouncing services.  I think the DS technique of binding a replacement service before unbinding the old one is a more appropriate solution to this problem, although it certainly has different effects and produces more bouncing.

thanks
david jencks


On Feb 17, 2014, at 11:13 AM, Guillaume Nodet <gn...@apache.org> wrote:

> The proxy is used for security reasons afaik.  Mainly to secure commands.
> We can't turn it off unless we disable security.
> In fact, the proxy is not a blueprint thing, it's a proxy on the registered osgi service.
> 
> 
> 2014-02-17 18:17 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:
> I am using blueprint <service> to publish an object to the service registry.
> 
> The problem is that instead of a service it seems to publish a proxy. So I can not introspect the object.
> I know that blueprint needs to inject a proxy if you use <reference> but why does it also create a proxy when publishing a service.
> Jean Baptiste showed me some code using ProxyManager to unproxy the object but this is quite ugly and makes me depend on aries proxy.
> 
> So why is the proxy created and can this be turned off?
> 
> Christian
> 
> 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> http://www.talend.com
> 
> 


Re: Why does aries blueprint publish a proxy instead of the real object into the service registry?

Posted by Guillaume Nodet <gn...@apache.org>.
The proxy is used for security reasons afaik.  Mainly to secure commands.
We can't turn it off unless we disable security.
In fact, the proxy is not a blueprint thing, it's a proxy on the registered
osgi service.


2014-02-17 18:17 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:

> I am using blueprint <service> to publish an object to the service
> registry.
>
> The problem is that instead of a service it seems to publish a proxy. So I
> can not introspect the object.
> I know that blueprint needs to inject a proxy if you use <reference> but
> why does it also create a proxy when publishing a service.
> Jean Baptiste showed me some code using ProxyManager to unproxy the object
> but this is quite ugly and makes me depend on aries proxy.
>
> So why is the proxy created and can this be turned off?
>
> Christian
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Re: Why does aries blueprint publish a proxy instead of the real object into the service registry?

Posted by Chris Geer <ch...@cxtsoftware.com>.
My understanding was always that the proxy is required so that if the
service goes away and comes back the reference doesn't need to be changed.

Chris


On Mon, Feb 17, 2014 at 10:17 AM, Christian Schneider <
chris@die-schneider.net> wrote:

> I am using blueprint <service> to publish an object to the service
> registry.
>
> The problem is that instead of a service it seems to publish a proxy. So I
> can not introspect the object.
> I know that blueprint needs to inject a proxy if you use <reference> but
> why does it also create a proxy when publishing a service.
> Jean Baptiste showed me some code using ProxyManager to unproxy the object
> but this is quite ugly and makes me depend on aries proxy.
>
> So why is the proxy created and can this be turned off?
>
> Christian
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>