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.jlink.jmod - JLink Tool
JDK 17 jdk.jlink.jmod is the JMOD file for JDK 17 JLink tool,
which can be invoked by the "jlink" command.
JDK 17 JLink tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jlink.jmod.
JDK 17 JLink tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JLink tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jlink.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/tools/jlink/internal/PluginRepository.java
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.tools.jlink.internal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.ServiceLoader;
import jdk.tools.jlink.plugin.Plugin;
import jdk.tools.jlink.plugin.PluginException;
/**
*
* Plugin Providers repository. Plugin Providers are
* retrieved thanks to the ServiceLoader mechanism.
*/
public final class PluginRepository {
private PluginRepository() {
}
private static final Map<String, Plugin> registeredPlugins = new HashMap<>();
/**
* Retrieves the plugin associated to the passed name. If multiple providers
* exist for the same name,
* then an exception is thrown.
* @param name The plugin provider name.
* @param pluginsLayer
* @return A provider or null if not found.
*/
public static Plugin getPlugin(String name,
ModuleLayer pluginsLayer) {
return getPlugin(Plugin.class, name, pluginsLayer);
}
/**
* Build plugin for the passed name.
*
* @param config Optional config.
* @param name Non null name.
* @param pluginsLayer
* @return A plugin or null if no plugin found.
*/
public static Plugin newPlugin(Map<String, String> config, String name,
ModuleLayer pluginsLayer) {
Objects.requireNonNull(name);
Objects.requireNonNull(pluginsLayer);
Plugin plugin = getPlugin(name, pluginsLayer);
if (plugin != null) {
try {
plugin.configure(config);
} catch (IllegalArgumentException e) {
if (JlinkTask.DEBUG) {
System.err.println("Plugin " + plugin.getName() + " threw exception with config: " + config);
e.printStackTrace();
}
throw e;
}
}
return plugin;
}
/**
* Explicit registration of a plugin in the repository. Used by unit tests
* @param plugin The plugin to register.
*/
public synchronized static void registerPlugin(Plugin plugin) {
Objects.requireNonNull(plugin);
registeredPlugins.put(plugin.getName(), plugin);
}
/**
* Explicit unregistration of a plugin in the repository. Used by unit
* tests
*
* @param name Plugin name
*/
public synchronized static void unregisterPlugin(String name) {
Objects.requireNonNull(name);
registeredPlugins.remove(name);
}
public static List<Plugin> getPlugins(ModuleLayer pluginsLayer) {
return getPlugins(Plugin.class, pluginsLayer);
}
private static <T extends Plugin> T getPlugin(Class<T> clazz, String name,
ModuleLayer pluginsLayer) {
Objects.requireNonNull(name);
Objects.requireNonNull(pluginsLayer);
T provider = null;
List<T> javaProviders = getPlugins(clazz, pluginsLayer);
for(T factory : javaProviders) {
if (factory.getName().equals(name)) {
if (provider != null) {
throw new PluginException("Multiple plugin "
+ "for the name " + name);
}
provider = factory;
}
}
return provider;
}
/**
* The plugins accessible in the current context.
*
* @param pluginsLayer
* @return The list of plugins.
*/
private static <T extends Plugin> List<T> getPlugins(Class<T> clazz, ModuleLayer pluginsLayer) {
Objects.requireNonNull(pluginsLayer);
List<T> factories = new ArrayList<>();
try {
Iterator<T> providers
= ServiceLoader.load(pluginsLayer, clazz).iterator();
while (providers.hasNext()) {
factories.add(providers.next());
}
registeredPlugins.values().stream().forEach((fact) -> {
if (clazz.isInstance(fact)) {
@SuppressWarnings("unchecked")
T trans = (T) fact;
factories.add(trans);
}
});
return factories;
} catch (Exception ex) {
throw new PluginException(ex);
}
}
}
⏎ jdk/tools/jlink/internal/PluginRepository.java
Or download all of them as a single archive file:
File name: jdk.jlink-17.0.5-src.zip File size: 164180 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jpackage.jmod - JPackage Tool
2023-08-03, ≈20🔥, 0💬
Popular Posts:
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...
JDK 17 java.xml.crypto.jmod is the JMOD file for JDK 17 XML (eXtensible Markup Language) Crypto modu...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...