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

public Class ResourcePoolManager

extends Object
Class Inheritance
Known Direct Subclasses
jdk.tools.jlink.internal.ImagePluginStack.OrderedResourcePoolManager, jdk.tools.jlink.internal.ImagePluginStack.CheckOrderResourcePoolManager, jdk.tools.jlink.internal.ImagePluginStack.LastPoolManager
Imports
java.lang.module.ModuleDescriptor, java.nio.ByteBuffer, .ByteOrder, java.util.HashSet, .LinkedHashMap, .Map, .Objects, .Optional, .Set, java.util.stream.Stream, jdk.internal.jimage.decompressor.CompressedResourceHeader, jdk.internal.module.Checks, .ModuleInfo, .ModuleInfo.Attributes, .ModuleTarget, jdk.tools.jlink.plugin.ResourcePool, .ResourcePoolBuilder, .ResourcePoolEntry, .ResourcePoolModule, .ResourcePoolModuleView, .PluginException

A manager for pool of resources.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ResourcePoolManager.CompressedModuleData

A resource that has been compressed.

pack-priv class
public class
pack-priv static class
pack-priv class

Field Summary

Modifier and TypeField and Description
private final Map<String, ResourcePoolModule>
private final ResourcePoolModuleView
private final ByteOrder
private final ResourcePoolBuilder
private final ResourcePool
private final Map<String, ResourcePoolEntry>
private final StringTable

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
add(ResourcePoolEntry
The ResourcePoolEntry to add.
data
)

Add a ResourcePoolEntry.

public ByteOrder

Returns:

The ByteOrder.
byteOrder
()

The ByteOrder currently in use when generating the jimage file.

public boolean

Returns:

The module data or null if not found.
contains
(ResourcePoolEntry
The module data to check existence for.
data
)

Check if the ResourcePool contains the given ResourcePoolEntry.

public Stream<ResourcePoolEntry>

Returns:

The stream of ResourcePoolModuleEntries.
entries
()

Get all ResourcePoolEntry contained in this ResourcePool instance.

public int

Returns:

the entry count.
entryCount
()

Return the number of ResourcePoolEntry count in this ResourcePool.

public Optional<ResourcePoolEntry>

Returns:

A ResourcePoolEntry instance or null if the data is not found
findEntry
(String
A data path
path
)

Get the ResourcePoolEntry for the passed path.

public Optional<ResourcePoolEntry>

Returns:

A ResourcePoolEntry instance or null if the data is not found
findEntryInContext
(String
A data path
path
,
ResourcePoolEntry
A context of the search
context
)

Get the ResourcePoolEntry for the passed path restricted to supplied context.

public Optional<ResourcePoolModule>

Returns:

the module of matching name, if found
findModule
(String
The module name
name
)

Retrieves the module for the provided name.

public StringTable
public boolean

Returns:

True, no content, false otherwise.
isEmpty
()

Check if the ResourcePool contains some content at all.

public int

Returns:

the module count.
moduleCount
()

Return the number of ResourcePoolModule count in this ResourcePool.

public Stream<ResourcePoolModule>

Returns:

The stream of modules.
modules
()

The stream of modules contained in this ResourcePool.

public ResourcePoolModuleView
public static ResourcePoolManager.CompressedModuleData
newCompressedResource(ResourcePoolEntry original, ByteBuffer compressed, String plugin, StringTable strings, ByteOrder order)

pack-priv static ModuleInfo.Attributes
public ResourcePool
public ResourcePoolBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

modulesback to summary
private final Map<String, ResourcePoolModule> modules
moduleViewImplback to summary
private final ResourcePoolModuleView moduleViewImpl
orderback to summary
private final ByteOrder order
poolBuilderImplback to summary
private final ResourcePoolBuilder poolBuilderImpl
poolImplback to summary
private final ResourcePool poolImpl
resourcesback to summary
private final Map<String, ResourcePoolEntry> resources
tableback to summary
private final StringTable table

