@Service @Singleton public class ExtensionFileManager extends Object implements org.glassfish.hk2.api.PostConstruct
This class builds a map of extension name to an instance of the inner class Extension that records information about that extension jar. An Extension is created for every jar file in any of the directories specified by java.ext.dirs.
Later, a caller can use the findExtensionTransitiveClosure method, passing a jar file manifest's main attributes and receiving back a List of Extension objects representing all extension jars referenced directly or indirectly from that jar.
| Modifier and Type | Class and Description |
|---|---|
class |
ExtensionFileManager.Extension
Records information about an extension jar file known to the app server.
|
static class |
ExtensionFileManager.ExtensionKey
The key for identifying extension jar Extension objects in the Map.
|
| Constructor and Description |
|---|
ExtensionFileManager() |
| Modifier and Type | Method and Description |
|---|---|
Set<ExtensionFileManager.Extension> |
findExtensionTransitiveClosure(File origAnchorDir,
Attributes mainAttrs)
Constructs a List of Extension objects corresponding to jars required to
satisfy an extension chain.
|
Map<ExtensionFileManager.ExtensionKey,ExtensionFileManager.Extension> |
getExtensionFileEntries() |
void |
postConstruct() |
public static final String EXT_ERROR
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic Map<ExtensionFileManager.ExtensionKey,ExtensionFileManager.Extension> getExtensionFileEntries() throws IOException
IOExceptionpublic Set<ExtensionFileManager.Extension> findExtensionTransitiveClosure(File origAnchorDir, Attributes mainAttrs) throws IOException
The transitive closure includes any extensions required by the initial jar, its Class-Path jars, and any extensions required by extensions.
anchorDir - the directory relative to which Class-Path manifest entries are evaluated (if relative)mainAttrs - the main attributes from a jar file whose extensions are to be satisfiedIOException - in case of errors building the extension jar file data structureCopyright © 2019. All rights reserved.