I did check the example on Felix web site, the application with SimpleShapes
(circle, triangle, rectangle,...). And the idea of invokeAndWait comes from
this example!

I can get the BundleContext and use it whenever and from whatever thread
without risks of concurrency problems? Can I assume that Felix is able to
deal with simultaneous requests from different BundleContexts?

I think it does, but since I'm new to OSGi, I'm not certain yet...



Richard S. Hall wrote:
> 
> Elvy wrote:
>> Hi, 
>>
>> I am developing a GUI application as a bundle. This GUI is somehow like
>> eclipse, it is a place where plugins can register to. Because it is Swing
>> based, I have to do all the GUI initialization from the EDT. I thus call
>> an
>> InvokeAndWait() from my BundleActivator and do it all here (the
>> BundleActivator itself is the Runnable).
>>
>> Logically, the start method will be blocked until init is finished... I
>> know
>> it blocks the OSGi framework for quite a while, but what else can I do?
>>   
>> Now, I would like to seek for plugins (inside a folder, from a conf file,
>> ...) and install and start them. Where should I do it? Inside the
>> Activator,
>> after the InvokeAndWait? Inside the InvokeAndWait after GUI init? Inside
>> an
>> InvokeLater? 
>>
>> How would you guys recommend discovering and starting bundles at runtime,
>> from another Bundle, right after it is completely up and running?
>>   
> 
> It sounds like the main steps you need are:
> 
>    1. Initialize GUI
>    2. Install available plugins.
> 
> It doesn't sound like step (1) needs to be performed in the start() 
> method, so simply do it in an invokeLater() instead of an 
> invokeAndWait(). It sounds like the only thing you need from start() is 
> the BundleContext, so get it, do an invokeLater() and let the framework 
> get on with its business.
> 
> Then, once you have completed step (1) you are free to move onto step 
> (2) in the same invokeLater(), no? In truth, it doesn't seem like 
> installing the plugins needs to be done on the event thread, since the 
> act of installing bundles should generate events that will update your 
> GUI state. So you could install plugins in a different thread, perhaps.
> 
> If you haven't already done so, you might want to check out the example 
> paint application on the Felix web site.
> 
> -> richard
> 
>> -----
>> Tell me something you don't know!
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-----
Tell me something you don't know!
-- 
View this message in context: 
http://www.nabble.com/Install-and-start-bundles-from-another-bundle-tp14272453p14277686.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to