-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created an API for visiting the process tree
- Loading branch information
Jez Humble
committed
Jan 8, 2010
1 parent
98bddfb
commit 1a7c42d
Showing
4 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/com/jezhumble/javasysmon/ProcessVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.jezhumble.javasysmon; | ||
|
||
/** | ||
* Allows you to visit the process tree using {@link JavaSysMon#visitProcessTree} | ||
*/ | ||
public interface ProcessVisitor { | ||
/** | ||
* Called on every node. The process tree is traversed depth-first | ||
* @param process The current process being visited | ||
* @param level How many levels beneath the initial node visited you are (0-indexed) | ||
* @return Whether or not to kill the process being visited | ||
*/ | ||
boolean visit(OsProcess process, int level); | ||
} |