public ProcessAdapter registerShutdownHook() {
    Runtime.getRuntime().addShutdownHook(
      newThread(String.format("Process [%d] Runtime Shutdown Hook", safeGetId()), this::stop));

    return this;
  }
public ProcessAdapter registerShutdownHook ( ) { Runtime . getRuntime ( ) . addShutdownHook ( newThread ( String . format ( "Process [%d] Runtime Shutdown Hook" , safeGetId ( ) ) , this :: stop ) ) ; return this ; }
Registers a {@link Runtime} shutdown hook to stop this {@link Process} when the JVM exits.

@return this {@link ProcessAdapter}.
@see java.lang.Runtime#addShutdownHook(Thread)
@see #newThread(String, Runnable)
@see #stop()