Class ProcessLiveness
- java.lang.Object
-
- com.github.toolarium.system.command.process.liveness.impl.ProcessLiveness
-
- All Implemented Interfaces:
IProcessLiveness,java.lang.Runnable
public class ProcessLiveness extends java.lang.Object implements IProcessLiveness, java.lang.Runnable
Implements theIProcessLiveness.
-
-
Constructor Summary
Constructors Constructor Description ProcessLiveness(java.lang.String id, java.util.List<java.lang.Process> processList, IProcessOutputStream outputStream, IProcessOutputStream errorStream, java.nio.file.Path scriptPath, java.time.Instant lockTimeout, long pollTimeout)Constructor for ProcessLiveness
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.InstantgetLockTimeout()Get the lock timeoutlonggetPollTimeout()Get the process poll timeoutjava.lang.ProcessgetProcess()Get the processjava.lang.LonggetProcessId()Get the process idjava.nio.file.PathgetScriptPath()Get the script path of this process or null if there is no folderjava.time.InstantgetStartupTime()Get the startup timebooleanisAlive()Verify if the underlining process is alivevoidrun()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ProcessLiveness
public ProcessLiveness(java.lang.String id, java.util.List<java.lang.Process> processList, IProcessOutputStream outputStream, IProcessOutputStream errorStream, java.nio.file.Path scriptPath, java.time.Instant lockTimeout, long pollTimeout)Constructor for ProcessLiveness- Parameters:
id- the idprocessList- the process listoutputStream- the output streamerrorStream- the error output streamscriptPath- the script pathlockTimeout- the lock timeoutpollTimeout- the poll timeout, e.g. 10
-
-
Method Detail
-
isAlive
public boolean isAlive()
Description copied from interface:IProcessLivenessVerify if the underlining process is alive- Specified by:
isAlivein interfaceIProcessLiveness- Returns:
- true if it is alive
- See Also:
IProcessLiveness.isAlive()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- See Also:
Runnable.run()
-
getStartupTime
public java.time.Instant getStartupTime()
Description copied from interface:IProcessLivenessGet the startup time- Specified by:
getStartupTimein interfaceIProcessLiveness- Returns:
- the startup time
- See Also:
IProcessLiveness.getStartupTime()
-
getPollTimeout
public long getPollTimeout()
Description copied from interface:IProcessLivenessGet the process poll timeout- Specified by:
getPollTimeoutin interfaceIProcessLiveness- Returns:
- the process poll timeout
- See Also:
IProcessLiveness.getPollTimeout()
-
getProcess
public java.lang.Process getProcess()
Description copied from interface:IProcessLivenessGet the process- Specified by:
getProcessin interfaceIProcessLiveness- Returns:
- the process
- See Also:
IProcessLiveness.getProcess()
-
getProcessId
public java.lang.Long getProcessId()
Description copied from interface:IProcessLivenessGet the process id- Specified by:
getProcessIdin interfaceIProcessLiveness- Returns:
- the process id
- See Also:
IProcessLiveness.getProcessId()
-
getLockTimeout
public java.time.Instant getLockTimeout()
Description copied from interface:IProcessLivenessGet the lock timeout- Specified by:
getLockTimeoutin interfaceIProcessLiveness- Returns:
- the lock timeout
- See Also:
IProcessLiveness.getLockTimeout()
-
getScriptPath
public java.nio.file.Path getScriptPath()
Description copied from interface:IProcessLivenessGet the script path of this process or null if there is no folder- Specified by:
getScriptPathin interfaceIProcessLiveness- Returns:
- the script folder
- See Also:
IProcessLiveness.getScriptPath()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-