Module com.github.alexdlaird.ngrok
Class NgrokProcess.ProcessMonitor
- java.lang.Object
-
- com.github.alexdlaird.ngrok.process.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 thengrok
thread.
-
-
Constructor Summary
Constructors Modifier Constructor Description ProcessMonitor(java.lang.Process process, JavaNgrokConfig javaNgrokConfig)
Construct to monitor a {link @Process} monitor.protected
ProcessMonitor(java.lang.Process process, JavaNgrokConfig javaNgrokConfig, HttpClient httpClient)
Construct to monitor aProcess
monitor with a customHttpClient
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<NgrokLog>
getLogs()
Get thengrok
logs.boolean
isMonitoring()
Get whether the thread is continuing to monitorngrok
logs.void
run()
void
stop()
Set the monitor thread to stop monitoring the ngrok process after the next log event.
-
-
-
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 aProcess
monitor with a customHttpClient
.- 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 interfacejava.lang.Runnable
-
getLogs
public java.util.List<NgrokLog> getLogs()
Get thengrok
logs.
-
isMonitoring
public boolean isMonitoring()
Get whether the thread is continuing to monitorngrok
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.
-
-