Sure. One caveat, uses sun.misc libs. I've used this code, however,
since 1.2.1 without problems.
The instances at the bottom do RMI which is otherwise not shown. Of
course, -9 can't be caught.
import java.io.*;
import sun.misc.*;//for signal catching
import com.protomatter.syslog.*;
public class MDDBDriver
{
public static void main(String[] args)
{
SignalHandler handler = new SignalHandler()
{
public void handle(Signal sig)
{
Syslog.error(this, "SNIFF_SUPPRESSED Explicit kill sent to
server process, sig is --> "+sig+", aborting...");
System.exit(0);
}
};
Signal.handle(new Signal("TERM") , handler);//string appened to SIG,
meaning SIGTERM
CRMLogRegister instance1= new CRMLogRegister();
CRMDBPool instance2= new CRMDBPool();
MDDBRegister instance3= new MDDBRegister();
}
}
HTH
iksrazal
http://www.braziloutsource.com/