This is exactly what I'm doing
Start my GUI with a ServiceTracker and react on add/remove/update of custom
plugins interfaces.
My interrogations come from the fact that I must be cautious about OSGi
framework calls from other threads (EDT or Custom) and deadlocks.
So you init you GUI and track services. Then how, and from where do you
launch your installing process while being certain that the OSGi framework
won't block?
Barron Logan wrote:
>
> Hello Elvy,
>
> I once created an application like this and it was a lot of fun...
>
>>Now, I would like to seek for plugins (inside a folder, from a conf file,
> ...) and install and start them.
>
> You may want to consider a dynamic approach to this. Instead of
> installing
> plugins once after GUI initialization, maybe alow for plugins to be
> continually installed...
>
> To acheive this, I used a mechanism similar to the following:
>
> // in GUI Activator
> start(){
> // invokeLater() or invokeAndWait() initialization of GUI with some
> default plugins
> ...
> // create ServiceListeners that will listen for new plugins and inject
> them into your GUI
> ...
> // maybe kick off some process that will find, install and start
> plugins
> ...
> }
>
> Presumeably your GUI will be able to handle plugins that implements some
> set
> of Services... so the key is to just listen for that enumeration of
> Services and handle them appropriately. In my app the services resided on
> various servers but my app knew only about a descriptor file on a
> particular
> server (for this i created Remote Bundle
> Installer<http://oscar-osgi.sourceforge.net/>
> ).
>
> Consider using *listeners and events* for updating the GUI. Consider
> doing
> this in an *asynchronous *manner.
>
> Kind regards,
>
> -Barron
>
>
> On Dec 11, 2007 6:54 AM, Elvy <[EMAIL PROTECTED]> 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?
>>
>> -----
>> Tell me something you don't know!
>> --
>> View this message in context:
>> http://www.nabble.com/Install-and-start-bundles-from-another-bundle-tp14272453p14272453.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]
>>
>>
>
>
> --
> Your Friend | Barron C. Logan | 678.656.5924
>
>
-----
Tell me something you don't know!
--
View this message in context:
http://www.nabble.com/Install-and-start-bundles-from-another-bundle-tp14272453p14277286.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]