Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoin.group
Interface Module  view Module download Module.java

All Known Implementing Classes:
ModuleImpl, ModuleView

public interface Module

A Module represents a simple container that is used to group a number of Component objects together. Furthermore a Module can be deployed and undeployed at runtime, thus providing a plug-in mechanism for a group of Component objects. A Component can only function properly inside a Module object and only one Component with the same ID should be contained in any single Module, because the ID of the Module and of the Component are used to identify the unique Component-Module relationship at runtime. If the same Component has to be loaded more than once, each of the Component instances should be contained in different Module objects.

The Module interface describes the basic functionality of a Module. It specifies methods to access and manipulate a Module's attributes and also methods that are necessary to deploy the Module in the RECOIN framework.

Version:
0.2.9

Method Summary
 boolean activate()
          Performs all the necessary steps to activate the Module.
 void addComponent(Component component)
          Adds the specified Component to the Module.
 boolean equals(java.lang.Object o)
          Compares the Module to the specified Object.
 boolean getActivateOnStartup()
          Returns a value signaling if the Module should be activated on startup.
 Component getComponent(int id)
          Returns the Component with the specified id that is contained in the Module.
 int getComponentCount()
          Returns the number of Component objects currently contained in the Module.
 int[] getComponentIDs()
          Returns an array of the IDs of the Components currently contained in the Module.
 java.util.Vector getComponents()
          Returns the Component objects currently contained in the Module.
 java.lang.String getDescription()
          Returns a description of the Module.
 ModuleGroup getGroup()
          Returns a reference to a ModuleGroup if the Module is contained in one.
 java.lang.String getGroupname()
          Returns the name of the ModuleGroup to which the Module belongs.
 int getID()
          Returns the unique ID of the Module.
 java.lang.String getName()
          Returns the name of the Module.
 boolean isActive()
          Returns whether the Module as been activated.
 java.util.Vector prepareContainer(recoin.container.RetrievalContainer container)
          Prepares the specified RetrievalContainer for processing by any Component objects contained in the Module.
 ComponentRunnable prepareContainer(recoin.container.RetrievalContainer container, recoin.system.session.ComponentOrder order)
          Prepares the specified RetrievalContainer for processing by Component objects contained in the Module using the specified ComponentOrder.
 ComponentRunnable prepareContainer(recoin.container.RetrievalContainer container, recoin.system.session.ComponentOrder order, ComponentRunnable runnable)
          Prepares the specified RetrievalContainer for processing by Component objects contained in the Module using the specified ComponentOrder.
 void removeComponent(Component component)
          Removes the specified Component from the Module.
 void setActivateOnStartup(boolean activate)
          Sets the 'activateOnStartup' state of the Module.
 void setActive(boolean active)
          Sets the Module's 'active' state.
 void setDescription(java.lang.String description)
          Sets the Module's description to the specified one.
 void setGroup(ModuleGroup group)
          Sets the Module's ModuleGroup to the specified one.
 void setName(java.lang.String name)
          Sets the Module's name.
 

Method Detail

activate

public boolean activate()
Performs all the necessary steps to activate the Module.


addComponent

public void addComponent(Component component)
Adds the specified Component to the Module.


equals

public boolean equals(java.lang.Object o)
Compares the Module to the specified Object.


getActivateOnStartup

public boolean getActivateOnStartup()
Returns a value signaling if the Module should be activated on startup.


getComponent

public Component getComponent(int id)
Returns the Component with the specified id that is contained in the Module.


getComponentCount

public int getComponentCount()
Returns the number of Component objects currently contained in the Module.


getComponentIDs

public int[] getComponentIDs()
Returns an array of the IDs of the Components currently contained in the Module. This method can be used for iteration purposes and is simply a shortcut to extracting the these values.


getComponents

public java.util.Vector getComponents()
Returns the Component objects currently contained in the Module.


getDescription

public java.lang.String getDescription()
Returns a description of the Module.


getGroup

public ModuleGroup getGroup()
Returns a reference to a ModuleGroup if the Module is contained in one.


getGroupname

public java.lang.String getGroupname()
Returns the name of the ModuleGroup to which the Module belongs.


getID

public int getID()
Returns the unique ID of the Module.


getName

public java.lang.String getName()
Returns the name of the Module.


isActive

public boolean isActive()
Returns whether the Module as been activated.


setActive

public void setActive(boolean active)
Sets the Module's 'active' state.


setActivateOnStartup

public void setActivateOnStartup(boolean activate)
Sets the 'activateOnStartup' state of the Module.


setDescription

public void setDescription(java.lang.String description)
Sets the Module's description to the specified one.


setGroup

public void setGroup(ModuleGroup group)
Sets the Module's ModuleGroup to the specified one.


setName

public void setName(java.lang.String name)
Sets the Module's name.


prepareContainer

public java.util.Vector prepareContainer(recoin.container.RetrievalContainer container)
Prepares the specified RetrievalContainer for processing by any Component objects contained in the Module. It returns a Vector of ComponentRunnable objects that have been created by the Component objects.
The Vector might be empty if the RetrievalContainer cannot be processed for any reason.


prepareContainer

public ComponentRunnable prepareContainer(recoin.container.RetrievalContainer container,
                                          recoin.system.session.ComponentOrder order)
Prepares the specified RetrievalContainer for processing by Component objects contained in the Module using the specified ComponentOrder. It returns a ComponentRunnable that has been created by the Component.


prepareContainer

public ComponentRunnable prepareContainer(recoin.container.RetrievalContainer container,
                                          recoin.system.session.ComponentOrder order,
                                          ComponentRunnable runnable)
Prepares the specified RetrievalContainer for processing by Component objects contained in the Module using the specified ComponentOrder. It returns a ComponentRunnable that has been created by the Component. The new ComponentRunnable is linked to the specified ComponentRunnable to establish an order of ececution.


removeComponent

public void removeComponent(Component component)
Removes the specified Component from the Module.