org.globus.cog.gridface.impl.gcm
Class GridCommandManagerImpl

java.lang.Object
  extended byorg.globus.cog.gridface.impl.gcm.GridCommandManagerImpl
All Implemented Interfaces:
AccessDesktop, GridCommandManager

public class GridCommandManagerImpl
extends Object
implements GridCommandManager

GridCommandManager accepts commands from GridFace GUIs and executes tasks for each command


Constructor Summary
GridCommandManagerImpl()
           
GridCommandManagerImpl(File xmlFile)
           
 
Method Summary
 void addStatusListener(StatusListener listener)
          Add status listener to changes in GCM's taskgraph
 boolean cancel(Identity id)
          cancel the command with given id.
 boolean cancel(String idString)
          Cancel the command that has the given id
 Identity execute(GridCommand command, boolean inBackground)
          Obtain task from command and submit
 Identity execute(GridCommand command, boolean inBackground, Enumeration idList)
          Obtain task from command, add dependancies and submit
 Enumeration getActiveCommands()
          Return a list of all commands with status as ACTIVE
 Enumeration getAllCommands()
          Return a list of all commands submitted to GCM
 Enumeration getCanceledCommands()
          Return a list of all commands with status as CANCELED
 Enumeration getCompletedCommands()
          Return a list of all commands with status as COMPLETED
 CoGTop getDesktop()
           
 Enumeration getFailedCommands()
          Return a list of all commands with status as FAILED
 Scheduler getScheduler()
          Return scheduler used by GCM.
 Status getStatus(Identity id)
          get status of the given command
 Status getStatus(String id)
          Get the status of the given command
 Enumeration getSubmittedCommands()
          Return a list of all commands with status as SUBMITTED
 Enumeration getSuspendedCommands()
          Return a list of all commands with status as SUSPENDED
 Enumeration getUnsubmittedCommands()
          Return a list of all commands with status as UNSUBMITTED
 void removeStatusListener(StatusListener listener)
          Remove status listener for GCM
 boolean resume(Identity id)
          Resume the command that has the given id,
 void setDesktop(CoGTop desktop)
           
 void setPriorities(long id, int priority)
          set priority to execute the given command
 void setScheduler(Scheduler scheduler)
          assign a scheduler for executin jobs submitted to gcm
 void submit(ExecutableObject executable)
           
 boolean suspend(Identity id)
          Syspend the command that has the given id,
 void toXML(String fileName)
          Save the state of GCM into an XML file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridCommandManagerImpl

public GridCommandManagerImpl()
                       throws Exception

GridCommandManagerImpl

public GridCommandManagerImpl(File xmlFile)
                       throws Exception
Method Detail

execute

public Identity execute(GridCommand command,
                        boolean inBackground,
                        Enumeration idList)
                 throws Exception
Obtain task from command, add dependancies and submit

Specified by:
execute in interface GridCommandManager
Throws:
Exception

execute

public Identity execute(GridCommand command,
                        boolean inBackground)
                 throws Exception
Obtain task from command and submit

Specified by:
execute in interface GridCommandManager
Throws:
Exception

submit

public void submit(ExecutableObject executable)
            throws Exception
Throws:
Exception

getStatus

public Status getStatus(String id)
Description copied from interface: GridCommandManager
Get the status of the given command

Specified by:
getStatus in interface GridCommandManager

getStatus

public Status getStatus(Identity id)
get status of the given command

Specified by:
getStatus in interface GridCommandManager

getDesktop

public CoGTop getDesktop()
Specified by:
getDesktop in interface AccessDesktop

setDesktop

public void setDesktop(CoGTop desktop)
Specified by:
setDesktop in interface AccessDesktop

cancel

public boolean cancel(String idString)
               throws Exception
Description copied from interface: GridCommandManager
Cancel the command that has the given id

Specified by:
cancel in interface GridCommandManager
Throws:
Exception

cancel

public boolean cancel(Identity id)
               throws Exception
cancel the command with given id. Returns true if command has been canceled sucessfully.

Specified by:
cancel in interface GridCommandManager
Throws:
Exception

suspend

public boolean suspend(Identity id)
                throws Exception
Description copied from interface: GridCommandManager
Syspend the command that has the given id,

Specified by:
suspend in interface GridCommandManager
Throws:
Exception

resume

public boolean resume(Identity id)
               throws Exception
Description copied from interface: GridCommandManager
Resume the command that has the given id,

Specified by:
resume in interface GridCommandManager
Throws:
Exception

getAllCommands

public Enumeration getAllCommands()
Return a list of all commands submitted to GCM

Specified by:
getAllCommands in interface GridCommandManager

getUnsubmittedCommands

public Enumeration getUnsubmittedCommands()
Return a list of all commands with status as UNSUBMITTED

Specified by:
getUnsubmittedCommands in interface GridCommandManager

getSubmittedCommands

public Enumeration getSubmittedCommands()
Return a list of all commands with status as SUBMITTED

Specified by:
getSubmittedCommands in interface GridCommandManager

getActiveCommands

public Enumeration getActiveCommands()
Return a list of all commands with status as ACTIVE

Specified by:
getActiveCommands in interface GridCommandManager

getFailedCommands

public Enumeration getFailedCommands()
Return a list of all commands with status as FAILED

Specified by:
getFailedCommands in interface GridCommandManager

getCompletedCommands

public Enumeration getCompletedCommands()
Return a list of all commands with status as COMPLETED

Specified by:
getCompletedCommands in interface GridCommandManager

getSuspendedCommands

public Enumeration getSuspendedCommands()
Return a list of all commands with status as SUSPENDED

Specified by:
getSuspendedCommands in interface GridCommandManager

getCanceledCommands

public Enumeration getCanceledCommands()
Return a list of all commands with status as CANCELED

Specified by:
getCanceledCommands in interface GridCommandManager

setPriorities

public void setPriorities(long id,
                          int priority)
set priority to execute the given command

Specified by:
setPriorities in interface GridCommandManager

setScheduler

public void setScheduler(Scheduler scheduler)
assign a scheduler for executin jobs submitted to gcm

Specified by:
setScheduler in interface GridCommandManager

getScheduler

public Scheduler getScheduler()
Return scheduler used by GCM. Default scheduler is FIFO

Specified by:
getScheduler in interface GridCommandManager

toXML

public void toXML(String fileName)
           throws Exception
Save the state of GCM into an XML file

Specified by:
toXML in interface GridCommandManager
Throws:
Exception

addStatusListener

public void addStatusListener(StatusListener listener)
Add status listener to changes in GCM's taskgraph

Specified by:
addStatusListener in interface GridCommandManager

removeStatusListener

public void removeStatusListener(StatusListener listener)
Remove status listener for GCM

Specified by:
removeStatusListener in interface GridCommandManager