Package org.eclipse.jetty.start
Class Module
- java.lang.Object
-
- org.eclipse.jetty.start.Module
-
- All Implemented Interfaces:
java.lang.Comparable<Module>
public class Module extends java.lang.Object implements java.lang.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
${jetty.home}/modulesand${jetty.home}/modulesdirectories. 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 Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>_defaultConfigList of default configprivate java.util.List<java.lang.String>_dependsDependencies from[depends]sectionprivate java.util.List<java.lang.String>_descriptionThe module descriptionprivate boolean_dynamicIs the module dynamic - ie referenced rather than discoveredprivate java.util.Set<java.lang.String>_enablesList of selections for this Moduleprivate java.util.List<java.lang.String>_filesList of files for this Moduleprivate java.util.List<java.lang.String>_iniTemplateList of ini template linesprivate java.util.List<java.lang.String>_jpmsList of JPMS options for this Moduleprivate java.util.List<java.lang.String>_jvmArgsList of jvm Argsprivate java.util.List<java.lang.String>_libsList of library options for this Moduleprivate java.util.List<java.lang.String>_licenseLicense linesprivate java.lang.String_nameThe name of the moduleprivate boolean_notTransitiveBoolean true if directly enabled, false if all selections are transitiveprivate java.util.Set<java.lang.String>_optionalOptional dependencies from[optional]section are structural in nature.private java.nio.file.Path_pathThe file of the moduleprivate java.util.Set<java.lang.String>_providesList of provides for this Moduleprivate boolean_skipFilesValidationSkip File Validation (default: false)private java.util.List<java.lang.String>_tagsList of tags for this Moduleprivate java.util.List<java.lang.String>_xmlsList of xml configurations for this Module(package private) static java.util.regex.PatternMOD_NAME(package private) static java.util.regex.PatternSET_PROPERTYprivate VersionversionThe version of Jetty the module supportsprivate static java.lang.StringVERSION_UNSPECIFIED
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearTransitiveEnable()intcompareTo(Module m)booleanenable(java.lang.String source, boolean transitive)booleanequals(java.lang.Object obj)voidexpandDependencies(Props props)java.util.List<java.lang.String>getDefaultConfig()java.util.List<java.lang.String>getDepends()java.util.List<java.lang.String>getDescription()java.util.Set<java.lang.String>getEnableSources()java.util.List<java.lang.String>getFiles()java.util.List<java.lang.String>getIniTemplate()java.util.List<java.lang.String>getJPMS()java.util.List<java.lang.String>getJvmArgs()java.util.List<java.lang.String>getLibs()java.util.List<java.lang.String>getLicense()java.lang.StringgetName()java.util.Set<java.lang.String>getOptional()java.lang.StringgetPrimaryTag()java.util.Set<java.lang.String>getProvides()java.util.List<java.lang.String>getTags()VersiongetVersion()java.util.List<java.lang.String>getXmls()booleanhasDefaultConfig()booleanhasFiles(BaseHome baseHome, Props props)inthashCode()booleanhasIniTemplate()booleanhasLicense()static booleanisConditionalDependency(java.lang.String depends)booleanisDynamic()Indicates a module that is dynamic in naturebooleanisEnabled()booleanisSkipFilesValidation()booleanisTransitive()static java.lang.StringnormalizeModuleName(java.lang.String name)voidprocess(BaseHome basehome)voidsetSkipFilesValidation(boolean skipFilesValidation)java.lang.StringtoString()voidwriteIniSection(java.io.BufferedWriter writer, Props props)
-
-
-
Field Detail
-
VERSION_UNSPECIFIED
private static final java.lang.String VERSION_UNSPECIFIED
- See Also:
- Constant Field Values
-
MOD_NAME
static java.util.regex.Pattern MOD_NAME
-
SET_PROPERTY
static java.util.regex.Pattern SET_PROPERTY
-
_path
private final java.nio.file.Path _path
The file of the module
-
_name
private final java.lang.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 java.util.List<java.lang.String> _description
The module description
-
_xmls
private final java.util.List<java.lang.String> _xmls
List of xml configurations for this Module
-
_iniTemplate
private final java.util.List<java.lang.String> _iniTemplate
List of ini template lines
-
_defaultConfig
private final java.util.List<java.lang.String> _defaultConfig
List of default config
-
_libs
private final java.util.List<java.lang.String> _libs
List of library options for this Module
-
_jpms
private final java.util.List<java.lang.String> _jpms
List of JPMS options for this Module
-
_files
private final java.util.List<java.lang.String> _files
List of files for this Module
-
_enables
private final java.util.Set<java.lang.String> _enables
List of selections for this Module
-
_provides
private final java.util.Set<java.lang.String> _provides
List of provides for this Module
-
_tags
private final java.util.List<java.lang.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 java.util.List<java.lang.String> _jvmArgs
List of jvm Args
-
_license
private final java.util.List<java.lang.String> _license
License lines
-
_depends
private final java.util.List<java.lang.String> _depends
Dependencies from[depends]section
-
_optional
private final java.util.Set<java.lang.String> _optional
Optional dependencies from[optional]section are structural in nature.
-
-
Constructor Detail
-
Module
public Module(BaseHome basehome, java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
isConditionalDependency
public static boolean isConditionalDependency(java.lang.String depends)
-
normalizeModuleName
public static java.lang.String normalizeModuleName(java.lang.String name)
-
getName
public java.lang.String getName()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
expandDependencies
public void expandDependencies(Props props)
-
getDefaultConfig
public java.util.List<java.lang.String> getDefaultConfig()
-
getIniTemplate
public java.util.List<java.lang.String> getIniTemplate()
-
getFiles
public java.util.List<java.lang.String> getFiles()
-
isSkipFilesValidation
public boolean isSkipFilesValidation()
-
getJvmArgs
public java.util.List<java.lang.String> getJvmArgs()
-
getLibs
public java.util.List<java.lang.String> getLibs()
-
getLicense
public java.util.List<java.lang.String> getLicense()
-
getXmls
public java.util.List<java.lang.String> getXmls()
-
getJPMS
public java.util.List<java.lang.String> getJPMS()
-
getVersion
public Version getVersion()
-
hasDefaultConfig
public boolean hasDefaultConfig()
-
hasIniTemplate
public boolean hasIniTemplate()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.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
-
process
public void process(BaseHome basehome) throws java.io.IOException
- Throws:
java.io.IOException
-
clearTransitiveEnable
public boolean clearTransitiveEnable()
-
setSkipFilesValidation
public void setSkipFilesValidation(boolean skipFilesValidation)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getDepends
public java.util.List<java.lang.String> getDepends()
-
getProvides
public java.util.Set<java.lang.String> getProvides()
-
getOptional
public java.util.Set<java.lang.String> getOptional()
-
getDescription
public java.util.List<java.lang.String> getDescription()
-
getTags
public java.util.List<java.lang.String> getTags()
-
getPrimaryTag
public java.lang.String getPrimaryTag()
-
isEnabled
public boolean isEnabled()
-
getEnableSources
public java.util.Set<java.lang.String> getEnableSources()
-
enable
public boolean enable(java.lang.String source, boolean transitive)- Parameters:
source- String describing where the module was enabled fromtransitive- True if the enable is transitive- Returns:
- true if the module was not previously enabled
-
isTransitive
public boolean isTransitive()
-
writeIniSection
public void writeIniSection(java.io.BufferedWriter writer, Props props)
-
-