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 17 java.management.jmod - Management Module
JDK 17 java.management.jmod is the JMOD file for JDK 17 Management module.
JDK 17 Management module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.management.jmod.
JDK 17 Management module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Management module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.management.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/management/counter/perf/PerfInstrumentation.java
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.management.counter.perf;
import sun.management.counter.*;
import java.nio.*;
import java.util.*;
import java.util.regex.*;
public class PerfInstrumentation {
private ByteBuffer buffer;
private Prologue prologue;
private long lastModificationTime;
private long lastUsed;
private int nextEntry;
private SortedMap<String, Counter> map;
public PerfInstrumentation(ByteBuffer b) {
prologue = new Prologue(b);
buffer = b;
buffer.order(prologue.getByteOrder());
// Check recognized versions
int major = getMajorVersion();
int minor = getMinorVersion();
// Support only 2.0 version
if (major < 2) {
throw new InstrumentationException("Unsupported version: " +
major + "." + minor);
}
rewind();
}
public int getMajorVersion() {
return prologue.getMajorVersion();
}
public int getMinorVersion() {
return prologue.getMinorVersion();
}
public long getModificationTimeStamp() {
return prologue.getModificationTimeStamp();
}
void rewind() {
// rewind to the first entry
buffer.rewind();
buffer.position(prologue.getEntryOffset());
nextEntry = buffer.position();
// rebuild all the counters
map = new TreeMap<>();
}
boolean hasNext() {
return (nextEntry < prologue.getUsed());
}
Counter getNextCounter() {
if (! hasNext()) {
return null;
}
if ((nextEntry % 4) != 0) {
// entries are always 4 byte aligned.
throw new InstrumentationException(
"Entry index not properly aligned: " + nextEntry);
}
if (nextEntry < 0 || nextEntry > buffer.limit()) {
// defensive check to protect against a corrupted shared memory region.
throw new InstrumentationException(
"Entry index out of bounds: nextEntry = " + nextEntry +
", limit = " + buffer.limit());
}
buffer.position(nextEntry);
PerfDataEntry entry = new PerfDataEntry(buffer);
nextEntry = nextEntry + entry.size();
Counter counter = null;
PerfDataType type = entry.type();
if (type == PerfDataType.BYTE) {
if (entry.units() == Units.STRING && entry.vectorLength() > 0) {
counter = new PerfStringCounter(entry.name(),
entry.variability(),
entry.flags(),
entry.vectorLength(),
entry.byteData());
} else if (entry.vectorLength() > 0) {
counter = new PerfByteArrayCounter(entry.name(),
entry.units(),
entry.variability(),
entry.flags(),
entry.vectorLength(),
entry.byteData());
} else {
// ByteArrayCounter must have vectorLength > 0
assert false;
}
}
else if (type == PerfDataType.LONG) {
if (entry.vectorLength() == 0) {
counter = new PerfLongCounter(entry.name(),
entry.units(),
entry.variability(),
entry.flags(),
entry.longData());
} else {
counter = new PerfLongArrayCounter(entry.name(),
entry.units(),
entry.variability(),
entry.flags(),
entry.vectorLength(),
entry.longData());
}
}
else {
// FIXME: Should we throw an exception for unsupported type?
// Currently skip such entry
assert false;
}
return counter;
}
public synchronized List<Counter> getAllCounters() {
while (hasNext()) {
Counter c = getNextCounter();
if (c != null) {
map.put(c.getName(), c);
}
}
return new ArrayList<>(map.values());
}
public synchronized List<Counter> findByPattern(String patternString) {
while (hasNext()) {
Counter c = getNextCounter();
if (c != null) {
map.put(c.getName(), c);
}
}
Pattern pattern = Pattern.compile(patternString);
Matcher matcher = pattern.matcher("");
List<Counter> matches = new ArrayList<>();
for (Map.Entry<String,Counter> me: map.entrySet()) {
String name = me.getKey();
// apply pattern to counter name
matcher.reset(name);
// if the pattern matches, then add Counter to list
if (matcher.lookingAt()) {
matches.add(me.getValue());
}
}
return matches;
}
}
⏎ sun/management/counter/perf/PerfInstrumentation.java
Or download all of them as a single archive file:
File name: java.management-17.0.5-src.zip File size: 850134 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.management.rmi.jmod - Management RMI Module
2023-09-23, ≈103🔥, 0💬
Popular Posts:
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...
JDK 11 jdk.security.auth.jmod is the JMOD file for JDK 11 Security Auth module. JDK 11 Security Auth...
JDK 8 jconsole.jar is the JAR file for JDK 8 JConsole, which is a graphical monitoring tool to monit...