クラス ProcessFinder
java.lang.Object
com.kazurayam.subprocessj.ProcessFinder
-
ネストされたクラスの概要
ネストされたクラス -
メソッドの概要
修飾子とタイプメソッド説明static long
findPidByListeningPort
(int port) Given an IP Port number, identify the id of OS process that is listening to the port.static String
$ netstat -ano | find "LISTEN" | find "80" TCP 0.0.0.0:13688 0.0.0.0:0 LISTENING 4080 TCP [::]:13688 [::]:0 LISTENING 4080
-
メソッドの詳細
-
findCurrentJvmPid
public static long findCurrentJvmPid()- 戻り値:
- the process id of the OS process in which the current JVM is working
-
findPidByListeningPort
Given an IP Port number, identify the id of OS process that is listening to the port. This will use OS-dependent commands, for example `lsof -i:portNumber -P` on Mac and Linux.- パラメータ:
port
- IP port- 戻り値:
- FindingResult includes returncode
-
makeRegexForFilteringWindowsNetstatOutput
$ netstat -ano | find "LISTEN" | find "80" TCP 0.0.0.0:13688 0.0.0.0:0 LISTENING 4080 TCP [::]:13688 [::]:0 LISTENING 4080
protocol local-address exteria-address state process-id- パラメータ:
port
- IP port- 戻り値:
- a String as a Regular Expression pattern
-