- If calling context.getBundle(0).stop() does not cause ALL bundles to be
stopped then there is a bug in the framework.

- I believe all bundles are being stopped in this case.  If that is true
and there are still non-daemon threads running which were started by
bundles installed in the framework then there is a bug in the bundle which
spawned the non-daemon thread.  Bundles should clean up any threads the
started when they are stopped.

- If there are still non-daemon threads running which the framework spawned
then there is a bug in the framework because it should have cleaned up any
of its own non-daemon threads.

In your case, what code is calling System.exit()?  Is it some code in a
bundle or your own launching code that got the framework started in the
first place?

Tom




|------------>
| From:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
  |"David Conde" <[email protected]>                                              
                                                               |
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
  |"'Equinox development mailing list'" <[email protected]>               
                                                               |
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
  |04/29/2010 07:17 AM                                                          
                                                               |
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
  |RE: [equinox-dev] Calling Equinox close command by code                      
                                                               |
  
>--------------------------------------------------------------------------------------------------------------------------------------------|





Yes, this was what I meant.

Finally, the problem was solved by waiting the Bundle(0)'s RESOLVED state
and then calling to System.exit().

Regards

-----Mensaje original-----
De: [email protected] [mailto:[email protected]
] En nombre de Alex Blewitt
Enviado el: jueves, 29 de abril de 2010 13:49
Para: Equinox development mailing list
CC: Equinox development mailing list
Asunto: Re: [equinox-dev] Calling Equinox close command by code

You mean System.exit()?

Sent from my (new) iPhone

On 29 Apr 2010, at 12:16, "David Conde" <[email protected]> wrote:

> Hi again,
>
> For me it is not enough to call context.getBundle(0).stop() since
> this does something similar to "shutdown" command (shutdown the OSGi
> Framework) and I need something similar to "close" command (shutdown
> and exit). How could I achieve it?
>
> If I do context.getBundle(0).stop() my application does not stop and
> some bundles continue running, as the same way as if I would type
> shutdown command in the command line.
>
> Thank you in advance
>
> David
>
> -----Mensaje original-----
> De: [email protected] [mailto:equinox-dev-
> [email protected]] En nombre de Neil Bartlett
> Enviado el: miércoles, 28 de abril de 2010 18:10
> Para: Equinox development mailing list
> Asunto: Re: [equinox-dev] Calling Equinox close command by code
>
> David,
>
> The way to shutdown the OSGi framework is to obtain the system bundle
> (id zero) and call stop():
>
>   context.getBundle(0).stop();
>
> This will work across all frameworks, not just Equinox.
>
> On a meta note to the list... can we get this question and answer into
> a FAQ somewhere? It seems to get asked every few weeks!
>
> Regards
> Neil
>
> On Wed, Apr 28, 2010 at 5:05 PM, David Conde <[email protected]> wrote:
>> Hi,
>>
>> Is there any way to call the “close” command by programming?
>>
>>
>>
>> I need something to call close command from my Visual User
>> Interface in
>> order to close the application though a button.
>>
>>
>>
>> Thank you in advance
>>
>> _______________________________________________
>> equinox-dev mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>>
>>
> _______________________________________________
> equinox-dev mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
> _______________________________________________
> equinox-dev mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

_______________________________________________
equinox-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to