|
This isn't really a servlet
question.
So far as I know, there's no portable way to establish a
signal handler in Java, probably because signals themselves aren't entirely
portable across all platforms.
What you'd need to do is create a native process (using C or
C++, most likely) that sets up the signal handler, then uses JNI Invocation to
create the Java VM within your native process and loads and executes the Java
class desired. Or, alternatively, use JNI to call out to a C/C++ routine that
does the signal-handler setup to call back into a C/C++ routine that then, in
turn, uses JNI to call back into your Java code. Either way, it's not precisely
trivial.
<SHAMELESS PLUG>
I've done this, though, for the Win32 platform, as an example of JNI in the book I've got coming down the pike (Dec 99, I think). Email me privately (to reduce the bandwidth on the list) if you want/need to know more. </SHAMELESS PLUG>
Ted
Neward
Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here http://www.javageeks.com/~tneward "I don't even speak for myself; my wife won't let me." --Me
|
- Catch the control-c in a java console application Nicolas Germain
- Ted Neward
