Class ArchiveType

java.lang.Object
org.glassfish.api.deployment.archive.ArchiveType
Direct Known Subclasses:
CarArchiveType, EarArchiveType, EjbArchiveType, RarArchiveType, ScatteredWarArchiveType, WarArchiveType

@Contract @Singleton public abstract class ArchiveType extends Object
ArchiveType is an extension over ModuleType defined in jsr88 API. It is analogous to type of an archive or a module or deployment unit, whichever way you prefer to call them. Adding a new archive type (or ArchiveType) is a very expensive operation. For example, there has been no new archive types introduced in Jakarta EE since RAR type. Adding a new archive type involves writing an ArchiveHandler which involves writing logic to create class loaders. Now, that's not same as adding adding a technology type like jersey or jpa.

This is only a contract. Actual types are made available as services by appropriate containers.

GlassFish deployment framework uses the word container to refer to services. Containers are actually defined in Jakarta EE platform spec. ArchiveType maps to the way containers are defined in the Jakarta EE platform spec.

Author:
Sanjeeb Sahoo
  • Constructor Details

    • ArchiveType

      protected ArchiveType(String value, String extension)
      Parameters:
      value - value of this archive type as reported. Used for comparison and as toString()
      extension - file extension for this type of archive
    • ArchiveType

      protected ArchiveType(String value)
      Same as calling ArchiveType(String, String) with an empty string as extension.
  • Method Details

    • getExtension

      public String getExtension()
      Returns:
      the file extension string for this module type.
    • toString

      public final String toString()
      Overrides:
      toString in class Object
      Returns:
      the string equivalent of this type.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      value's hash code.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Returns:
      two types are equal just if they have the same value (toString())