com.ls.cockpit
Interface ICommand

All Known Implementing Classes:
com.ls.cockpit.CommandTemplate

public interface ICommand

contains all possible and allowed methods to be called

Version:
$Revision: 1.2 $
Author:
Last modified by $Author: ASchneider $

Method Summary
 Object executeCommand(String command, Object arguments)
          executes a command and calls the defined method
 void run()
          runs the thread
 void setUserInterfaceReference(IUserInterface uiReference)
          sets the reference to the user interface for the commandTemplate
 boolean startClass(String className, Map parameters, Map dependencies, Map description)
          tries to instantiate a command class by using the given parameters
 

Method Detail

run

public void run()
runs the thread

executeCommand

public Object executeCommand(String command,
                             Object arguments)
                      throws CommandNotFoundException,
                             CommandNotAvailableException,
                             InvalidArgumentException
executes a command and calls the defined method
Parameters:
command - the commands name
arguments - the arguments needed by command (could be any object) -- it depends on the command
Returns:
Object an answer of executing (could be any object) -- it depends on the command
Throws:
CommandNotFoundException - If the command doesn't exists
CommandNotAvailableException - If the command isn't available in this moment or causes an error e.g. loading of a file failed
InvalidArgumentException - If the arguments aren't correct

setUserInterfaceReference

public void setUserInterfaceReference(IUserInterface uiReference)
sets the reference to the user interface for the commandTemplate
Parameters:
uiReference - the reference to the user interface

startClass

public boolean startClass(String className,
                          Map parameters,
                          Map dependencies,
                          Map description)
                   throws InvocationTargetException,
                          InstantiationException,
                          IllegalAccessException,
                          LinkageError,
                          ClassNotFoundException,
                          NoSuchMethodException,
                          SecurityException
tries to instantiate a command class by using the given parameters
Parameters:
className - the class to be instantiated
parameters - containing all parameters needed by this class
dependencies - containing all dependencies to execute a command
description - containing all command's description
Returns:
boolean true if the class is started
Throws:
InvocationTargetException - If the class can't be invoked
InstantiationException - If the class can't be instantiated
IllegalAccessException - If the class can't be accessed cause of an access violation
LinkageError - If the class can't be linked with the current ClassLoader
ClassNotFoundException - If the class can't be found
NoSuchMethodException - If the needed constructor isn't present
SecurityException - If there is a security violation