camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinn Stevenson <qu...@pronoia-solutions.com>
Subject Re: OsgiServiceRegistry caching service references, why?
Date Tue, 09 Feb 2016 14:55:14 GMT
I normally use Blueprint to use OSGi Services.  In that case, I should wind up with a Blueprint
service proxy.  Would using a ServiceTracker with a Blueprint proxy be necessary?  I think
the Blueprint proxy already does that for me.


> On Feb 9, 2016, at 2:31 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 
> On Tue, Feb 9, 2016 at 10:15 AM, Richard Davidson
> <richard.davidson.uk@gmail.com <mailto:richard.davidson.uk@gmail.com>> wrote:
>> Hi,
>> 
>> Instead of the cache containing the actual service objects it could it
>> contain a org.osgi.util.tracker.ServiceTracker. This would then cache and
>> track the service internally. Each time the service is requested via the
>> registry,  #ServiceTracker.getService() could be called. Let me know your
>> thoughts, and if people agree I could try to create a patch.
>> 
> 
> Yeah we use service tracker to track components and whatnot.
> 
> I have said it many times, we love contributions
> http://camel.apache.org/contributing <http://camel.apache.org/contributing>
> 
>> 
>> On Tue, Feb 9, 2016 at 8:05 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>> 
>>> Hi
>>> 
>>> Yeah it was created that way - i guess maybe the though was that osgi
>>> reference lookup is expensive?
>>> 
>>> I guess we can reach out to the OSGi folks and see what they say. It
>>> would make the code simpler without a local cache.
>>> 
>>> 
>>> On Tue, Feb 9, 2016 at 1:31 AM, Tim Jones <tim@mccarthy.co.nz> wrote:
>>>> I have looked at the code in
>>> org.apache.camel.core.osgi.OsgiServiceRegistry
>>>> (camel-core-osgi-2.15.4) and it appears to cache the service references.
>>>> This means that if I uninstall/install the bundle supplying the service
>>> it
>>>> wont automagically 'pick up' the new service.
>>>> 
>>>> For what reason(s) are the service references cached?
>>>> 
>>>> Note - after modifying OsgiServiceRegistry and removing the cache a new
>>>> service is picked up and behaves more like I would expect in a dynamic
>>> OSGi
>>>> environment.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/OsgiServiceRegistry-caching-service-references-why-tp5777410.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com <http://davsclaus.com/> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2 <https://www.manning.com/ibsen2>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message