Package org.jboss.modules
Class ModuleIdentifier
java.lang.Object
org.jboss.modules.ModuleIdentifier
- All Implemented Interfaces:
Serializable
A unique identifier for a module within a module loader.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ModuleIdentifier
The class path module (only present if booted from a class path).private static final String
private final int
private static final Field
private final String
private static final long
private final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
calculateHashCode
(String name, String slot) static ModuleIdentifier
Creates a new module identifier using the specified name.static ModuleIdentifier
Creates a new module identifier using the specified name and slot.boolean
Determine whether this object is equal to another.boolean
equals
(ModuleIdentifier other) Determine whether this object is equal to another.private static String
escapeName
(String name) private static String
escapeSlot
(String slot) static ModuleIdentifier
fromString
(String moduleSpec) Parse a module specification from a string.getName()
Get the module name.getSlot()
Get the module version slot.int
hashCode()
Determine the hash code of this module identifier.private void
toString()
Get the string representation of this module identifier.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
DEFAULT_SLOT
- See Also:
-
name
-
slot
-
hashCode
private final transient int hashCode -
hashField
-
CLASSPATH
The class path module (only present if booted from a class path).
-
-
Constructor Details
-
ModuleIdentifier
-
-
Method Details
-
calculateHashCode
-
getName
Get the module name.- Returns:
- the module name
-
getSlot
Get the module version slot.- Returns:
- the version slot
-
equals
Determine whether this object is equal to another. -
equals
Determine whether this object is equal to another.- Parameters:
other
- the other object- Returns:
true
if they are equal,false
otherwise
-
hashCode
public int hashCode()Determine the hash code of this module identifier. -
toString
Get the string representation of this module identifier. -
readObject
- Throws:
ClassNotFoundException
IOException
-
escapeName
-
escapeSlot
-
fromString
Parse a module specification from a string.- Parameters:
moduleSpec
- the specification string- Returns:
- the module identifier
- Throws:
IllegalArgumentException
- if the format of the module specification is invalid or it isnull
-
create
Creates a new module identifier using the specified name and slot. A slot allows for multiple modules to exist with the same name. The main usage pattern for this is to differentiate between two incompatible release streams of a module. Normally all module definitions wind up in the "main" slot. An unspecified or null slot will result in placement in the "main" slot. Unless you have a true need for a slot, it should not be specified. When in doubt use the {create(String)
method instead.- Parameters:
name
- the name of the moduleslot
- the slot this module belongs in- Returns:
- the identifier
-
create
Creates a new module identifier using the specified name.- Parameters:
name
- the name of the module- Returns:
- the identifier
-