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
Modifier and TypeMethodDescriptionvoidclose()Deletes the module files and directories.intstatic 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.booleaninthashCode()The path to the module.name()The modules name.toString()
-
Method Details
-
createAlias
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
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
The modules name.- Returns:
- the modules name
-
modulePath
The path to the module.- Returns:
- the path to the module
-
compareTo
- 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
-
toString
-
equals
-
hashCode
public int hashCode()
-