signal script?

I have a script which invoke a java program, because the program requires file as input, hence the script would sleep a X seconds then check for file existence, if the file exists then program is invoker else, keep waiting until the time is up. My problem is that if there is a way to find out if my java program is held up somehow? In this situation, my script would just wait forever for the program to return, what should I do when this occur? Thanks

may be this will help you

You can also try to send SIGHUP to the java program or signal 0 to check wehether the program is still running