Constructor Detail

ResourcePoolManagerback to summary
public ResourcePoolManager()
ResourcePoolManagerback to summary
public ResourcePoolManager(ByteOrder order)
ResourcePoolManagerback to summary
public ResourcePoolManager(ByteOrder order, StringTable table)

Method Detail

addback to summary
public void add(ResourcePoolEntry data)

Add a ResourcePoolEntry.

Parameters
data:ResourcePoolEntry

The ResourcePoolEntry to add.

byteOrderback to summary
public ByteOrder byteOrder()

The ByteOrder currently in use when generating the jimage file.

Returns:ByteOrder

The ByteOrder.

containsback to summary
public boolean contains(ResourcePoolEntry data)

Check if the ResourcePool contains the given ResourcePoolEntry.

Parameters
data:ResourcePoolEntry

The module data to check existence for.

Returns:boolean

The module data or null if not found.

entriesback to summary
public Stream<ResourcePoolEntry> entries()

Get all ResourcePoolEntry contained in this ResourcePool instance.

Returns:Stream<ResourcePoolEntry>

The stream of ResourcePoolModuleEntries.

entryCountback to summary
public int entryCount()

Return the number of ResourcePoolEntry count in this ResourcePool.

Returns:int

the entry count.

findEntryback to summary
public Optional<ResourcePoolEntry> findEntry(String path)

Get the ResourcePoolEntry for the passed path.

Parameters
path:String

A data path

Returns:Optional<ResourcePoolEntry>

A ResourcePoolEntry instance or null if the data is not found

findEntryInContextback to summary
public Optional<ResourcePoolEntry> findEntryInContext(String path, ResourcePoolEntry context)

Get the ResourcePoolEntry for the passed path restricted to supplied context.

Parameters
path:String

A data path

context:ResourcePoolEntry

A context of the search

Returns:Optional<ResourcePoolEntry>

A ResourcePoolEntry instance or null if the data is not found

findModuleback to summary
public Optional<ResourcePoolModule> findModule(String name)

Retrieves the module for the provided name.

Parameters
name:String

The module name

Returns:Optional<ResourcePoolModule>

the module of matching name, if found

getStringTableback to summary
public StringTable getStringTable()
isEmptyback to summary
public boolean isEmpty()

Check if the ResourcePool contains some content at all.

Returns:boolean

True, no content, false otherwise.

moduleCountback to summary
public int moduleCount()

Return the number of ResourcePoolModule count in this ResourcePool.

Returns:int

the module count.

modulesback to summary
public Stream<ResourcePoolModule> modules()

The stream of modules contained in this ResourcePool.

Returns:Stream<ResourcePoolModule>

The stream of modules.

moduleViewback to summary
public ResourcePoolModuleView moduleView()
newCompressedResourceback to summary
public static ResourcePoolManager.CompressedModuleData newCompressedResource(ResourcePoolEntry original, ByteBuffer compressed, String plugin, StringTable strings, ByteOrder order)
readModuleAttributesback to summary
pack-priv static ModuleInfo.Attributes readModuleAttributes(ResourcePoolModule mod)
resourcePoolback to summary
public ResourcePool resourcePool()
resourcePoolBuilderback to summary
public ResourcePoolBuilder resourcePoolBuilder()
jdk.tools.jlink.internal back to summary

public final Class ResourcePoolManager.CompressedModuleData

extends ByteArrayResourcePoolEntry
Class Inheritance

A resource that has been compressed.

Field Summary

Modifier and TypeField and Description
pack-priv final long

Constructor Summary

AccessConstructor and Description
private
CompressedModuleData(String module, String path, byte[] content, long uncompressed_size)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object other)

Overrides jdk.tools.jlink.internal.AbstractResourcePoolEntry.equals.

Indicates whether some other object is "equal to" this one.

public long
public int
hashCode()

Overrides jdk.tools.jlink.internal.AbstractResourcePoolEntry.hashCode.

Returns a hash code value for this object.

