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

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  java.util.Properties mCommands
          Maps command element names to their implementation class.
 
Constructor Summary
PropertiesCommandFactory(java.util.Properties properties)
          Constructs the CommandFactory using the specified properties.
 
Method Summary
 Command createCommand(org.w3c.dom.Element element)
          Creates and 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
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mCommands

private java.util.Properties mCommands
Maps command element names to their implementation class.

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 XMLDBCommandCreationException,
                             XMLDBUnsupportedCommandException,
                             XMLDBCommandSpecificationException,
                             XMLDBCommandExecutionException
Description copied from interface: CommandFactory
Creates and 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 newly created Command
Throws:
XMLDBCommandExecutionException - If there is an internal problem
XMLDBCommandSpecificationException - If there is a problem parsing element or initialising the command due to incorrect values in the command provided by a client.
XMLDBCommandCreationException - If there is a problem when creating the Command.
XMLDBUnsupportedCommandException - If the Command is not known to the factory.