Class ModuleDescription
- java.lang.Object
-
- org.wildfly.testing.tools.modules.ModuleDescription
-
- All Implemented Interfaces:
AutoCloseable,Comparable<ModuleDescription>
public final class ModuleDescription extends Object implements AutoCloseable, Comparable<ModuleDescription>
Describes a created module. When this is closed the module will be deleted. If the files and directory cannot be deleted, a shutdown hook will be added to delete the module when the JVM exits. This typically happens on Windows as the module loader holds a lock on the resources.- Author:
- James R. Perkins
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Deletes the module files and directories.intcompareTo(ModuleDescription o)static ModuleDescriptioncreateAlias(String moduleName, String targetName)Creates a module-alias with the discovered module path.static ModuleDescriptioncreateAlias(Path modulePath, String moduleName, String targetName)Creates a module alias based on the module path.booleanequals(Object obj)inthashCode()PathmodulePath()The path to the module.Stringname()The modules name.StringtoString()
-
-
-
Method Detail
-
createAlias
public static ModuleDescription createAlias(String moduleName, String targetName)
Creates a module-alias with the discovered module path.- Parameters:
moduleName- the name of the moduletargetName- the target name for the alias- Returns:
- the module description for the alias
-
createAlias
public static ModuleDescription createAlias(Path modulePath, String moduleName, String targetName)
Creates a module alias based on the module path. If the module path isnullan attempt to discover it will be done.- Parameters:
modulePath- the path to the base module pathmoduleName- the name of the moduletargetName- the target name for the alias- Returns:
- the module description for the alias
-
name
public String name()
The modules name.- Returns:
- the modules name
-
modulePath
public Path modulePath()
The path to the module.- Returns:
- the path to the module
-
compareTo
public int compareTo(ModuleDescription o)
- Specified by:
compareToin interfaceComparable<ModuleDescription>
-
close
public void close()
Deletes the module files and directories. If an error occurs attempting to delete the module, a shutdown hook is added to attempt to delete the resources when the JVM exits.- Specified by:
closein interfaceAutoCloseable
-
-