Inherited from jdk.tools.jlink.internal.ByteArrayResourcePoolEntry:
contentcontentBytescontentLengthwrite

Field Detail

uncompressed_sizeback to summary
pack-priv final long uncompressed_size

Constructor Detail

CompressedModuleDataback to summary
private CompressedModuleData(String module, String path, byte[] content, long uncompressed_size)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides jdk.tools.jlink.internal.AbstractResourcePoolEntry.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
getUncompressedSizeback to summary
public long getUncompressedSize()
hashCodeback to summary
public int hashCode()

Overrides jdk.tools.jlink.internal.AbstractResourcePoolEntry.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
jdk.tools.jlink.internal back to summary

pack-priv Class ResourcePoolManager.ResourcePoolBuilderImpl

extends Object
implements ResourcePoolBuilder
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.ResourcePoolManager.ResourcePoolBuilderImpl
All Implemented Interfaces
jdk.tools.jlink.plugin.ResourcePoolBuilder

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
add(ResourcePoolEntry data)

Implements jdk.tools.jlink.plugin.ResourcePoolBuilder.add.

Add a ResourcePoolEntry.

public ResourcePool
build()

Implements jdk.tools.jlink.plugin.ResourcePoolBuilder.build.

Done with adding resource entries.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builtback to summary
private boolean built

Constructor Detail

ResourcePoolBuilderImplback to summary
pack-priv ResourcePoolBuilderImpl()

Method Detail

addback to summary
public void add(ResourcePoolEntry data)

Implements jdk.tools.jlink.plugin.ResourcePoolBuilder.add.

Doc from jdk.tools.jlink.plugin.ResourcePoolBuilder.add.

Add a ResourcePoolEntry.

Annotations
@Override
buildback to summary
public ResourcePool build()

Implements jdk.tools.jlink.plugin.ResourcePoolBuilder.build.

Doc from jdk.tools.jlink.plugin.ResourcePoolBuilder.build.

Done with adding resource entries. Construct a ResourcePool with the added resource entries.

Annotations
@Override
jdk.tools.jlink.internal back to summary

public Class ResourcePoolManager.ResourcePoolImpl

extends Object
implements ResourcePool
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.ResourcePoolManager.ResourcePoolImpl
All Implemented Interfaces
jdk.tools.jlink.plugin.ResourcePool
Known Direct Subclasses
jdk.tools.jlink.internal.ImagePluginStack.OrderedResourcePoolManager.OrderedResourcePool

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ByteOrder
byteOrder()

Implements jdk.tools.jlink.plugin.ResourcePool.byteOrder.

The ByteOrder currently in use when generating the jimage file.

public boolean
contains(ResourcePoolEntry data)

Implements jdk.tools.jlink.plugin.ResourcePool.contains.

Check if the ResourcePool contains the given ResourcePoolEntry.

public Stream<ResourcePoolEntry>
entries()

Implements jdk.tools.jlink.plugin.ResourcePool.entries.

Get all ResourcePoolEntry contained in this ResourcePool instance.

public int
entryCount()

Implements jdk.tools.jlink.plugin.ResourcePool.entryCount.

Return the number of ResourcePoolEntry count in this ResourcePool.

public Optional<ResourcePoolEntry>
findEntry(String path)

Implements jdk.tools.jlink.plugin.ResourcePool.findEntry.

Get the ResourcePoolEntry for the passed path.

public Optional<ResourcePoolEntry>
findEntryInContext(String path, ResourcePoolEntry context)

Implements jdk.tools.jlink.plugin.ResourcePool.findEntryInContext.

Get the ModuleEntry for the passed path restricted to supplied context.

public StringTable
public boolean
isEmpty()

Implements jdk.tools.jlink.plugin.ResourcePool.isEmpty.

Check if the ResourcePool contains some content at all.

public ResourcePoolModuleView
moduleView()

Implements jdk.tools.jlink.plugin.ResourcePool.moduleView.

