public abstract class GenericHandler extends Object implements ArchiveHandler
Modifier and Type | Field and Description |
---|---|
protected org.glassfish.hk2.api.ServiceLocator |
habitat |
Constructor and Description |
---|
GenericHandler() |
Modifier and Type | Method and Description |
---|---|
void |
expand(ReadableArchive source,
WritableArchive target,
DeploymentContext context)
Prepares the jar file to a format the ApplicationContainer is
expecting.
|
List<URI> |
getClassPathURIs(ReadableArchive archive)
Returns the classpath URIs for this archive.
|
String |
getDefaultApplicationName(ReadableArchive archive)
Returns the default name by which the specified archive can be
identified.
|
String |
getDefaultApplicationName(ReadableArchive archive,
DeploymentContext context) |
String |
getDefaultApplicationName(ReadableArchive archive,
DeploymentContext context,
String originalAppName)
Returns the default application name usable for identifying the archive.
|
String |
getDefaultApplicationNameFromArchiveName(ReadableArchive archive) |
Manifest |
getManifest(ReadableArchive archive)
Returns the manifest file for this archive, this file is usually located at
the META-INF/MANIFEST location, however, certain archive type can change this
default location or use another mean of expressing manifest information.
|
String |
getVersionIdentifier(ReadableArchive archive)
Returns the default value for versionIdentifier.
|
boolean |
requiresAnnotationScanning(ReadableArchive archive)
Returns whether this archive requires annotation scanning.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArchiveType, getClassLoader, handles
public void expand(ReadableArchive source, WritableArchive target, DeploymentContext context) throws IOException
expand
in interface ArchiveHandler
source
- of the expandingtarget
- of the expandingcontext
- deployment contextIOException
- when the archive is corruptedpublic String getDefaultApplicationName(ReadableArchive archive, DeploymentContext context)
getDefaultApplicationName
in interface ArchiveHandler
public String getDefaultApplicationName(ReadableArchive archive, DeploymentContext context, String originalAppName)
This default implementation returns the name portion of the archive's URI. The archive's name depends on the type of archive (FileArchive vs. JarArchive vs. MemoryMappedArchive, for example).
A concrete subclass can override this method to provide an alternative way of deriving the default application name.
getDefaultApplicationName
in interface ArchiveHandler
archive
- the archive for which the default name is neededcontext
- deployment contextpublic String getDefaultApplicationNameFromArchiveName(ReadableArchive archive)
public String getDefaultApplicationName(ReadableArchive archive)
ArchiveHandler
The default name is used, for example, during deployment if no name was specified explicitly as part of the deployment request.
getDefaultApplicationName
in interface ArchiveHandler
archive
- the archive for which to provide the default namepublic String getVersionIdentifier(ReadableArchive archive)
getVersionIdentifier
in interface ArchiveHandler
archive
- the archive for which to provide the version identifierpublic Manifest getManifest(ReadableArchive archive) throws IOException
getManifest
in interface ArchiveHandler
archive
- fileIOException
public List<URI> getClassPathURIs(ReadableArchive archive)
getClassPathURIs
in interface ArchiveHandler
archive
- filepublic boolean requiresAnnotationScanning(ReadableArchive archive)
requiresAnnotationScanning
in interface ArchiveHandler
archive
- fileCopyright © 2020. All rights reserved.