Top Description Fields Constructors Methods
jdk.tools.jlink.internal.plugins

public final Class GenerateJLIClassesPlugin

extends AbstractPlugin
Class Inheritance
Imports
java.io.BufferedReader, .File, .IOException, .InputStream, .InputStreamReader, java.nio.file.Files, java.util.EnumSet, .Map, .Set, java.util.stream.Stream, jdk.internal.access.JavaLangInvokeAccess, .SharedSecrets, jdk.tools.jlink.plugin.PluginException, .ResourcePool, .ResourcePoolBuilder, .ResourcePoolEntry

Plugin to generate java.lang.invoke classes. The plugin reads in a file generated by running any application with -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true. This is done automatically during build, see make/GenerateLinkOptData.gmk. See build/tools/classlist/HelloClasslist.java for the training application. HelloClasslist tries to reflect common use of java.lang.invoke during early startup and warmup in various applications. To ensure a good default trade-off between static footprint and startup the application should be relatively conservative. When using jlink to build a custom application runtime, generating a trace file using -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true and feeding that into jlink using --generate-jli-classes=@trace_file can help improve startup time.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final JavaLangInvokeAccess
private String
private Stream<String>
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
DESCRIPTIONUSAGE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Map<String, String>
The plugin configuration.
config
)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration.
private Stream<String>
public Set<Plugin.State>
getState()

Overrides default jdk.tools.jlink.plugin.Plugin.getState.

The Plugin set of states.
public boolean
hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments?
public void
public ResourcePool
transform(ResourcePool
Read only content.
in
,
ResourcePoolBuilder
The pool to fill with content. This pool must contain the result of the visit.
out
)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
getArgumentsDescriptiongetDescriptiongetMessagegetNamegetUsagenewClassReadernewClassReader

Field Detail

BASIC_FORMS_HOLDER_ENTRYback to summary
private static final String BASIC_FORMS_HOLDER_ENTRY
DEFAULT_TRACE_FILEback to summary
private static final String DEFAULT_TRACE_FILE
DELEGATING_METHOD_HOLDER_ENTRYback to summary
private static final String DELEGATING_METHOD_HOLDER_ENTRY
DIRECT_METHOD_HOLDER_ENTRYback to summary
private static final String DIRECT_METHOD_HOLDER_ENTRY
INVOKERS_HOLDER_ENTRYback to summary
private static final String INVOKERS_HOLDER_ENTRY
JLIAback to summary
private static final JavaLangInvokeAccess JLIA
mainArgumentback to summary
private String mainArgument
traceFileStreamback to summary
private Stream<String> traceFileStream

Constructor Detail

GenerateJLIClassesPluginback to summary
public GenerateJLIClassesPlugin()

Method Detail

configureback to summary
public void configure(Map<String, String> config)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Doc from jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration. This method is called prior to invoke the plugin.

Parameters
config:Map<String, String>

The plugin configuration.

Annotations
@Override
fileLinesback to summary
private Stream<String> fileLines(File file)
getStateback to summary
public Set<Plugin.State> getState()

Overrides default jdk.tools.jlink.plugin.Plugin.getState.

Doc from jdk.tools.jlink.plugin.Plugin.getState.

The Plugin set of states.

Returns:Set<Plugin.State>

The set of states.

Annotations
@Override
hasArgumentsback to summary
public boolean hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Doc from jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments? A plugin can have one or more optional arguments.
A plugin option with a single argument is specified as follows:

     --plugin-option=arg_value
 
If there are more than arguments, command line option looks like:
     --plugin-option=arg_value:arg2=value2:arg3=value3...
Returns:boolean

true if arguments are needed.

Annotations
@Override
initializeback to summary
public void initialize(ResourcePool in)
transformback to summary
public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Doc from jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.

Parameters
in:ResourcePool

Read only content.

out:ResourcePoolBuilder

The pool to fill with content. This pool must contain the result of the visit.

Annotations
@Override