188 * <p> An {@code Info} instance has various accessor methods that return
189 * information about the process, if the process is alive and the
190 * information is available.
191 *
192 * @return a snapshot of information about the process, always non-null
193 */
194 Info info();
195
196 /**
197 * Information snapshot about the process.
198 * The attributes of a process vary by operating system and are not available
199 * in all implementations. Information about processes is limited
200 * by the operating system privileges of the process making the request.
201 * The return types are {@code Optional<T>} allowing explicit tests
202 * and actions if the value is available.
203 * @since 1.9
204 */
205 public interface Info {
206 /**
207 * Returns the executable pathname of the process.
208 *
209 * @return an {@code Optional<String>} of the executable pathname
210 * of the process
211 */
212 public Optional<String> command();
213
214 /**
215 * Returns an array of Strings of the arguments of the process.
216 *
217 * @return an {@code Optional<String[]>} of the arguments of the process
218 */
219 public Optional<String[]> arguments();
220
221 /**
222 * Returns the start time of the process.
223 *
224 * @return an {@code Optional<Instant>} of the start time of the process
225 */
226 public Optional<Instant> startInstant();
227
228 /**
229 * Returns the total cputime accumulated of the process.
230 *
231 * @return an {@code Optional<Duration>} for the accumulated total cputime
232 */
233 public Optional<Duration> totalCpuDuration();
234
235 /**
|
188 * <p> An {@code Info} instance has various accessor methods that return
189 * information about the process, if the process is alive and the
190 * information is available.
191 *
192 * @return a snapshot of information about the process, always non-null
193 */
194 Info info();
195
196 /**
197 * Information snapshot about the process.
198 * The attributes of a process vary by operating system and are not available
199 * in all implementations. Information about processes is limited
200 * by the operating system privileges of the process making the request.
201 * The return types are {@code Optional<T>} allowing explicit tests
202 * and actions if the value is available.
203 * @since 1.9
204 */
205 public interface Info {
206 /**
207 * Returns the executable pathname of the process.
208 * <p>
209 * <em>Note that the returned pathname may be truncated on some
210 * platforms due to system limitations. It may also only contain
211 * the name of the executable without the full path information.
212 * </em>
213 *
214 * @return an {@code Optional<String>} of the executable pathname
215 * of the process
216 */
217 public Optional<String> command();
218
219 /**
220 * Returns an array of Strings of the arguments of the process.
221 * <p>
222 * <em>Note that the argument list may be truncated on some
223 * platforms due to system limitations.
224 * </em>
225 *
226 * @return an {@code Optional<String[]>} of the arguments of the process
227 */
228 public Optional<String[]> arguments();
229
230 /**
231 * Returns the start time of the process.
232 *
233 * @return an {@code Optional<Instant>} of the start time of the process
234 */
235 public Optional<Instant> startInstant();
236
237 /**
238 * Returns the total cputime accumulated of the process.
239 *
240 * @return an {@code Optional<Duration>} for the accumulated total cputime
241 */
242 public Optional<Duration> totalCpuDuration();
243
244 /**
|