APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.tools.jlink.internal

public final Class PluginRepository

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .Iterator, .List, .Map, .Objects, .ServiceLoader, jdk.tools.jlink.plugin.Plugin, .PluginException

Plugin Providers repository. Plugin Providers are retrieved thanks to the ServiceLoader mechanism.

Field Summary

Modifier and TypeField and Description
private static final Map<String, Plugin>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Plugin

Returns:

A provider or null if not found.
getPlugin
(String
The plugin provider name.
name
,
ModuleLayer pluginsLayer)

Retrieves the plugin associated to the passed name.

private static <T extends Plugin> T
getPlugin(Class<T> clazz, String name, ModuleLayer pluginsLayer)

public static List<Plugin>
getPlugins(ModuleLayer pluginsLayer)

private static <T extends Plugin> List<T>

Returns:

The list of plugins.
getPlugins
(Class<T> clazz, ModuleLayer pluginsLayer)

The plugins accessible in the current context.

public static Plugin

Returns:

A plugin or null if no plugin found.
newPlugin
(Map<String, String>
Optional config.
config
,
String
Non null name.
name
,
ModuleLayer pluginsLayer)

Build plugin for the passed name.

public static synchronized void
registerPlugin(Plugin
The plugin to register.
plugin
)

Explicit registration of a plugin in the repository.

public static synchronized void
unregisterPlugin(String
Plugin name
name
)

Explicit unregistration of a plugin in the repository.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

registeredPluginsback to summary
private static final Map<String, Plugin> registeredPlugins

Constructor Detail

PluginRepositoryback to summary
private PluginRepository()

Method Detail

getPluginback to summary
public static Plugin getPlugin(String name, ModuleLayer pluginsLayer)

Retrieves the plugin associated to the passed name. If multiple providers exist for the same name, then an exception is thrown.

Parameters
name:String

The plugin provider name.

Returns:Plugin

A provider or null if not found.

getPluginback to summary
private static <T extends Plugin> T getPlugin(Class<T> clazz, String name, ModuleLayer pluginsLayer)
getPluginsback to summary
public static List<Plugin> getPlugins(ModuleLayer pluginsLayer)
getPluginsback to summary
private static <T extends Plugin> List<T> getPlugins(Class<T> clazz, ModuleLayer pluginsLayer)

The plugins accessible in the current context.

Returns:List<T>

The list of plugins.

newPluginback to summary
public static Plugin newPlugin(Map<String, String> config, String name, ModuleLayer pluginsLayer)

Build plugin for the passed name.

Parameters
config:Map<String, String>

Optional config.

name:String

Non null name.

Returns:Plugin

A plugin or null if no plugin found.

registerPluginback to summary
public static synchronized void registerPlugin(Plugin plugin)

Explicit registration of a plugin in the repository. Used by unit tests

Parameters
plugin:Plugin

The plugin to register.

unregisterPluginback to summary
public static synchronized void unregisterPlugin(String name)

Explicit unregistration of a plugin in the repository. Used by unit tests

Parameters
name:String

Plugin name