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/internal/Repository.java
/* * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jfr.internal; import java.io.IOException; import java.nio.file.Path; import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.util.HashSet; import java.util.Set; import jdk.jfr.internal.SecuritySupport.SafePath; import jdk.jfr.internal.management.ChunkFilename; public final class Repository { private static final int MAX_REPO_CREATION_RETRIES = 1000; private static final JVM jvm = JVM.getJVM(); private static final Repository instance = new Repository(); private static final String JFR_REPOSITORY_LOCATION_PROPERTY = "jdk.jfr.repository"; private final Set<SafePath> cleanupDirectories = new HashSet<>(); private SafePath baseLocation; private SafePath repository; private ChunkFilename chunkFilename; private Repository() { } public static Repository getRepository() { return instance; } public synchronized void setBasePath(SafePath baseLocation) throws IOException { if(baseLocation.equals(this.baseLocation)) { Logger.log(LogTag.JFR, LogLevel.INFO, "Same base repository path " + baseLocation.toString() + " is set"); return; } // Probe to see if repository can be created, needed for fail fast // during JVM startup or JFR.configure this.repository = createRepository(baseLocation); this.chunkFilename = null; try { // Remove so we don't "leak" repositories, if JFR is never started // and shutdown hook not added. SecuritySupport.delete(repository); } catch (IOException ioe) { Logger.log(LogTag.JFR, LogLevel.INFO, "Could not delete disk repository " + repository); } this.baseLocation = baseLocation; } public synchronized void ensureRepository() throws IOException { if (baseLocation == null) { setBasePath(SecuritySupport.JAVA_IO_TMPDIR); } } synchronized RepositoryChunk newChunk() { ZonedDateTime timestamp = ZonedDateTime.now(); try { if (!SecuritySupport.existDirectory(repository)) { this.repository = createRepository(baseLocation); jvm.setRepositoryLocation(repository.toString()); SecuritySupport.setProperty(JFR_REPOSITORY_LOCATION_PROPERTY, repository.toString()); cleanupDirectories.add(repository); chunkFilename = null; } if (chunkFilename == null) { chunkFilename = ChunkFilename.newPriviliged(repository.toPath()); } String filename = chunkFilename.next(timestamp.toLocalDateTime()); return new RepositoryChunk(new SafePath(filename)); } catch (Exception e) { String errorMsg = String.format("Could not create chunk in repository %s, %s: %s", repository, e.getClass(), e.getMessage()); Logger.log(LogTag.JFR, LogLevel.ERROR, errorMsg); jvm.abort(errorMsg); throw new InternalError("Could not abort after JFR disk creation error"); } } private static SafePath createRepository(SafePath basePath) throws IOException { SafePath canonicalBaseRepositoryPath = createRealBasePath(basePath); SafePath f = null; String basename = Utils.formatDateTime(LocalDateTime.now()) + "_" + JVM.getJVM().getPid(); String name = basename; int i = 0; for (; i < MAX_REPO_CREATION_RETRIES; i++) { f = new SafePath(canonicalBaseRepositoryPath.toPath().resolve(name)); if (tryToUseAsRepository(f)) { break; } name = basename + "_" + i; } if (i == MAX_REPO_CREATION_RETRIES) { throw new IOException("Unable to create JFR repository directory using base location (" + basePath + ")"); } return SecuritySupport.toRealPath(f); } private static SafePath createRealBasePath(SafePath safePath) throws IOException { if (SecuritySupport.exists(safePath)) { if (!SecuritySupport.isWritable(safePath)) { throw new IOException("JFR repository directory (" + safePath.toString() + ") exists, but isn't writable"); } return SecuritySupport.toRealPath(safePath); } SafePath p = SecuritySupport.createDirectories(safePath); return SecuritySupport.toRealPath(p); } private static boolean tryToUseAsRepository(final SafePath path) { Path parent = path.toPath().getParent(); if (parent == null) { return false; } try { try { SecuritySupport.createDirectories(path); } catch (Exception e) { // file already existed or some other problem occurred } if (!SecuritySupport.exists(path)) { return false; } if (!SecuritySupport.isDirectory(path)) { return false; } return true; } catch (IOException io) { return false; } } synchronized void clear() { for (SafePath p : cleanupDirectories) { try { SecuritySupport.clearDirectory(p); Logger.log(LogTag.JFR, LogLevel.INFO, "Removed repository " + p); } catch (IOException e) { Logger.log(LogTag.JFR, LogLevel.INFO, "Repository " + p + " could not be removed at shutdown: " + e.getMessage()); } } } public synchronized SafePath getRepositoryPath() { return repository; } public synchronized SafePath getBaseLocation() { return baseLocation; } }
⏎ jdk/jfr/internal/Repository.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, 8940👍, 0💬
Popular Posts:
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...
How to download and install Apache XMLBeans Source Package? The source package contains Java source ...
JSP(tm) Standard Tag Library 1.1 implementation - Jakarta Taglibs hosts the Standard Taglib 1.1, an ...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...