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 11 jdk.jlink.jmod - JLink Tool
JDK 11 jdk.jlink.jmod is the JMOD file for JDK 11 JLink tool,
which can be invoked by the "jlink" command.
JDK 11 JLink tool compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jlink.jmod.
JDK 11 JLink tool compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JLink tool source code files are stored in \fyicenter\jdk-11.0.1\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);
@SuppressWarnings("unchecked")
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-11.0.1-src.zip File size: 155677 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jshell.jmod - JShell Tool
2020-06-30, ≈41🔥, 0💬
Popular Posts:
What Is javaws.jar in JRE (Java Runtime Environment) 8? javaws.jar in JRE (Java Runtime Environment)...
JDK 11 java.smartcardio.jmod is the JMOD file for JDK 11 Smartcardio module. JDK 11 Smart Card IO mo...
JDK 17 jdk.internal.vm.ci.jmod is the JMOD file for JDK 17 Internal VM CI module. JDK 17 Internal VM...
Swingx is the SwingLabs Swing Component Extensions. JAR File Size and Download Location: File name: ...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...