Encapsulates information about a known process.
A few process properties (i.e. PID, command line) will never change during the lifetime of the process and can be read directly with this class accessors. Other process properties (i.e. state, cpu usage) will vary and their values are grouped in {@link ProcessInfoSnapshot} instances.
Operations on static properties of the process must be implemented in the {@link ProcessInfo} type. Operations onnon static properties must be implemented in the {@link ProcessInfoSnapshot} type. The {@link ProcessInfoSnapshot}subtype has been created to remind users of the class that they are working with cached data.
For example, if you want to be sure a process is still alive, you should use this code:
processInfo.freshSnapshot().isRunning()
Rather than:
processInfo.priorSnapshot().isRunning()
|
|
|
|
|
|