Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/common/ProcessArgumentMatcher.java
/* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package sun.tools.common; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; import com.sun.tools.attach.VirtualMachine; import com.sun.tools.attach.VirtualMachineDescriptor; import sun.jvmstat.monitor.MonitorException; import sun.jvmstat.monitor.MonitoredHost; import sun.jvmstat.monitor.MonitoredVm; import sun.jvmstat.monitor.MonitoredVmUtil; import sun.jvmstat.monitor.VmIdentifier; /** * Class for finding process matching a process argument, * excluding tool it self and returning a list containing * the process identifiers. */ public class ProcessArgumentMatcher { private String matchClass; private String singlePid; public ProcessArgumentMatcher(String pidArg) { if (pidArg == null || pidArg.isEmpty()) { throw new IllegalArgumentException("Pid string is invalid"); } if (pidArg.charAt(0) == '-') { throw new IllegalArgumentException("Unrecognized " + pidArg); } try { long pid = Long.parseLong(pidArg); if (pid != 0) { singlePid = String.valueOf(pid); } } catch (NumberFormatException nfe) { matchClass = pidArg; } } private static String getExcludeStringFrom(Class<?> excludeClass) { if (excludeClass == null) { return ""; } Module m = excludeClass.getModule(); if (m.isNamed()) { return m.getName() + "/" + excludeClass.getName(); } return excludeClass.getName(); } private static boolean check(VirtualMachineDescriptor vmd, String excludeClass, String partialMatch) { String mainClass = null; try { VmIdentifier vmId = new VmIdentifier(vmd.id()); MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId); MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1); mainClass = MonitoredVmUtil.mainClass(monitoredVm, true); monitoredHost.detach(monitoredVm); } catch (NullPointerException npe) { // There is a potential race, where a running java app is being // queried, unfortunately the java app has shutdown after this // method is started but before getMonitoredVM is called. // If this is the case, then the /tmp/hsperfdata_xxx/pid file // will have disappeared and we will get a NullPointerException. // Handle this gracefully.... return false; } catch (MonitorException | URISyntaxException e) { return false; } if (excludeClass != null && mainClass.equals(excludeClass)) { return false; } if (partialMatch != null && mainClass.indexOf(partialMatch) == -1) { return false; } return true; } private static Collection<VirtualMachineDescriptor> getSingleVMD(String pid) { Collection<VirtualMachineDescriptor> vids = new ArrayList<>(); List<VirtualMachineDescriptor> vmds = VirtualMachine.list(); for (VirtualMachineDescriptor vmd : vmds) { if (check(vmd, null, null)) { if (pid.equals(vmd.id())) { vids.add(vmd); } } } return vids; } private static Collection<VirtualMachineDescriptor> getVMDs(Class<?> excludeClass, String partialMatch) { String excludeCls = getExcludeStringFrom(excludeClass); Collection<VirtualMachineDescriptor> vids = new ArrayList<>(); List<VirtualMachineDescriptor> vmds = VirtualMachine.list(); for (VirtualMachineDescriptor vmd : vmds) { if (check(vmd, excludeCls, partialMatch)) { vids.add(vmd); } } return vids; } public Collection<VirtualMachineDescriptor> getVirtualMachineDescriptors(Class<?> excludeClass) { if (singlePid != null) { return getSingleVMD(singlePid); } else { return getVMDs(excludeClass, matchClass); } } public Collection<VirtualMachineDescriptor> getVirtualMachineDescriptors() { return this.getVirtualMachineDescriptors(null); } public Collection<String> getVirtualMachinePids(Class<?> excludeClass) { if (singlePid != null) { // There is a bug in AttachProvider, when VM is debuggee-suspended it's not listed by the AttachProvider. // If we are talking about a specific pid, just return it. return List.of(singlePid); } else { return getVMDs(excludeClass, matchClass).stream().map(x -> {return x.id();}).collect(Collectors.toList()); } } public Collection<String> getVirtualMachinePids() { return this.getVirtualMachinePids(null); } }
⏎ sun/tools/common/ProcessArgumentMatcher.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, 15092👍, 0💬
Popular Posts:
What is ojdbc.jar - JDBC Driver for Oracle? ojdbc.jar is a JDBC driver from Oracle that provides dat...
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...