org.ourgrid.mygrid.ui.command
Class CommandManager

java.lang.Object
  extended by org.ourgrid.mygrid.ui.command.CommandManager

public class CommandManager
extends java.lang.Object

Implements the main of Command Pattern. All MyGrid commands must pass here.


Field Summary
static java.lang.String MYGRID_ADDJOB
           
static java.lang.String MYGRID_CANCELJOB
           
static java.lang.String MYGRID_CLEANER
           
static java.lang.String MYGRID_CONFIG
           
static java.lang.String MYGRID_GUI
           
static java.lang.String MYGRID_SETGRID
           
static java.lang.String MYGRID_STARTER
           
static java.lang.String MYGRID_STATUS
           
static java.lang.String MYGRID_STOPPER
           
static java.lang.String MYGRID_WAITFORJOB
           
 
Constructor Summary
CommandManager(boolean startUIManager)
          Default constructor
CommandManager(UIManager UIManager)
           
 
Method Summary
 void addNewCommand(java.lang.String command, Command gridCommand)
           
 int executeCommand(java.lang.String[] params)
          Method that checks what Command will be able to execute the command in parameter "param".
 void initCommandMap()
          it starts the map with MyGridCommands.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MYGRID_STARTER

public static final java.lang.String MYGRID_STARTER
See Also:
Constant Field Values

MYGRID_STOPPER

public static final java.lang.String MYGRID_STOPPER
See Also:
Constant Field Values

MYGRID_STATUS

public static final java.lang.String MYGRID_STATUS
See Also:
Constant Field Values

MYGRID_SETGRID

public static final java.lang.String MYGRID_SETGRID
See Also:
Constant Field Values

MYGRID_ADDJOB

public static final java.lang.String MYGRID_ADDJOB
See Also:
Constant Field Values

MYGRID_CANCELJOB

public static final java.lang.String MYGRID_CANCELJOB
See Also:
Constant Field Values

MYGRID_WAITFORJOB

public static final java.lang.String MYGRID_WAITFORJOB
See Also:
Constant Field Values

MYGRID_CONFIG

public static final java.lang.String MYGRID_CONFIG
See Also:
Constant Field Values

MYGRID_GUI

public static final java.lang.String MYGRID_GUI
See Also:
Constant Field Values

MYGRID_CLEANER

public static final java.lang.String MYGRID_CLEANER
See Also:
Constant Field Values
Constructor Detail

CommandManager

public CommandManager(boolean startUIManager)
               throws java.rmi.RemoteException
Default constructor

Parameters:
startUIManager - if the command will use a component's UIManager the value should be true. This value should be set to false only if the command does not need to communicate with the component's daemon.
Throws:
java.rmi.RemoteException - if a communication error occurs when getting the reference to the UIManager

CommandManager

public CommandManager(UIManager UIManager)
Method Detail

initCommandMap

public void initCommandMap()
it starts the map with MyGridCommands.


addNewCommand

public void addNewCommand(java.lang.String command,
                          Command gridCommand)

executeCommand

public int executeCommand(java.lang.String[] params)
                   throws InvalidCommandException
Method that checks what Command will be able to execute the command in parameter "param". It will verify in it's map of commands, and then, call his run method.

Parameters:
params - This parameter must contain the Command string representation, followed by it's parameters.
Returns:
true if the JVM must be kept alive after execution
Throws:
InvalidCommandException

main

public static void main(java.lang.String[] args)