Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

trap jvm kill signal

Thread view: 
sai krishna - 05 Jun 2007 15:37 GMT
Hi All,

Is there a way to trap kill signals in java applications? when an
external kill signal is sent to a java process, how can we trap the
signal. i want to use this handler to gracefully close the application

Sai
Andrew Thompson - 05 Jun 2007 15:41 GMT
..
>Is there a way to trap kill signals in java applications? when an
>external kill signal is sent to a java process, how can we trap the
>signal. i want to use this handler to gracefully close the application

Runtime.addShutdownHook(java.lang.Thread)

HTH

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Gordon Beaton - 05 Jun 2007 19:44 GMT
> .
>>Is there a way to trap kill signals in java applications? when an
[quoted text clipped - 3 lines]
>
> Runtime.addShutdownHook(java.lang.Thread)

However if the OP really means SIGKILL (9) on a Unix (-like) system,
then no process can trap that specific signal, regardless of
programming language.

/gordon

--
sai krishna - 07 Jun 2007 05:40 GMT
> > .
> >>Is there a way to trap kill signals in java applications? when an
[quoted text clipped - 11 lines]
>
> --

Thanks you all for your replies


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.