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 jdk.jfr.jmod - JFR Module
JDK 17 jdk.jfr.jmod is the JMOD file for JDK 17 JFR module.
JDK 17 JFR module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jfr.jmod.
JDK 17 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JFR module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/internal/Control.java
/*
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jfr.internal;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import jdk.jfr.SettingControl;
import jdk.jfr.internal.settings.JDKSettingControl;
public final class Control {
@SuppressWarnings("removal")
private final AccessControlContext context;
private static final int CACHE_SIZE = 5;
private final Set<?>[] cachedUnions = new HashSet<?>[CACHE_SIZE];
private final String[] cachedValues = new String[CACHE_SIZE];
private final SettingControl delegate;
private String defaultValue;
private String lastValue;
// called by exposed subclass in external API
public Control(SettingControl delegate, String defaultValue) {
this.context = PrivateAccess.getInstance().getContext(delegate);
this.delegate = delegate;
this.defaultValue = defaultValue;
if (this.context == null && !(delegate instanceof JDKSettingControl)) {
throw new InternalError("Security context can only be null for trusted setting controls");
}
}
boolean isType(Class<? extends SettingControl> clazz) {
return delegate.getClass() == clazz;
}
final void apply(Set<String> values) {
setValue(findCombine(values));
}
final void setDefault() {
if (defaultValue == null) {
defaultValue = getValue();
}
apply(defaultValue);
}
@SuppressWarnings("removal")
public String getValue() {
if (context == null) {
// VM events requires no access control context
return getValue();
} else {
return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
try {
return delegate.getValue();
} catch (Throwable t) {
// Prevent malicious user to propagate exception callback in the wrong context
Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when trying to get value for " + getClass());
}
return defaultValue != null ? defaultValue : ""; // Need to return something
}
}, context);
}
}
private void apply(String value) {
if (lastValue != null && Objects.equals(value, lastValue)) {
return;
}
setValue(value);
}
@SuppressWarnings("removal")
public void setValue(String value) {
if (context == null) {
// VM events requires no access control context
try {
delegate.setValue(value);
} catch (Throwable t) {
Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when setting value \"" + value + "\" for " + getClass());
}
} else {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
try {
delegate.setValue(value);
} catch (Throwable t) {
// Prevent malicious user to propagate exception callback in the wrong context
Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when setting value \"" + value + "\" for " + getClass());
}
return null;
}
}, context);
}
lastValue = value;
}
@SuppressWarnings("removal")
public String combine(Set<String> values) {
if (context == null) {
// VM events requires no access control context
return delegate.combine(values);
}
return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
try {
delegate.combine(Collections.unmodifiableSet(values));
} catch (Throwable t) {
// Prevent malicious user to propagate exception callback in the wrong context
Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when combining " + values + " for " + getClass());
}
return null;
}
}, context);
}
private final String findCombine(Set<String> values) {
if (values.size() == 1) {
return values.iterator().next();
}
for (int i = 0; i < CACHE_SIZE; i++) {
if (Objects.equals(cachedUnions[i], values)) {
return cachedValues[i];
}
}
String result = combine(values);
for (int i = 0; i < CACHE_SIZE - 1; i++) {
cachedUnions[i + 1] = cachedUnions[i];
cachedValues[i + 1] = cachedValues[i];
}
cachedValues[0] = result;
cachedUnions[0] = values;
return result;
}
final String getDefaultValue() {
return defaultValue;
}
final String getLastValue() {
return lastValue;
}
}
⏎ jdk/jfr/internal/Control.java
Or download all of them as a single archive file:
File name: jdk.jfr-17.0.5-src.zip File size: 363343 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jlink.jmod - JLink Tool
2023-04-17, ≈107🔥, 0💬
Popular Posts:
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
JDK 17 jdk.incubator.vector.jmo dis the JMOD file for JDK 17 HTTP Server module. JDK 17 Incubator Ve...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...