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 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/EventType.java
/* * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jfr; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; import jdk.jfr.internal.JVMSupport; import jdk.jfr.internal.MetadataRepository; import jdk.jfr.internal.PlatformEventType; import jdk.jfr.internal.Type; import jdk.jfr.internal.Utils; /** * Describes an event, its fields, settings and annotations. * * @since 9 */ public final class EventType { private static final List<String> UNCATEGORIZED = List.of("Uncategorized"); private final PlatformEventType platformEventType; private Map<String, ValueDescriptor> cache; // create lazy to avoid memory overhead // helper constructor EventType(PlatformEventType platformEventType) { this.platformEventType = platformEventType; } /** * Returns an immutable list of descriptors that describe the event fields of * this event type. * * @return the list of field descriptors, not {@code null} */ public List<ValueDescriptor> getFields() { return platformEventType.getFields(); } /** * Returns the field with the specified name, or {@code null} if it doesn't * exist. * <p> * It's possible to index into a nested field by using {@code "."} (for * instance {@code "thread.group.parent.name}"). * * @param name of the field to get, not {@code null} * * @return a value descriptor that describes the field, or {@code null} if * the field with the specified name doesn't exist */ public ValueDescriptor getField(String name) { Objects.requireNonNull(name); if (cache == null) { List<ValueDescriptor> fields = getFields(); Map<String, ValueDescriptor> newCache = new LinkedHashMap<>(fields.size()); for (ValueDescriptor v :fields) { newCache.put(v.getName(), v); } cache = Map.copyOf(newCache); } ValueDescriptor result = cache.get(name); if (result == null) { // Cache doesn't contain subfields result = platformEventType.getField(name); } return result; } /** * Returns an identifier for the event (for example, * {@code "jdk.CPULoad"}). * <p> * The identifier is the fully qualified name of the event class, if not set using * the {@link Name} annotation. * * @return the name, not {@code null} * * @see Name */ public String getName() { return platformEventType.getName(); } /** * Returns a human-readable name (for example, {@code "CPU Load"}). * <p> * The label of an event class can be set with {@link Label}. * * @return the label, or {@code null} if a label is not set * * @see Label */ public String getLabel() { return platformEventType.getLabel(); } /** * Returns a unique ID for this event type in the Java Virtual Machine (JVM). * * @return the ID that is used in the JVM */ public long getId() { return platformEventType.getId(); } /** * Returns an immutable list of annotation elements for this event type. * * @return an immutable list of annotations or an empty list if no * annotations exists, not {@code null} */ public List<AnnotationElement> getAnnotationElements() { return platformEventType.getAnnotationElements(); } /** * Returns {@code true} if the event is enabled and at least one recording is * running, {@code false} otherwise. * <p> * By default, the event is enabled. The event can be enabled or disabled by * setting the enabled setting to {@code true} or {@code false}, programmatically or by using a * configuration file. The event can also be disabled by annotating event with * the {@code @Enabled(false)} annotation. * * @return true if event is enabled, false otherwise * * @see Enabled * @see Recording#enable(Class) */ public boolean isEnabled() { return platformEventType.isEnabled(); } /** * Returns a short sentence that describes the event class. * <p> * The description of an event class can be set with {@link Description}. * * @return the description, or {@code null} if no description exists * * @see Description */ public String getDescription() { return platformEventType.getDescription(); } /** * Returns the first annotation for the specified type if an annotation * element with the same name is directly present, otherwise {@code null}. * * @param <A> the type of the annotation to query for and return if present * @param annotationClass the {@code Class} object that corresponds to the * annotation type, not {@code null} * @return this element's annotation for the specified annotation type if * directly present, else {@code null} */ public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { Objects.requireNonNull(annotationClass); return platformEventType.getAnnotation(annotationClass); } /** * Returns the event type for an event class, or {@code null} if it doesn't * exist. * * @param eventClass the event class, not {@code null} * @return the event class, or null if class doesn't exist * * @throws IllegalArgumentException if {@code eventClass} is an abstract class * * @throws IllegalStateException if the class is annotated with * {@code Registered(false)}, but not manually registered */ public static EventType getEventType(Class<? extends Event> eventClass) { Objects.requireNonNull(eventClass); Utils.ensureValidEventSubclass(eventClass); JVMSupport.ensureWithInternalError(); return MetadataRepository.getInstance().getEventType(eventClass); } /** * Returns an immutable list of the setting descriptors that describe the available * event settings for this event type. * * @return the list of setting descriptors for this event type, not * {@code null} */ public List<SettingDescriptor> getSettingDescriptors() { return Collections.unmodifiableList(platformEventType.getSettings()); } /** * Returns the list of human-readable names that makes up the categories for * this event type (for example, {@code "Java Application"}, {@code "Statistics"}). * * @return an immutable list of category names, or a list with the name * {@code "Uncategorized"} if no category is set * * @see Category */ public List<String> getCategoryNames() { Category c = platformEventType.getAnnotation(Category.class); if (c == null) { return UNCATEGORIZED; } return List.of(c.value()); } // package private Type getType() { return platformEventType; } // package private PlatformEventType getPlatformEventType() { return platformEventType; } }
⏎ jdk/jfr/EventType.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, 8927👍, 0💬
Popular Posts:
What Is junit-3.8.1.jar? junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file. JUnit is a ...
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...
How to download and install iText7-Core-7.1.4.zip? iText7-Core-7.1.4.zip is the binary package of iT...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
Guava is a suite of core and expanded libraries that include utility classes, google's collections, ...