Re: Java and signal handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ah....

Finally one I can answer:

...I'll referr you to the folks at Sun for more complete information, but
this pointer should get you going in the right direction. I'm only
familliar with catching the kill signal in Java because that's the only
one I happen to care about. (The other signals are likely caught in a
simmilar manner.) Here's how you declare a shutdown handler (catches
kill -9):


Runtime.getRuntime().addShutdownHook(Shutdown);

Note that 'Shutdown' is the name of a method in my code - change as
appropriate.

Regards,
Richard


-- 
Richard Troy, Chief Scientist
Science Tools Corporation
rtroy@xxxxxxxxxxxxxxxx, 510-567-9957, http://ScienceTools.com/

On Thu, 10 Apr 2003, Ajay Bansal wrote:

> Date: Thu, 10 Apr 2003 15:32:22 +0530
> From: Ajay Bansal <Ajay_Bansal@xxxxxxxxxxx>
> Reply-To: redhat-devel-list@xxxxxxxxxx
> To: redhat-devel-list@xxxxxxxxxx
> Subject: Java and signal handler
>
>
> Hi All
>
> I have a java program. This is invoked by a shell script. And shell
> script is invoked by a C program.
>
> Now, this java program spawns 5-6 threads (depending on the load). For
> stopping the server, I send SIGTERM. But JAVA program is not responding
> to the signal..
>
> Do I need to handle the signals specially in the java programs, the way
> I do it in C program???
>
> -Ajay
>
>
>
>
> _______________________________________________
> Redhat-devel-list mailing list
> Redhat-devel-list@xxxxxxxxxx
> https://listman.redhat.com/mailman/listinfo/redhat-devel-list
>



_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux