Class AbstractProcess
- java.lang.Object
-
- com.github.toolarium.system.command.process.impl.AbstractProcess
-
- All Implemented Interfaces:
IProcess
- Direct Known Subclasses:
AsynchronousProcess
,SynchronousProcess
public abstract class AbstractProcess extends java.lang.Object implements IProcess
Implements the abstract process base classIProcess
-
-
Constructor Summary
Constructors Constructor Description AbstractProcess(ISystemCommandGroupList systemCommandGroupList, java.lang.Long pid, java.time.Instant startTime, java.time.Duration totalCpuDuration, java.lang.Integer exitValue)
Constructor for Process
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Integer
getExitValue()
Get the exit value for the process.java.lang.Long
getPid()
Get the process idjava.time.Instant
getStartTime()
Get the start time of the process.ISystemCommandGroupList
getSystemCommandGroupList()
Get the system command group list.java.time.Duration
getTotalCpuDuration()
Get the total cpu time accumulated of the process.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
AbstractProcess
public AbstractProcess(ISystemCommandGroupList systemCommandGroupList, java.lang.Long pid, java.time.Instant startTime, java.time.Duration totalCpuDuration, java.lang.Integer exitValue)
Constructor for Process- Parameters:
systemCommandGroupList
- the system command group listpid
- the pidstartTime
- the start timetotalCpuDuration
- the total cpu durationexitValue
- the exist value
-
-
Method Detail
-
getSystemCommandGroupList
public ISystemCommandGroupList getSystemCommandGroupList()
Description copied from interface:IProcess
Get the system command group list.- Specified by:
getSystemCommandGroupList
in interfaceIProcess
- Returns:
- the system command group list of this process
- See Also:
IProcess.getSystemCommandGroupList()
-
getPid
public java.lang.Long getPid()
Description copied from interface:IProcess
Get the process id- Specified by:
getPid
in interfaceIProcess
- Returns:
- the native process id of the process or null if unknown
- See Also:
IProcess.getPid()
-
getStartTime
public java.time.Instant getStartTime()
Description copied from interface:IProcess
Get the start time of the process.- Specified by:
getStartTime
in interfaceIProcess
- Returns:
- the start time of the process
- See Also:
IProcess.getStartTime()
-
getTotalCpuDuration
public java.time.Duration getTotalCpuDuration()
Description copied from interface:IProcess
Get the total cpu time accumulated of the process.- Specified by:
getTotalCpuDuration
in interfaceIProcess
- Returns:
- the accumulated total cpu time
- See Also:
IProcess.getTotalCpuDuration()
-
getExitValue
public java.lang.Integer getExitValue()
Description copied from interface:IProcess
Get the exit value for the process.- Specified by:
getExitValue
in interfaceIProcess
- Returns:
- the exit value of the process, by convention, the value
0
indicates normal termination. It return null if it has not exit by now. - See Also:
IProcess.getExitValue()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-