mayank gupta wrote:Could you please let me know something about how to handle signals in java and if perl signals can be handled as well. I tried searching but couldnt get much information. Could you please provide some pointers.
You can't handle signals in 100% Java; the standard libraries have no signal-related capabilities at all. You
might be able to use native code to handle signals, especially if you write main() in C and create a JVM from your C code. Even there, though, the JVM library does some signal handling itself (mostly just crash-protection) and your added handlers may either break things or not work properly.
Instead of using signals, let the Java program create a ServerSocket to listen on a well-known port; create a Thread dedicated to listening on that socket, in a loop. Then let that thread handle a simple command language. It's a simple matter, then, for your Perl program to connect to that socket and send the desired command(s).