public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                        synchronized (signalCaught) {
                            signalCaught.set(true);
                            signalCaught.notifyAll();
                        }
                        return null;
                    }
Sets up a signal handler for SIGTERM and SIGINT, where a given AtomicBoolean
gets a true value when the signal is caught.

Callers basically have two options for acting on the signal:

They may choose to synchronize and wait() on this variable,
and they will be notified when it changes state to true. To avoid
problems with spurious wakeups, use a while loop and wait()
again if the state is still false. As soon as the caller has been
woken up and the state is true, the application should exit as
soon as possible.

They may also choose to poll the state of this variable. As soon
as its state becomes true, the signal has been received, and the
application should exit as soon as possible.

@param signalCaught set to false initially, will be set to true when SIGTERM or SIGINT is caught.
vespajlib/src/main/java/com/yahoo/yolean/system/CatchSignals.java