public class ProcessManager extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
ProcessManager.ExternalProcess
Represents an external process.
|
| Constructor and Description |
|---|
ProcessManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
filterSystem(boolean filterSystem)
Filter system processes when trying to kill them.
|
long |
getKillProcessTimeOut()
Return a timeOut for the killing of a process.
|
int |
getKillProcessTimeOutCount()
Return the timeOut count for the killing of a process.
|
ProcessManager.ExternalProcess |
getProcess(String processName)
Return the first running proces which has a specific proces name.
|
SortedMap<Long,List<ProcessManager.ExternalProcess>> |
getProcessByCreationDate()
Return the map of running processes, sorted by their creation date.
|
SortedMap<Long,List<ProcessManager.ExternalProcess>> |
getProcessByCreationDate(String processName)
Return the map of running processes, sorted by their creation date.
|
List<ProcessManager.ExternalProcess> |
getProcesses()
Return the list of all running processes.
|
List<ProcessManager.ExternalProcess> |
getProcesses(String processName)
Return the list of running processes which have a specific proces name.
|
Map<String,List<ProcessManager.ExternalProcess>> |
getProcessMap()
Return the map of running processes, sorted by their process name.
|
boolean |
isFilteringSystem()
Return true if system processes are filtered when trying to kill them.
|
boolean |
isHandlingPlatform()
Return true if the current platform is handled.
|
boolean |
isRunning(int pid)
Return true if a process is currently running.
|
boolean |
isRunning(String processName)
Return true if a process is currently running.
|
boolean |
kill(ProcessManager.ExternalProcess process)
Kill an external process without its child processes.
|
boolean |
kill(ProcessManager.ExternalProcess process,
boolean recursive)
Kill an external process.
|
void |
setKillProcessTimeOut(long timeOut)
Set a timeOut for the killing of a process.
|
void |
setKillProcessTimeOutCount(int timeOutCount)
Set a timeOut count for the killing of a process.
|
public void setKillProcessTimeOut(long timeOut)
timeOut - the timeOutkill(org.mdiutil.lang.ProcessManager.ExternalProcess)public long getKillProcessTimeOut()
setKillProcessTimeOut(long)public void setKillProcessTimeOutCount(int timeOutCount)
timeOutCount - the timeOutCountkill(org.mdiutil.lang.ProcessManager.ExternalProcess)public int getKillProcessTimeOutCount()
kill(org.mdiutil.lang.ProcessManager.ExternalProcess)public void filterSystem(boolean filterSystem)
kill(org.mdiutil.lang.ProcessManager.ExternalProcess)
ethod will not kill processes which are:
filterSystem - true if filtering system processes when trying to kill thempublic boolean isFilteringSystem()
public boolean isHandlingPlatform()
public boolean isRunning(int pid)
pid - the process pidpublic boolean isRunning(String processName)
processName - the process namepublic SortedMap<Long,List<ProcessManager.ExternalProcess>> getProcessByCreationDate()
System.currentTimeMillis() method.public SortedMap<Long,List<ProcessManager.ExternalProcess>> getProcessByCreationDate(String processName)
System.currentTimeMillis() method.processName - the process namepublic Map<String,List<ProcessManager.ExternalProcess>> getProcessMap()
public List<ProcessManager.ExternalProcess> getProcesses(String processName)
processName - the process namepublic List<ProcessManager.ExternalProcess> getProcesses()
public ProcessManager.ExternalProcess getProcess(String processName)
processName - the process namepublic boolean kill(ProcessManager.ExternalProcess process, boolean recursive)
getKillProcessTimeOut() ≤ 0, then no wait will be performed after the execution of the KILL commandgetKillProcessTimeOutCount():
getKillProcessTimeOut()process - the processrecursive - true if the children processes must be killed toopublic boolean kill(ProcessManager.ExternalProcess process)
process - the process