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.Instant
getLockTimeout()
Get the lock timeoutlong
getPollTimeout()
Get the process poll timeoutjava.lang.Process
getProcess()
Get the processjava.lang.Long
getProcessId()
Get the process idjava.nio.file.Path
getScriptPath()
Get the script path of this process or null if there is no folderjava.time.Instant
getStartupTime()
Get the startup timeboolean
isAlive()
Verify if the underlining process is alivevoid
run()
java.lang.String
toString()
-
-
-
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:IProcessLiveness
Verify if the underlining process is alive- Specified by:
isAlive
in interfaceIProcessLiveness
- Returns:
- true if it is alive
- See Also:
IProcessLiveness.isAlive()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- See Also:
Runnable.run()
-
getStartupTime
public java.time.Instant getStartupTime()
Description copied from interface:IProcessLiveness
Get the startup time- Specified by:
getStartupTime
in interfaceIProcessLiveness
- Returns:
- the startup time
- See Also:
IProcessLiveness.getStartupTime()
-
getPollTimeout
public long getPollTimeout()
Description copied from interface:IProcessLiveness
Get the process poll timeout- Specified by:
getPollTimeout
in interfaceIProcessLiveness
- Returns:
- the process poll timeout
- See Also:
IProcessLiveness.getPollTimeout()
-
getProcess
public java.lang.Process getProcess()
Description copied from interface:IProcessLiveness
Get the process- Specified by:
getProcess
in interfaceIProcessLiveness
- Returns:
- the process
- See Also:
IProcessLiveness.getProcess()
-
getProcessId
public java.lang.Long getProcessId()
Description copied from interface:IProcessLiveness
Get the process id- Specified by:
getProcessId
in interfaceIProcessLiveness
- Returns:
- the process id
- See Also:
IProcessLiveness.getProcessId()
-
getLockTimeout
public java.time.Instant getLockTimeout()
Description copied from interface:IProcessLiveness
Get the lock timeout- Specified by:
getLockTimeout
in interfaceIProcessLiveness
- Returns:
- the lock timeout
- See Also:
IProcessLiveness.getLockTimeout()
-
getScriptPath
public java.nio.file.Path getScriptPath()
Description copied from interface:IProcessLiveness
Get the script path of this process or null if there is no folder- Specified by:
getScriptPath
in interfaceIProcessLiveness
- Returns:
- the script folder
- See Also:
IProcessLiveness.getScriptPath()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-