You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Manoj <mv...@salesforce.com> on 2013/11/01 09:19:57 UTC

Karaf Service Reference Manager returning actual instance and some times not updating re-registered instance

Hi Karaf team, 

We are using below karaf configuration. Our karaf container version:2.3.2 

file : src/main/resources/OSGI-INF/blueprint/config.xml of a maven project
which gets into target jar OSGI-INF folder correctly 

        <reference id="httpService" interface="test.HttpService" />
        
        <bean id="clientService" class="test.Activator" 
                init-method="start" destroy-method="stop">
                <property name="httpService" ref="httpService" />
        </bean>
        

The issue we are observing 
1) When we print httpService in test.Activator class we are seeing the same
instance that is actually registered by plugin having the implementation
class. 
i.e  ObjectId printed by toString() method  at the time of registration is
same as 
 ObjectId printed by toString() method  in a plugin which gets this using
reference Manager (test.Activator class) 

is this expected, if not expected can you suggest where it could have gone
wrong? 

2) Another issue is when a httpService is re registered by the plugin . the
plugin which uses it using blueprint 
managed Service is not getting the updated instance. 

for e.g  1)  httpService@111 registered initially 
               httpService@111  is seen in plugin using the httpService
using blue print managed Services. 
            2)  A new instance httpService@222 registered now (unregistered
old one i.e httpService@111) 
              but still  httpService@111  is seen in plugin using the
httpService using blue print managed Services. 

Please let us know the expected time it will be reflected to plugin using
this service via blue print managed service, also let us know if there is a
way we can control this time or see it quickly or block the plugin using
this service to execute any other methods on it. 

Please let us know your suggestions



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Service-Reference-Manager-returning-actual-instance-and-some-times-not-updating-re-registered-e-tp4030157.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Service Reference Manager returning actual instance and some times not updating re-registered instance

Posted by vmalladi <vm...@salesforce.com>.
Hi  jbonofre,

Did you get a chance to look into this?

Thanks
Vamsi






--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Service-Reference-Manager-returning-actual-instance-and-some-times-not-updating-re-registered-e-tp4030157p4030205.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Service Reference Manager returning actual instance and some times not updating re-registered instance

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Agree, it's just to know if the new blueprint version fix your issue or not.

I will review your questions in details anyway.

Regards
JB

On 11/01/2013 11:40 AM, Manoj wrote:
> 3.0.0-SNAPSHOT is an ephemeral version and v can't be using that
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Service-Reference-Manager-returning-actual-instance-and-some-times-not-updating-re-registered-e-tp4030157p4030163.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf Service Reference Manager returning actual instance and some times not updating re-registered instance

Posted by Manoj <mv...@salesforce.com>.
3.0.0-SNAPSHOT is an ephemeral version and v can't be using that



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Service-Reference-Manager-returning-actual-instance-and-some-times-not-updating-re-registered-e-tp4030157p4030163.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Service Reference Manager returning actual instance and some times not updating re-registered instance

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

could you try the same on 3.0.0-SNAPSHOT (with the new blueprint release) ?

Regards
JB

On 11/01/2013 09:19 AM, Manoj wrote:
> Hi Karaf team,
>
> We are using below karaf configuration. Our karaf container version:2.3.2
>
> file : src/main/resources/OSGI-INF/blueprint/config.xml of a maven project
> which gets into target jar OSGI-INF folder correctly
>
>          <reference id="httpService" interface="test.HttpService" />
>
>          <bean id="clientService" class="test.Activator"
>                  init-method="start" destroy-method="stop">
>                  <property name="httpService" ref="httpService" />
>          </bean>
>
>
> The issue we are observing
> 1) When we print httpService in test.Activator class we are seeing the same
> instance that is actually registered by plugin having the implementation
> class.
> i.e  ObjectId printed by toString() method  at the time of registration is
> same as
>   ObjectId printed by toString() method  in a plugin which gets this using
> reference Manager (test.Activator class)
>
> is this expected, if not expected can you suggest where it could have gone
> wrong?
>
> 2) Another issue is when a httpService is re registered by the plugin . the
> plugin which uses it using blueprint
> managed Service is not getting the updated instance.
>
> for e.g  1)  httpService@111 registered initially
>                 httpService@111  is seen in plugin using the httpService
> using blue print managed Services.
>              2)  A new instance httpService@222 registered now (unregistered
> old one i.e httpService@111)
>                but still  httpService@111  is seen in plugin using the
> httpService using blue print managed Services.
>
> Please let us know the expected time it will be reflected to plugin using
> this service via blue print managed service, also let us know if there is a
> way we can control this time or see it quickly or block the plugin using
> this service to execute any other methods on it.
>
> Please let us know your suggestions
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Service-Reference-Manager-returning-actual-instance-and-some-times-not-updating-re-registered-e-tp4030157.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com