Package org.zeroturnaround.process
Class Processes
java.lang.Object
org.zeroturnaround.process.Processes
Creates
SystemProcess instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaProcessnewJavaProcess(Process process) Creates an instance that represents the givenProcessobject.static PidProcessnewPidProcess(int pid) Creates an instance that represents the given PID value.static PidProcessnewPidProcess(Process process) Creates an instance that represents the PID value of the givenProcess.static SystemProcessnewProcessForMultiple(SystemProcess... processes) Combines existingSystemProcessobjects for multiple processes.static SystemProcessnewProcessWithAlternatives(SystemProcess... processes) Combines existingSystemProcessobjects as alternative implementations for a single process.static SystemProcessnewProcessWithAtlernatives(SystemProcess... processes) Deprecated.static SystemProcessnewStandardProcess(Process process) static SystemProcessnewStandardProcess(Process process, int pid) Creates an instance that represents the givenProcessor the given PID.
-
Constructor Details
-
Processes
public Processes()
-
-
Method Details
-
newStandardProcess
Creates an instance that represents the givenProcessby detecting its PID using both,Processobject and external tools. Java APIs are tried before using the external tools.- Parameters:
process- instance of an existing process started from JVM.- Returns:
- system process that represents the given input as described above.
-
newStandardProcess
Creates an instance that represents the givenProcessor the given PID. They are expected to belong to the same system process. Java APIs are tried before using the external tools (PID value).- Parameters:
process- instance of an existing process started from JVM.pid- PID of the same process.- Returns:
- system process that represents the given input as described above.
-
newJavaProcess
Creates an instance that represents the givenProcessobject.- Parameters:
process- instance of an existing process started from JVM.- Returns:
- system process that represents the given input as described above.
-
newPidProcess
Creates an instance that represents the PID value of the givenProcess. The instance uses external tools for killing the process.- Parameters:
process- instance of an existing process started from JVM.- Returns:
- system process that represents the given input as described above.
-
newPidProcess
Creates an instance that represents the given PID value. The instance uses external tools for killing the process.- Parameters:
pid- PID of an external process (running or not).- Returns:
- system process that represents the given input as described above.
-
newProcessWithAtlernatives
Deprecated.UsenewProcessWithAlternatives(SystemProcess...)instead.Combines existingSystemProcessobjects as alternative implementations for a single process.- Parameters:
processes- alternative process instances that represent a single process.- Returns:
- system process that represents the given inputs as described above.
-
newProcessWithAlternatives
Combines existingSystemProcessobjects as alternative implementations for a single process.- Parameters:
processes- alternative process instances that represent a single process.- Returns:
- system process that represents the given inputs as described above.
-
newProcessForMultiple
Combines existingSystemProcessobjects for multiple processes.- Parameters:
processes- process instances that represent different processes.- Returns:
- system process that represents the given inputs as described above.
-
newProcessWithAlternatives(SystemProcess...)instead.