Many thanks for you!
But, I don't want to shutdown JVM because JVM would may be used again, and
only want to close one Java application UI, so...
How to resolve this problem?
Thanks a lot:)



                                                                       
             "Jeremy Volkman"                                          
             <[EMAIL PROTECTED]                                         
             om>                                                        To
             Sent by:                  "OSGi Developer Mail List"      
             osgi-dev-bounces@         <[email protected]>        
             www2.osgi.org                                              cc
                                                                       
                                                                   Subject
             06/11/2007 11:25          Re: [osgi-dev] How to shutdown  
             PM                        knopflerfish automatically when 
                                       receiving an external indication
                                                                       
             Please respond to                                         
              OSGi Developer                                           
                 Mail List                                             
             <[EMAIL PROTECTED]                                         
                  gi.org>                                              
                                                                       
                                                                       




Hi,

Take a look at http://java.sun.com/j2se/1.5.0
/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)

You can have one of your bundles register a shutdown hook with the JVM
which will be called when the JVM shuts down.  From your shell script,
you can send the JVM a signal such as SIGTERM (e.g., kill -15 <pid> on
Linux) which will instruct the JVM to run through its shutdown
process. Your shutdown hook will execute, which can in turn shutdown
the Knopflerfish framework.

-Jeremy

On 6/11/07, Xi Jiarong <[EMAIL PROTECTED]> wrote:
> Thanks a lot to Niclas, that' s very good suggestion!
> However, how to use this "stop 0" in one *.sh file in Linux OS so as to
run
> this command autimatically when receiveing an external indication?
> Many thanks to you:)
> Any suggestion would be welcom:)
>
>  [EMAIL PROTECTED] wrote: -----
>
> To: OSGi Developer Mail List <[email protected]>
> From: Niclas Hedhman <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> Date: 06/11/2007 05:37PM
> Subject: Re: [osgi-dev] How to shutdown knopflerfish automatically when
> receiving an external indication
>
> On Monday 11 June 2007 14:33, Xi Jiarong wrote:
> > Hello!
> > How to shutdown knopflerfish automatically when receiving an external
> > indication?
> > Any suggestion would be welcom, and many thanks for you!
>
> IIRC, stopping bundle 0 will shutdown all OSGi frameworks.
>
> Cheers
> --
>
>
>
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> http://www2.osgi.org/mailman/listinfo/osgi-dev
>
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

<<inline: graycol.gif>>

<<inline: pic25667.gif>>

<<inline: ecblank.gif>>

_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

Reply via email to