rails.game
Class ComponentManager

java.lang.Object
  extended by rails.game.ComponentManager

public class ComponentManager
extends java.lang.Object

ComponentManage - an implementation of ComponentManagerI, which handles the creation and configuration of rails.game components, and acts as a discovery point for other components to find them.


Field Summary
static java.lang.String COMPONENT_CLASS_TAG
          The name of the XML attribute for the component's class.
static java.lang.String COMPONENT_ELEMENT_ID
          The name of the XML tag used to configure a component.
static java.lang.String COMPONENT_FILE_TAG
          The name of the XML attribute for the component's configuration file.
static java.lang.String COMPONENT_NAME_TAG
          The name of the XML attribute for the component's name.
protected  java.util.List<java.lang.String> directories
           
static java.lang.String ELEMENT_ID
          The name of the XML tag used to configure the ComponentManager.
protected static org.apache.log4j.Logger log
           
 
Method Summary
static ComponentManager configureInstance(java.lang.String gameName, Tag tag, java.util.Map<java.lang.String,java.lang.String> gameOptions)
           
 ConfigurableComponentI findComponent(java.lang.String componentName)
          Returns the configured parameter with the given name.
 void finishPreparation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_ID

public static final java.lang.String ELEMENT_ID
The name of the XML tag used to configure the ComponentManager.

See Also:
Constant Field Values

COMPONENT_ELEMENT_ID

public static final java.lang.String COMPONENT_ELEMENT_ID
The name of the XML tag used to configure a component.

See Also:
Constant Field Values

COMPONENT_NAME_TAG

public static final java.lang.String COMPONENT_NAME_TAG
The name of the XML attribute for the component's name.

See Also:
Constant Field Values

COMPONENT_CLASS_TAG

public static final java.lang.String COMPONENT_CLASS_TAG
The name of the XML attribute for the component's class.

See Also:
Constant Field Values

COMPONENT_FILE_TAG

public static final java.lang.String COMPONENT_FILE_TAG
The name of the XML attribute for the component's configuration file.

See Also:
Constant Field Values

log

protected static org.apache.log4j.Logger log

directories

protected java.util.List<java.lang.String> directories
Method Detail

configureInstance

public static ComponentManager configureInstance(java.lang.String gameName,
                                                 Tag tag,
                                                 java.util.Map<java.lang.String,java.lang.String> gameOptions)
                                          throws ConfigurationException
Throws:
ConfigurationException

finishPreparation

public void finishPreparation()
                       throws ConfigurationException
Throws:
ConfigurationException

findComponent

public ConfigurableComponentI findComponent(java.lang.String componentName)
Returns the configured parameter with the given name.

Parameters:
componentName - the of the component sought.
Returns:
the component sought, or null if it has not been configured.