Class GenericHandler
- java.lang.Object
-
- org.glassfish.internal.deployment.GenericHandler
-
- All Implemented Interfaces:
org.glassfish.api.deployment.archive.ArchiveHandler
public abstract class GenericHandler extends Object implements org.glassfish.api.deployment.archive.ArchiveHandler
Pretty generic implementation of some ArchiveHandler methods- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description protected org.glassfish.hk2.api.ServiceLocatorhabitat
-
Constructor Summary
Constructors Constructor Description GenericHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexpand(org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.archive.WritableArchive target, org.glassfish.api.deployment.DeploymentContext context)Prepares the jar file to a format the ApplicationContainer is expecting.List<URI>getClassPathURIs(org.glassfish.api.deployment.archive.ReadableArchive archive)Returns the classpath URIs for this archive.StringgetDefaultApplicationName(org.glassfish.api.deployment.archive.ReadableArchive archive)StringgetDefaultApplicationName(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.DeploymentContext context)Returns the default application name usable for identifying the archive.StringgetDefaultApplicationNameFromArchiveName(org.glassfish.api.deployment.archive.ReadableArchive archive)ManifestgetManifest(org.glassfish.api.deployment.archive.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.StringgetVersionIdentifier(org.glassfish.api.deployment.archive.ReadableArchive archive)Returns the default value for versionIdentifier.booleanrequiresAnnotationScanning(org.glassfish.api.deployment.archive.ReadableArchive archive)Returns whether this archive requires annotation scanning.
-
-
-
Method Detail
-
expand
public void expand(org.glassfish.api.deployment.archive.ReadableArchive source, org.glassfish.api.deployment.archive.WritableArchive target, org.glassfish.api.deployment.DeploymentContext context) throws IOExceptionPrepares the jar file to a format the ApplicationContainer is expecting. This could be just a pure unzipping of the jar or nothing at all.- Specified by:
expandin interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Parameters:
source- of the expandingtarget- of the expandingcontext- deployment context- Throws:
IOException- when the archive is corrupted
-
getDefaultApplicationName
public String getDefaultApplicationName(org.glassfish.api.deployment.archive.ReadableArchive archive, org.glassfish.api.deployment.DeploymentContext context)
Returns the default application name usable for identifying the archive.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.
- Specified by:
getDefaultApplicationNamein interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Parameters:
archive- the archive for which the default name is neededcontext- deployment context- Returns:
- the default application name for the specified archive
-
getDefaultApplicationNameFromArchiveName
public String getDefaultApplicationNameFromArchiveName(org.glassfish.api.deployment.archive.ReadableArchive archive)
-
getDefaultApplicationName
public String getDefaultApplicationName(org.glassfish.api.deployment.archive.ReadableArchive archive)
- Specified by:
getDefaultApplicationNamein interfaceorg.glassfish.api.deployment.archive.ArchiveHandler
-
getVersionIdentifier
public String getVersionIdentifier(org.glassfish.api.deployment.archive.ReadableArchive archive)
Returns the default value for versionIdentifier. This allows us to override the method only where thhe version-identifier element is supported.- Specified by:
getVersionIdentifierin interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Returns:
- null
-
getManifest
public Manifest getManifest(org.glassfish.api.deployment.archive.ReadableArchive archive) throws IOException
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.- Specified by:
getManifestin interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Parameters:
archive- file- Returns:
- manifest instance or null if this archive has no manifest
- Throws:
IOException
-
getClassPathURIs
public List<URI> getClassPathURIs(org.glassfish.api.deployment.archive.ReadableArchive archive)
Returns the classpath URIs for this archive.- Specified by:
getClassPathURIsin interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Parameters:
archive- file- Returns:
- classpath URIs for this archive
-
requiresAnnotationScanning
public boolean requiresAnnotationScanning(org.glassfish.api.deployment.archive.ReadableArchive archive)
Returns whether this archive requires annotation scanning.- Specified by:
requiresAnnotationScanningin interfaceorg.glassfish.api.deployment.archive.ArchiveHandler- Parameters:
archive- file- Returns:
- whether this archive requires annotation scanning
-
-