Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 11 jdk.jcmd.jmod - JCmd Tool
JDK 11 jdk.jcmd.jmod is the JMOD file for JDK 11 JCmd tool,
which can be invoked by the "jcmd" command.
JDK 11 JCmd tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jcmd.jmod.
JDK 11 JCmd tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JCmd source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jcmd.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/tools/jstack/JStack.java
/* * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.tools.jstack; import java.io.InputStream; import java.util.Collection; import com.sun.tools.attach.VirtualMachine; import com.sun.tools.attach.VirtualMachineDescriptor; import sun.tools.attach.HotSpotVirtualMachine; import sun.tools.common.ProcessArgumentMatcher; /* * This class is the main class for the JStack utility. It parses its arguments * and decides if the command should be executed by the SA JStack tool or by * obtained the thread dump from a target process using the VM attach mechanism */ public class JStack { public static void main(String[] args) throws Exception { if (args.length == 0) { usage(1); // no arguments } checkForUnsupportedOptions(args); boolean locks = false; boolean extended = false; // Parse the options (arguments starting with "-" ) int optionCount = 0; while (optionCount < args.length) { String arg = args[optionCount]; if (!arg.startsWith("-")) { break; } if (arg.equals("-?") || arg.equals("-h") || arg.equals("--help") || // -help: legacy. arg.equals("-help")) { usage(0); } else { if (arg.equals("-l")) { locks = true; } else { if (arg.equals("-e")) { extended = true; } else { usage(1); } } } optionCount++; } // Next we check the parameter count. int paramCount = args.length - optionCount; if (paramCount != 1) { usage(1); } // pass -l to thread dump operation to get extra lock info String pidArg = args[optionCount]; String params[]= new String[] { "" }; if (extended) { params[0] += "-e "; } if (locks) { params[0] += "-l"; } ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg); Collection<String> pids = ap.getVirtualMachinePids(JStack.class); if (pids.isEmpty()) { System.err.println("Could not find any processes matching : '" + pidArg + "'"); System.exit(1); } for (String pid : pids) { if (pids.size() > 1) { System.out.println("Pid:" + pid); } runThreadDump(pid, params); } } // Attach to pid and perform a thread dump private static void runThreadDump(String pid, String args[]) throws Exception { VirtualMachine vm = null; try { vm = VirtualMachine.attach(pid); } catch (Exception x) { String msg = x.getMessage(); if (msg != null) { System.err.println(pid + ": " + msg); } else { x.printStackTrace(); } System.exit(1); } // Cast to HotSpotVirtualMachine as this is implementation specific // method. InputStream in = ((HotSpotVirtualMachine)vm).remoteDataDump((Object[])args); // read to EOF and just print output byte b[] = new byte[256]; int n; do { n = in.read(b); if (n > 0) { String s = new String(b, 0, n, "UTF-8"); System.out.print(s); } } while (n > 0); in.close(); vm.detach(); } private static void checkForUnsupportedOptions(String[] args) { // Check arguments for -F, -m, and non-numeric value // and warn the user that SA is not supported anymore int paramCount = 0; for (String s : args) { if (s.equals("-F")) { SAOptionError("-F option used"); } if (s.equals("-m")) { SAOptionError("-m option used"); } if (! s.startsWith("-")) { paramCount += 1; } } if (paramCount > 1) { SAOptionError("More than one non-option argument"); } } private static void SAOptionError(String msg) { System.err.println("Error: " + msg); System.err.println("Cannot connect to core dump or remote debug server. Use jhsdb jstack instead"); System.exit(1); } // print usage message private static void usage(int exit) { System.err.println("Usage:"); System.err.println(" jstack [-l][-e] <pid>"); System.err.println(" (to connect to running process)"); System.err.println(""); System.err.println("Options:"); System.err.println(" -l long listing. Prints additional information about locks"); System.err.println(" -e extended listing. Prints additional information about threads"); System.err.println(" -? -h --help -help to print this help message"); System.exit(exit); } }
⏎ sun/tools/jstack/JStack.java
Or download all of them as a single archive file:
File name: jdk.jcmd-11.0.1-src.zip File size: 47892 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jconsole.jmod - JConsole Tool
2020-07-07, 16927👍, 0💬
Popular Posts:
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
JDK 11 jdk.jdeps.jmod is the JMOD file for JDK 11 JDeps tool, which can be invoked by the "jdeps" co...
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
Apache BCEL Source Code Files are inside the Apache BCEL source package file like bcel-6.6.1-src.zip...
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module. JDK 11 JFR module compiled class files a...