use of org.zeroturnaround.process.WindowsProcess in project aws-greengrass-nucleus by aws-greengrass.
the class WindowsPlatform method killProcessAndChildren.
@Override
public Set<Integer> killProcessAndChildren(Process process, boolean force, Set<Integer> additionalPids, UserDecorator decorator) throws IOException, InterruptedException {
PidProcess pp = Processes.newPidProcess(process);
((WindowsProcess) pp).setIncludeChildren(true);
((WindowsProcess) pp).setGracefulDestroyEnabled(true);
try {
pp.destroy(force);
} catch (InvalidExitValueException e) {
// In other words, we rethrow the exception if the process is still alive.
if (process.isAlive()) {
throw e;
}
}
return Collections.emptySet();
}
Aggregations