uk.org.ogsadai.activity.xmldb.commands
Class PropertiesCommandFactory

java.lang.Object
  |
  +--uk.org.ogsadai.activity.xmldb.commands.PropertiesCommandFactory
All Implemented Interfaces:
CommandFactory

public class PropertiesCommandFactory
extends java.lang.Object
implements CommandFactory

A CommandFactory that creates Command instances based on a properties file where the keys are command element names and the values command implementation class names.

Author:
The OGSA-DAI Project Team

Constructor Summary
PropertiesCommandFactory(java.util.Properties properties)
          Constructs the CommandFactory using the specified properties.
 
Method Summary
 Command createCommand(org.w3c.dom.Element element)
          Instantiates the Command that corresponds to the specified element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesCommandFactory

public PropertiesCommandFactory(java.util.Properties properties)
Constructs the CommandFactory using the specified properties.

Parameters:
properties - A Properties object where each key represents a command element name and its corresponding value the class name for the command implementation.
Method Detail

createCommand

public Command createCommand(org.w3c.dom.Element element)
                      throws CommonUserException,
                             CommonSystemException
Instantiates the Command that corresponds to the specified element.

Specified by:
createCommand in interface CommandFactory
Parameters:
element - The element to map to a corresponding Command implementation.
Returns:
the command corresponding to the element
Throws:
CommonSystemException - If there is a system problem preventing the Command from being created.
CommonUserException - If there is a user problem preventing the Command from being created.