Class Module

java.lang.Object
org.eclipse.jetty.start.Module
All Implemented Interfaces:
Comparable<Module>

public class Module extends Object implements Comparable<Module>
Represents a Module metadata, as defined in Jetty.

A module consists of:

  • A set of jar files, directories and/or jar file patterns to be added to the classpath
  • A list of XML configuration files
  • Properties set either directly or via a file of properties
  • A set of modules names (or capability names) that this module depends on.
  • A set of capability names that this module provides (including it's own name).
  • Licence details for using the module
Modules are discovered in the ${jetty.home}/modules and ${jetty.home}/modules directories. A module may refer to non-discovered dynamic module in a subdirectory, using a property as part or all of the name. A module may be enabled, either directly by name or transiently via a dependency from another module by name or provided capability.
  • Field Details

    • VERSION_UNSPECIFIED

      private static final String VERSION_UNSPECIFIED
      See Also:
    • MOD_NAME

      static Pattern MOD_NAME
    • SET_PROPERTY

      static Pattern SET_PROPERTY
    • _path

      private final Path _path
      The file of the module
    • _name

      private final String _name
      The name of the module
    • _dynamic

      private final boolean _dynamic
      Is the module dynamic - ie referenced rather than discovered
    • version

      private Version version
      The version of Jetty the module supports
    • _description

      private final List<String> _description
      The module description
    • _xmls

      private final List<String> _xmls
      List of xml configurations for this Module
    • _iniTemplate

      private final List<String> _iniTemplate
      List of ini template lines
    • _defaultConfig

      private final List<String> _defaultConfig
      List of default config
    • _libs

      private final List<String> _libs
      List of library options for this Module
    • _jpms

      private final List<String> _jpms
      List of JPMS options for this Module
    • _files

      private final List<String> _files
      List of files for this Module
    • _enables

      private final Set<String> _enables
      List of selections for this Module
    • _provides

      private final Set<String> _provides
      List of provides for this Module
    • _tags

      private final List<String> _tags
      List of tags for this Module
    • _notTransitive

      private boolean _notTransitive
      Boolean true if directly enabled, false if all selections are transitive
    • _skipFilesValidation

      private boolean _skipFilesValidation
      Skip File Validation (default: false)
    • _jvmArgs

      private final List<String> _jvmArgs
      List of jvm Args
    • _license

      private final List<String> _license
      License lines
    • _depends

      private final List<String> _depends
      Dependencies from [depends] section
    • _optional

      private final Set<String> _optional
      Optional dependencies from [optional] section are structural in nature.
  • Constructor Details

  • Method Details

    • isConditionalDependency

      public static boolean isConditionalDependency(String depends)
    • normalizeModuleName

      public static String normalizeModuleName(String name)
    • getName

      public String getName()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • expandDependencies

      public void expandDependencies(Props props)
    • getDefaultConfig

      public List<String> getDefaultConfig()
    • getIniTemplate

      public List<String> getIniTemplate()
    • getFiles

      public List<String> getFiles()
    • isSkipFilesValidation

      public boolean isSkipFilesValidation()
    • getJvmArgs

      public List<String> getJvmArgs()
    • getLibs

      public List<String> getLibs()
    • getLicense

      public List<String> getLicense()
    • getXmls

      public List<String> getXmls()
    • getJPMS

      public List<String> getJPMS()
    • getVersion

      public Version getVersion()
    • hasDefaultConfig

      public boolean hasDefaultConfig()
    • hasIniTemplate

      public boolean hasIniTemplate()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hasLicense

      public boolean hasLicense()
    • isDynamic

      public boolean isDynamic()
      Indicates a module that is dynamic in nature
      Returns:
      a module where the name is not in the top level of the modules directory
    • hasFiles

      public boolean hasFiles(BaseHome baseHome, Props props)
    • process

      public void process(BaseHome basehome) throws IOException
      Throws:
      IOException
    • clearTransitiveEnable

      public boolean clearTransitiveEnable()
    • setSkipFilesValidation

      public void setSkipFilesValidation(boolean skipFilesValidation)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDepends

      public List<String> getDepends()
    • getProvides

      public Set<String> getProvides()
    • getOptional

      public Set<String> getOptional()
    • getDescription

      public List<String> getDescription()
    • getTags

      public List<String> getTags()
    • getPrimaryTag

      public String getPrimaryTag()
    • isEnabled

      public boolean isEnabled()
    • getEnableSources

      public Set<String> getEnableSources()
    • enable

      public boolean enable(String source, boolean transitive)
      Parameters:
      source - String describing where the module was enabled from
      transitive - True if the enable is transitive
      Returns:
      true if the module was not previously enabled
    • isTransitive

      public boolean isTransitive()
    • writeIniSection

      public void writeIniSection(BufferedWriter writer, Props props)
    • compareTo

      public int compareTo(Module m)
      Specified by:
      compareTo in interface Comparable<Module>