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 booleanequals(java.lang.Object obj)java.lang.IntegergetExitValue()Get the exit value for the process.java.lang.LonggetPid()Get the process idjava.time.InstantgetStartTime()Get the start time of the process.ISystemCommandGroupListgetSystemCommandGroupList()Get the system command group list.java.time.DurationgetTotalCpuDuration()Get the total cpu time accumulated of the process.inthashCode()java.lang.StringtoString()
-
-
-
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:IProcessGet the system command group list.- Specified by:
getSystemCommandGroupListin interfaceIProcess- Returns:
- the system command group list of this process
- See Also:
IProcess.getSystemCommandGroupList()
-
getPid
public java.lang.Long getPid()
Description copied from interface:IProcessGet the process id- Specified by:
getPidin 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:IProcessGet the start time of the process.- Specified by:
getStartTimein interfaceIProcess- Returns:
- the start time of the process
- See Also:
IProcess.getStartTime()
-
getTotalCpuDuration
public java.time.Duration getTotalCpuDuration()
Description copied from interface:IProcessGet the total cpu time accumulated of the process.- Specified by:
getTotalCpuDurationin interfaceIProcess- Returns:
- the accumulated total cpu time
- See Also:
IProcess.getTotalCpuDuration()
-
getExitValue
public java.lang.Integer getExitValue()
Description copied from interface:IProcessGet the exit value for the process.- Specified by:
getExitValuein interfaceIProcess- Returns:
- the exit value of the process, by convention, the value
0indicates normal termination. It return null if it has not exit by now. - See Also:
IProcess.getExitValue()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-