All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.common.os.GetAllProcessesInfoAction Maven / Gradle / Ivy

The newest version!
package io.smallrye.common.os;

import java.security.PrivilegedAction;
import java.util.List;
import java.util.stream.Collectors;

final class GetAllProcessesInfoAction implements PrivilegedAction> {

    @Override
    public List run() {
        return ProcessHandle.allProcesses()
                .map(processHandle -> new ProcessInfo(processHandle.pid(), processHandle.info().command().orElse(null)))
                .collect(Collectors.toList());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy