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.jfr.jmod - JFR Module
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module.
JDK 11 JFR module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jfr.jmod.
JDK 11 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JFR module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/consumer/RecordingFile.java
/* * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jfr.consumer; import java.io.Closeable; import java.io.EOFException; import java.io.File; import java.io.IOException; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import jdk.jfr.EventType; import jdk.jfr.internal.MetadataDescriptor; import jdk.jfr.internal.consumer.ChunkHeader; import jdk.jfr.internal.consumer.RecordingInput; /** * A recording file. * <p> * The following example shows how read and print all events in a recording file. * * <pre> * <code> * try (RecordingFile recordingFile = new RecordingFile(Paths.get("recording.jfr"))) { * while (recordingFile.hasMoreEvents()) { * RecordedEvent event = recordingFile.readEvent(); * System.out.println(event); * } * } * </code> * </pre> * * @since 9 */ public final class RecordingFile implements Closeable { private final File file; private RecordingInput input; private ChunkParser chunkParser; private RecordedEvent nextEvent; private boolean eof; /** * Creates a recording file. * * @param file the path of the file to open, not {@code null} * @throws IOException if it's not a valid recording file, or an I/O error * occurred * @throws NoSuchFileException if the {@code file} can't be located * * @throws SecurityException if a security manager exists and its * {@code checkRead} method denies read access to the file. */ public RecordingFile(Path file) throws IOException { this.file = file.toFile(); this.input = new RecordingInput(this.file); findNext(); } /** * Reads the next event in the recording. * * @return the next event, not {@code null} * * @throws EOFException if no more events exist in the recording file * @throws IOException if an I/O error occurs. * * @see #hasMoreEvents() */ public RecordedEvent readEvent() throws IOException { if (eof) { ensureOpen(); throw new EOFException(); } RecordedEvent event = nextEvent; nextEvent = chunkParser.readEvent(); if (nextEvent == null) { findNext(); } return event; } /** * Returns {@code true} if unread events exist in the recording file, * {@code false} otherwise. * * @return {@code true} if unread events exist in the recording, {@code false} * otherwise. */ public boolean hasMoreEvents() { return !eof; } /** * Returns a list of all event types in this recording. * * @return a list of event types, not {@code null} * @throws IOException if an I/O error occurred while reading from the file * * @see #hasMoreEvents() */ public List<EventType> readEventTypes() throws IOException { ensureOpen(); List<EventType> types = new ArrayList<>(); HashSet<Long> foundIds = new HashSet<>(); try (RecordingInput ri = new RecordingInput(file)) { ChunkHeader ch = new ChunkHeader(ri); aggregateTypeForChunk(ch, types, foundIds); while (!ch.isLastChunk()) { ch = ch.nextHeader(); aggregateTypeForChunk(ch, types, foundIds); } } return types; } private static void aggregateTypeForChunk(ChunkHeader ch, List<EventType> types, HashSet<Long> foundIds) throws IOException { MetadataDescriptor m = ch.readMetadata(); for (EventType t : m.getEventTypes()) { if (!foundIds.contains(t.getId())) { types.add(t); foundIds.add(t.getId()); } } } /** * Closes this recording file and releases any system resources that are * associated with it. * * @throws IOException if an I/O error occurred */ public void close() throws IOException { if (input != null) { eof = true; input.close(); chunkParser = null; input = null; nextEvent = null; } } /** * Returns a list of all events in a file. * <p> * This method is intended for simple cases where it's convenient to read all * events in a single operation. It isn't intended for reading large files. * * @param path the path to the file, not {@code null} * * @return the events from the file as a {@code List} object; whether the * {@code List} is modifiable or not is implementation dependent and * therefore not specified, not {@code null} * * @throws IOException if an I/O error occurred, it's not a Flight Recorder * file or a version of a JFR file that can't be parsed * * @throws SecurityException if a security manager exists and its * {@code checkRead} method denies read access to the file. */ public static List<RecordedEvent> readAllEvents(Path path) throws IOException { try (RecordingFile r = new RecordingFile(path)) { List<RecordedEvent> list = new ArrayList<>(); while (r.hasMoreEvents()) { list.add(r.readEvent()); } return list; } } // either sets next to an event or sets eof to true private void findNext() throws IOException { while (nextEvent == null) { if (chunkParser == null) { chunkParser = new ChunkParser(input); } else if (!chunkParser.isLastChunk()) { chunkParser = chunkParser.nextChunkParser(); } else { eof = true; return; } nextEvent = chunkParser.readEvent(); } } private void ensureOpen() throws IOException { if (input == null) { throw new IOException("Stream Closed"); } } }
⏎ jdk/jfr/consumer/RecordingFile.java
Or download all of them as a single archive file:
File name: jdk.jfr-11.0.1-src.zip File size: 237632 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jlink.jmod - JLink Tool
2020-06-30, 37791👍, 0💬
Popular Posts:
JDK 11 jdk.xml.dom.jmod is the JMOD file for JDK 11 XML DOM module. JDK 11 XML DOM module compiled c...
What is ojdbc.jar - JDBC Driver for Oracle? ojdbc.jar is a JDBC driver from Oracle that provides dat...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module. JDK 17 Desktop module compiled ...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...