code: private Thread createShutdownHook( final Process process )
      {
          LOG.debug( "Wrapping stream I/O." );
  
          return new Thread(
              new Runnable()
              {
                  public void run()
                  {
                      try
                      {
                          process.destroy();
                      }
                      catch( Exception e )
                      {
                          // ignore if already shutting down
                      }
                  }
              },
              "DefaultJavaRunner shutdown hook"
          );
      }
docs: Create helper thread to safely shutdown the external framework process
  
  @param process framework process
  
  @return stream handler