Return the module view of this resource pool.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ResourcePoolImplback to summary
public ResourcePoolImpl()

Method Detail

byteOrderback to summary
public ByteOrder byteOrder()

Implements jdk.tools.jlink.plugin.ResourcePool.byteOrder.

Doc from jdk.tools.jlink.plugin.ResourcePool.byteOrder.

The ByteOrder currently in use when generating the jimage file.

Annotations
@Override
containsback to summary
public boolean contains(ResourcePoolEntry data)

Implements jdk.tools.jlink.plugin.ResourcePool.contains.

Doc from jdk.tools.jlink.plugin.ResourcePool.contains.

Check if the ResourcePool contains the given ResourcePoolEntry.

Annotations
@Override
entriesback to summary
public Stream<ResourcePoolEntry> entries()

Implements jdk.tools.jlink.plugin.ResourcePool.entries.

Doc from jdk.tools.jlink.plugin.ResourcePool.entries.

Get all ResourcePoolEntry contained in this ResourcePool instance.

Annotations
@Override
entryCountback to summary
public int entryCount()

Implements jdk.tools.jlink.plugin.ResourcePool.entryCount.

Doc from jdk.tools.jlink.plugin.ResourcePool.entryCount.

Return the number of ResourcePoolEntry count in this ResourcePool.

Annotations
@Override
findEntryback to summary
public Optional<ResourcePoolEntry> findEntry(String path)

Implements jdk.tools.jlink.plugin.ResourcePool.findEntry.

Doc from jdk.tools.jlink.plugin.ResourcePool.findEntry.

Get the ResourcePoolEntry for the passed path.

Annotations
@Override
findEntryInContextback to summary
public Optional<ResourcePoolEntry> findEntryInContext(String path, ResourcePoolEntry context)

Implements jdk.tools.jlink.plugin.ResourcePool.findEntryInContext.

Doc from jdk.tools.jlink.plugin.ResourcePool.findEntryInContext.

Get the ModuleEntry for the passed path restricted to supplied context.

Annotations
@Override
getStringTableback to summary
public StringTable getStringTable()
isEmptyback to summary
public boolean isEmpty()

Implements jdk.tools.jlink.plugin.ResourcePool.isEmpty.

Doc from jdk.tools.jlink.plugin.ResourcePool.isEmpty.

Check if the ResourcePool contains some content at all.

Annotations
@Override
moduleViewback to summary
public ResourcePoolModuleView moduleView()

Implements jdk.tools.jlink.plugin.ResourcePool.moduleView.

Doc from jdk.tools.jlink.plugin.ResourcePool.moduleView.

Return the module view of this resource pool.

Annotations
@Override
jdk.tools.jlink.internal back to summary

pack-priv Class ResourcePoolManager.ResourcePoolModuleImpl

extends Object
implements ResourcePoolModule
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.ResourcePoolManager.ResourcePoolModuleImpl
All Implemented Interfaces
jdk.tools.jlink.plugin.ResourcePoolModule

Field Summary

Modifier and TypeField and Description
private ModuleDescriptor
pack-priv final Map<String, ResourcePoolEntry>
pack-priv final String
private static final String
private ModuleTarget

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ModuleDescriptor
descriptor()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.descriptor.

The module descriptor of this module.

public Stream<ResourcePoolEntry>
entries()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.entries.

Retrieves the stream of ResourcePoolEntry.

public int
entryCount()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.entryCount.

Return the number of ResourcePoolEntry count in this ResourcePoolModule.

public Optional<ResourcePoolEntry>
findEntry(String path)

Implements jdk.tools.jlink.plugin.ResourcePoolModule.findEntry.

Retrieves a ResourcePoolEntry from the given path (e.g: /mymodule/com.foo.bar/MyClass.class)

private static Optional<String>

Returns:

the inferred package name, or empty if no name could be inferred.
inferPackageName
(ResourcePoolEntry res)

Returns a valid non-empty package name, inferred from a resource pool entry's path.

