Hi Sai,

I would use a service tracker for that and react as soon as the service is
available.

Calling start on the bundle actually call start() method of the Activator (or
equivalent when using SCR or blueprint). Depending of the Activator, the service
registration can happen async.

Is it a "classic" OSGi bundle ? a blueprint bundle ? a SCR bundle ?

Regards
JB

On 01/31/2018 02:59 PM, SAI3292 wrote:
> Hi 
> 
> I am trying the update the resolved bundle and then starting it which is
> providing implementation for Interface I. Afterwards immediately getting the
> service reference for the Interface I. Interface I is in different module
> which is started.
> Following is the code:
> 
> Bundle bundle = bundleContext.getBundle(mvn:path);
> bundle.update();
> bundle.start();
> Collection<ServiceReference&lt;I>> referenceList = bundleContext
>                                                       
> .getServiceReferences(I.class, null);
> 
> Is that when i am getting service reference of the interface, the bundle
> start is not yet registered the implementation of the Interface I in
> Activator.  Is that an Asynchronous call.
> 
> Can anybody help
> 
> Regards
> Sai
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to