org.jboss.modules
Class ModuleIdentifier

java.lang.Object
  extended by org.jboss.modules.ModuleIdentifier
All Implemented Interfaces:
Serializable

public final class ModuleIdentifier
extends Object
implements Serializable

A unique identifier for a module within a module loader.

Author:
John Bailey, David M. Lloyd, Jason T. Greene
See Also:
Serialized Form

Field Summary
static ModuleIdentifier CLASSPATH
          The class path module (only present if booted from a class path).
static ModuleIdentifier SYSTEM
          The system module.
 
Method Summary
static ModuleIdentifier create(String name)
          Creates a new module identifier using the specified name.
static ModuleIdentifier create(String name, String slot)
          Creates a new module identifier using the specified name and slot.
 boolean equals(ModuleIdentifier other)
          Determine whether this object is equal to another.
 boolean equals(Object other)
          Determine whether this object is equal to another.
static ModuleIdentifier fromString(String moduleSpec)
          Parse a module specification from a string.
 String getName()
          Get the module name.
 String getSlot()
          Get the module version slot.
 int hashCode()
          Determine the hash code of this module identifier.
 String toString()
          Get the string representation of this module identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSTEM

public static final ModuleIdentifier SYSTEM
The system module.


CLASSPATH

public static final ModuleIdentifier CLASSPATH
The class path module (only present if booted from a class path).

Method Detail

getName

public String getName()
Get the module name.

Returns:
the module name

getSlot

public String getSlot()
Get the module version slot.

Returns:
the version slot

equals

public boolean equals(Object other)
Determine whether this object is equal to another.

Overrides:
equals in class Object
Parameters:
other - the other object
Returns:
true if they are equal, false otherwise

equals

public boolean equals(ModuleIdentifier other)
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.

Overrides:
hashCode in class Object
Returns:
the hash code

toString

public String toString()
Get the string representation of this module identifier.

Overrides:
toString in class Object
Returns:
the string representation

fromString

public static ModuleIdentifier fromString(String moduleSpec)
                                   throws IllegalArgumentException
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 is null

create

public static ModuleIdentifier create(String name,
                                      String slot)
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 module
slot - the slot this module belongs in
Returns:
the identifier

create

public static ModuleIdentifier create(String name)
Creates a new module identifier using the specified name.

Parameters:
name - the name of the module
Returns:
the identifier


Copyright © 2011. All Rights Reserved.