private void
public String
public Set<String>
packages()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.packages.

Retrieves all the packages located in this module.

public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

descriptorback to summary
private ModuleDescriptor descriptor
moduleContentback to summary
pack-priv final Map<String, ResourcePoolEntry> moduleContent
nameback to summary
pack-priv final String name
PREVIEW_PREFIXback to summary
private static final String PREVIEW_PREFIX
targetback to summary
private ModuleTarget target

Constructor Detail

ResourcePoolModuleImplback to summary
private ResourcePoolModuleImpl(String name)

Method Detail

descriptorback to summary
public ModuleDescriptor descriptor()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.descriptor.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.descriptor.

The module descriptor of this module.

Annotations
@Override
entriesback to summary
public Stream<ResourcePoolEntry> entries()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.entries.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.entries.

Retrieves the stream of ResourcePoolEntry.

Annotations
@Override
entryCountback to summary
public int entryCount()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.entryCount.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.entryCount.

Return the number of ResourcePoolEntry count in this ResourcePoolModule.

Annotations
@Override
findEntryback to summary
public Optional<ResourcePoolEntry> findEntry(String path)

Implements jdk.tools.jlink.plugin.ResourcePoolModule.findEntry.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.findEntry.

Retrieves a ResourcePoolEntry from the given path (e.g: /mymodule/com.foo.bar/MyClass.class)

Annotations
@Override
inferPackageNameback to summary
private static Optional<String> inferPackageName(ResourcePoolEntry res)

Returns a valid non-empty package name, inferred from a resource pool entry's path.

If the resource pool entry is for a preview resource (i.e. with path "/mod-name/META-INF/preview/pkg-path/resource-name") the package name is the non-preview name based on "pkg-path".

Returns:Optional<String>

the inferred package name, or empty if no name could be inferred.

initModuleAttributesback to summary
private void initModuleAttributes()
nameback to summary
public String name()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.name.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.name.

The module name.

Annotations
@Override
packagesback to summary
public Set<String> packages()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.packages.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.packages.

Retrieves all the packages located in this module.

Annotations
@Override
targetPlatformback to summary
public String targetPlatform()

Implements jdk.tools.jlink.plugin.ResourcePoolModule.targetPlatform.

Doc from jdk.tools.jlink.plugin.ResourcePoolModule.targetPlatform.

The target platform

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
jdk.tools.jlink.internal back to summary

pack-priv Class ResourcePoolManager.ResourcePoolModuleViewImpl

extends Object
implements ResourcePoolModuleView
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.ResourcePoolManager.ResourcePoolModuleViewImpl
All Implemented Interfaces
jdk.tools.jlink.plugin.ResourcePoolModuleView

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Optional<ResourcePoolModule>
findModule(String name)

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.findModule.

Find the module, if any, of the given name.

public int
moduleCount()

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.moduleCount.

Return the number of ResourcePoolModule count in this ResourcePool.

public Stream<ResourcePoolModule>
modules()

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.modules.

The stream of modules contained in this ResourcePool.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ResourcePoolModuleViewImplback to summary
pack-priv ResourcePoolModuleViewImpl()

Method Detail

findModuleback to summary
public Optional<ResourcePoolModule> findModule(String name)

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.findModule.

Doc from jdk.tools.jlink.plugin.ResourcePoolModuleView.findModule.

Find the module, if any, of the given name.

Annotations
@Override
moduleCountback to summary
public int moduleCount()

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.moduleCount.

Doc from jdk.tools.jlink.plugin.ResourcePoolModuleView.moduleCount.

Return the number of ResourcePoolModule count in this ResourcePool.

Annotations
@Override
modulesback to summary
public Stream<ResourcePoolModule> modules()

Implements jdk.tools.jlink.plugin.ResourcePoolModuleView.modules.

Doc from jdk.tools.jlink.plugin.ResourcePoolModuleView.modules.

The stream of modules contained in this ResourcePool.

Annotations
@Override