private void register(String signalName, final Map<String, Object> jvmSignalHandlers) throws ReflectiveOperationException {
        Object signal = signalConstructor.newInstance(signalName);
        Object signalHandler = createSignalHandler(jvmSignalHandlers);
        Object oldHandler = signalHandleMethod.invoke(null, signal, signalHandler);
        if (oldHandler != null)
            jvmSignalHandlers.put(signalName, oldHandler);
    }
Register signal handler to log termination due to SIGTERM, SIGHUP and SIGINT (control-c). This method
does not currently work on Windows.

@implNote sun.misc.Signal and sun.misc.SignalHandler are described as "not encapsulated" in
http://openjdk.java.net/jeps/260. However, they are not available in the compile classpath if the `--release`
flag is used. As a workaround, we rely on reflection.
clients/src/main/java/org/apache/kafka/common/utils/LoggingSignalHandler.java