Class GenericHandler

    • Field Detail

      • habitat

        @Inject
        protected org.glassfish.hk2.api.ServiceLocator habitat
    • Constructor Detail

      • GenericHandler

        public GenericHandler()
    • Method Detail

      • expand

        public void expand​(ReadableArchive source,
                           WritableArchive target,
                           DeploymentContext context)
                    throws IOException
        Prepares 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:
        expand in interface ArchiveHandler
        Parameters:
        source - of the expanding
        target - of the expanding
        context - deployment context
        Throws:
        IOException - when the archive is corrupted
      • getDefaultApplicationName

        public String getDefaultApplicationName​(ReadableArchive archive,
                                                DeploymentContext context,
                                                String originalAppName)
        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:
        getDefaultApplicationName in interface ArchiveHandler
        Parameters:
        archive - the archive for which the default name is needed
        context - deployment context
        Returns:
        the default application name for the specified archive
      • getDefaultApplicationNameFromArchiveName

        public String getDefaultApplicationNameFromArchiveName​(ReadableArchive archive)
      • getDefaultApplicationName

        public String getDefaultApplicationName​(ReadableArchive archive)
        Description copied from interface: ArchiveHandler
        Returns the default name by which the specified archive can be identified.

        The default name is used, for example, during deployment if no name was specified explicitly as part of the deployment request.

        Specified by:
        getDefaultApplicationName in interface ArchiveHandler
        Parameters:
        archive - the archive for which to provide the default name
        Returns:
        the default name for identifying the specified archive
      • getVersionIdentifier

        public String getVersionIdentifier​(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:
        getVersionIdentifier in interface ArchiveHandler
        Parameters:
        archive - the archive for which to provide the version identifier
        Returns:
        null
      • getManifest

        public Manifest getManifest​(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:
        getManifest in interface ArchiveHandler
        Parameters:
        archive - file
        Returns:
        manifest instance or null if this archive has no manifest
        Throws:
        IOException
      • requiresAnnotationScanning

        public boolean requiresAnnotationScanning​(ReadableArchive archive)
        Returns whether this archive requires annotation scanning.
        Specified by:
        requiresAnnotationScanning in interface ArchiveHandler
        Parameters:
        archive - file
        Returns:
        whether this archive requires annotation scanning