Class NgrokProcess.ProcessMonitor

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    NgrokProcess

    public static class NgrokProcess.ProcessMonitor
    extends java.lang.Object
    implements java.lang.Runnable
    A Runnable that monitors the ngrok thread.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<NgrokLog> getLogs()
      Get the ngrok logs.
      boolean isMonitoring()
      Get whether the thread is continuing to monitor ngrok logs.
      void run()  
      void stop()
      Set the monitor thread to stop monitoring the ngrok process after the next log event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProcessMonitor

        public ProcessMonitor​(java.lang.Process process,
                              JavaNgrokConfig javaNgrokConfig)
        Construct to monitor a {link @Process} monitor.
        Parameters:
        process - The Process to monitor.
        javaNgrokConfig - The config to use when monitoring the Process.
      • ProcessMonitor

        protected ProcessMonitor​(java.lang.Process process,
                                 JavaNgrokConfig javaNgrokConfig,
                                 HttpClient httpClient)
        Construct to monitor a Process monitor with a custom HttpClient.
        Parameters:
        process - The Process to monitor.
        javaNgrokConfig - The config to use when monitoring the Process.
        httpClient - The custom HTTP client.
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • getLogs

        public java.util.List<NgrokLog> getLogs()
        Get the ngrok logs.
      • isMonitoring

        public boolean isMonitoring()
        Get whether the thread is continuing to monitor ngrok logs.
      • stop

        public void stop()
        Set the monitor thread to stop monitoring the ngrok process after the next log event. This will not necessarily terminate the process immediately, as the process may currently be idle, rather it sets a flag on the thread telling it to terminate the next time it wakes up.

        This has no impact on the ngrok process itself, only java-ngrok’s monitor of the process and its logs.