if -jar, use the jar name since no classname will be specified
This commit is contained in:
parent
3a2fcef755
commit
430962a988
|
@ -138,12 +138,15 @@ public class Ps extends SigarCommandBase {
|
|||
String[] args = sigar.getProcArgs(pid);
|
||||
for (int i=1; i<args.length; i++) {
|
||||
String arg = args[i];
|
||||
if (!isClassName(arg)) {
|
||||
continue;
|
||||
if (isClassName(arg)) {
|
||||
//example: "java:weblogic.Server"
|
||||
name += ":" + arg;
|
||||
break;
|
||||
}
|
||||
else if (arg.equals("-jar")) {
|
||||
name += ":" + args[i+1];
|
||||
break;
|
||||
}
|
||||
//example: "java:weblogic.Server"
|
||||
name += ":" + arg;
|
||||
break;
|
||||
}
|
||||
|
||||
} catch (SigarException e) {}
|
||||
|
|
Loading…
Reference in New Issue