Package jetbrains.buildServer.processes
Class ProcessTreeTerminatorImplBase
- java.lang.Object
-
- jetbrains.buildServer.processes.ProcessTreeTerminatorImplBase
-
- All Implemented Interfaces:
ProcessTerminatorSupport
- Direct Known Subclasses:
ProcessTreeTerminatorAIX
,ProcessTreeTerminatorHPUX
,ProcessTreeTerminatorLinux
,ProcessTreeTerminatorMac
,ProcessTreeTerminatorSolaris
,ProcessTreeTerminatorUnix
,ProcessTreeTerminatorWindows
public abstract class ProcessTreeTerminatorImplBase extends Object implements ProcessTerminatorSupport
Created by IntelliJ IDEA. User: Eugene.Petrenko Date: 23.08.2007 Time: 13:44:50
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ProcessTreeTerminatorImplBase.UnsupportedCommandException
-
Constructor Summary
Constructors Constructor Description ProcessTreeTerminatorImplBase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ProcessTreeWrapper
buildProcessTree(ProcessFilter filter, int delaySeconds)
protected ProcessTreeWrapper
buildProcessTree(ProcessFilter filter, int delaySeconds, String[] suggestedCommand)
protected static VisitableProcessTree
buildProcessTreeFromPsOutput(List<String> lines)
List<ProcessNode>
getAllSubProcessesIds(Long pid, ProcessFilter filter, int delaySeconds)
protected String[]
getAlternativePsPpidCommand()
long
getCurrentPid(int delaySeconds)
protected KillProcessDetails
getForceKillDetails(KillProcessDetails killProcessDetails)
protected String[]
getKillProcessesCommand(List<Long> pids, KillProcessDetails killProcessDetails)
protected long
getPid(ProcessTreeWrapper tree)
protected ProcessTreeWrapper
getProcessVisitor(ProcessFilter filter, int delaySeconds)
protected abstract String[]
getPsPpidCommand()
protected void
kill(List<ProcessNode> nodes, int delaySeconds, KillProcessDetails killProcessDetails)
Executes kill command according to the settings in killProcessDetails in the order of the nodes passedboolean
killProcessTree(Long pid, KillProcessDetails killProcessDetails, int commandTimeout)
Kills process specified by pid and it's subprocesses matched by specified filter.static List<List<ProcessNode>>
layers(List<ProcessNode> items, int maxLayers)
returns the tree in the layered form, starting from the topmost nodes, but not more than maxLayers layers.protected List<String>
readCommandOutput(String[] command, int delaySeconds)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.processes.ProcessTerminatorSupport
available
-
-
-
-
Method Detail
-
getCurrentPid
public long getCurrentPid(int delaySeconds)
- Specified by:
getCurrentPid
in interfaceProcessTerminatorSupport
-
getAllSubProcessesIds
@NotNull public List<ProcessNode> getAllSubProcessesIds(@Nullable Long pid, @NotNull ProcessFilter filter, int delaySeconds)
- Specified by:
getAllSubProcessesIds
in interfaceProcessTerminatorSupport
-
getPsPpidCommand
@NotNull protected abstract String[] getPsPpidCommand()
-
getAlternativePsPpidCommand
@Nullable protected String[] getAlternativePsPpidCommand()
-
getProcessVisitor
@NotNull protected ProcessTreeWrapper getProcessVisitor(@NotNull ProcessFilter filter, int delaySeconds)
-
killProcessTree
public boolean killProcessTree(@Nullable Long pid, @NotNull KillProcessDetails killProcessDetails, int commandTimeout)
Kills process specified by pid and it's subprocesses matched by specified filter. If pid parameter is null, kills current process's subtree. Avoids killing current process- Specified by:
killProcessTree
in interfaceProcessTerminatorSupport
- Parameters:
pid
- process pidkillProcessDetails
- kill process details- Returns:
- should return the actual status if the process was killed, but current implementation may return true even if the process was not killed.
-
getForceKillDetails
@NotNull protected KillProcessDetails getForceKillDetails(@NotNull KillProcessDetails killProcessDetails)
-
buildProcessTreeFromPsOutput
protected static VisitableProcessTree buildProcessTreeFromPsOutput(@NotNull List<String> lines)
-
getKillProcessesCommand
@Nullable protected String[] getKillProcessesCommand(@NotNull List<Long> pids, @NotNull KillProcessDetails killProcessDetails)
-
kill
protected void kill(@NotNull List<ProcessNode> nodes, int delaySeconds, @NotNull KillProcessDetails killProcessDetails)
Executes kill command according to the settings in killProcessDetails in the order of the nodes passed
-
layers
@NotNull public static List<List<ProcessNode>> layers(@NotNull List<ProcessNode> items, int maxLayers)
returns the tree in the layered form, starting from the topmost nodes, but not more than maxLayers layers. Last layer contains all the remaining items
-
getPid
protected long getPid(ProcessTreeWrapper tree)
-
buildProcessTree
protected final ProcessTreeWrapper buildProcessTree(@NotNull ProcessFilter filter, int delaySeconds)
-
buildProcessTree
@NotNull protected final ProcessTreeWrapper buildProcessTree(@NotNull ProcessFilter filter, int delaySeconds, @Nullable String[] suggestedCommand)
-
-