ModuleGroup

public class ModuleGroup

ModuleGroup represents a group of modules and is capable of starting and stopping its active modules. A module group can have multiple system modules and the first one defined in the module group descriptor will be treated as the default system module.

Author:Hugo Y. K. Lam

Constructors

ModuleGroup

public ModuleGroup(String descriptorLocation)

Creates a new instance of ModuleGroup.

Parameters:
  • descriptorLocation – the descriptor location.

ModuleGroup

public ModuleGroup(String descriptorLocation, ClassLoader loader)

Creates a new instance of ModuleGroup.

Parameters:
  • descriptorLocation – the descriptor location.
  • loader – the class loader for loading the modules.

Methods

addChild

public void addChild(ModuleGroup group)

Adds a child module group.

Parameters:
  • group – the child module group.

getChildren

public Collection getChildren()

Gets the child module groups.

Returns:the child module groups.

getModule

public Module getModule(String id)

Gets the specified module in this module group.

Parameters:
  • id – the module ID.
Returns:

the specified module.

getModules

public Collection getModules()

Gets all modules in this module group.

Returns:all modules in this module group.

getName

public String getName()

Gets the name of this module group.

Returns:the name of this module group.

getParent

public ModuleGroup getParent()

Gets the parent module group.

Returns:the parent module group.

getSystemModule

public SystemModule getSystemModule()

Gets the default system module.

Returns:the default system module or null if there is none.

removeChild

public void removeChild(ModuleGroup group)

setParent

public void setParent(ModuleGroup parent)

Sets the parent module group.

Parameters:
  • parent – the parent module group.

startActiveModules

public void startActiveModules()

Starts all active modules.

stopActiveModules

public void stopActiveModules()

Stops all active modules.

toString

public String toString()

Returns a string representation of this module group.

Returns:a string representation of this module group.

See also: java.lang.Object.toString()