JDK 17 jdk.management.jfr.jmod - Management JFR Module

JDK 17 jdk.management.jfr.jmod is the JMOD file for JDK 17 Management Jfr module.

JDK 17 Management JFR module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.management.jfr.jmod.

JDK 17 Management JFR module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.

JDK 17 Management JFR module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.management.jfr.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

jdk/management/jfr/FileDump.java

/*
 * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */
package jdk.management.jfr;

import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayDeque;
import java.util.Queue;

import jdk.management.jfr.DiskRepository.DiskChunk;

final class FileDump {
    private final Queue<DiskChunk> chunks = new ArrayDeque<>();
    private final long stopTimeMillis;
    private boolean complete;

    FileDump(long stopTimeMillis) {
        this.stopTimeMillis = stopTimeMillis;
    }

    public synchronized void add(DiskChunk dc) {
        if (isComplete()) {
            return;
        }
        dc.acquire();
        chunks.add(dc);
        long endMillis = dc.endTimeNanos / 1_000_000;
        if (endMillis >= stopTimeMillis) {
            setComplete();
        }
    }

    public synchronized boolean isComplete() {
        return complete;
    }

    public synchronized void setComplete() {
        complete = true;
        this.notifyAll();
    }

    public synchronized void close() {
        for (DiskChunk dc : chunks) {
            dc.release();
        }
        chunks.clear();
        complete = true;
    }

    private DiskChunk oldestChunk() throws InterruptedException {
        while (true) {
            synchronized (this) {
                if (!chunks.isEmpty()) {
                    return chunks.poll();
                }
                if (complete) {
                    return null;
                }
                this.wait();
            }
        }
    }

    public void write(Path path) throws IOException, InterruptedException {
        try (FileChannel out = FileChannel.open(path, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE)) {
            DiskChunk chunk = null;
            while ((chunk = oldestChunk()) != null) {
                try (FileChannel in = FileChannel.open(chunk.path(), StandardOpenOption.READ)) {
                    in.transferTo(0, in.size(), out);
                }
            }
        } finally {
            close();
        }
    }
}

jdk/management/jfr/FileDump.java

 

Or download all of them as a single archive file:

File name: jdk.management.jfr-17.0.5-src.zip
File size: 34348 bytes
Release date: 2022-09-13
Download 

 

JDK 17 jdk.naming.dns.jmod - Naming DNS Module

JDK 17 jdk.management.agent.jmod - Management Agent Module

JDK 17 JMod/Module Files

⇑⇑ FAQ for JDK (Java Development Kit) 17

2023-07-29, 927👍, 0💬