code: public synchronized void registerSignal(int signalNumber, Runnable callback, boolean replace) {
          String signalName = signalMap.get(signalNumber);
          if (signalName == null) {
              LOG.warn("Invalid signalNumber " + signalNumber);
              return;
          }
  
          LOG.info("Begin to register signal of {}", signalName);
          try {
              SignalHandler oldHandler = Signal.handle(new Signal(signalName), this);
              LOG.info("Successfully register {} handler", signalName);
  
              Runnable old = signalHandlers.put(signalNumber, callback);
              if (old != null) {
                  if (!replace) {
                      oldSignalHandlers.put(signalNumber, oldHandler);
  
                  } else {
                      LOG.info("Successfully old {} handler will be replaced", signalName);
                  }
  
              }
              LOG.info("Successfully register signal of {}", signalName);
          } catch (Exception e) {
              LOG.error("Failed to register " + signalName + ":" + signalNumber + ", Signal already used by VM or OS: SIGILL");
          }
  
      }
docs: Register signal to system
  if callback is null, then the current process will ignore this signal