org.globus.cog.abstraction.impl.common.taskgraph
Class TaskGraphHandlerImpl

java.lang.Object
  extended byorg.globus.cog.abstraction.impl.common.taskgraph.TaskGraphHandlerImpl
All Implemented Interfaces:
ChangeListener, StatusListener, TaskGraphHandler
Direct Known Subclasses:
QueueHandlerImpl, SetHandlerImpl

public class TaskGraphHandlerImpl
extends Object
implements TaskGraphHandler, StatusListener, ChangeListener


Field Summary
 
Fields inherited from interface org.globus.cog.abstraction.interfaces.TaskGraphHandler
CASCADED_TASK_HANDLER, NON_CASCADED_TASK_HANDLER
 
Constructor Summary
TaskGraphHandlerImpl()
           
TaskGraphHandlerImpl(GenericTaskHandler taskHandler)
           
 
Method Summary
 boolean cancel(Identity identity)
          Cancels the execution of an ExecutableObject.
protected  boolean executeIfAvailable(ExecutableObject node)
           
 Enumeration getActiveNodes()
           
 Enumeration getCanceledNodes()
           
 Enumeration getCompletedNodes()
           
 Enumeration getFailedNodes()
           
 TaskGraph getGraph()
           
 Enumeration getSubmittedNodes()
           
 Enumeration getSuspendedNodes()
           
 int getTaskHandlerPolicy()
           
 Enumeration getUnsubmittedNodes()
           
 void graphChanged(ChangeEvent event)
           
 boolean resume(Identity identity)
          Resumes the execution of an ExecutableObjectin the taskgraph that was previously suspended by the TaskGraphHandler.suspend(Identity)method.
 void setTaskHandlerPolicy(int policy)
           
 void statusChanged(StatusEvent event)
           
 void submit(TaskGraph taskgraph)
          Submits the given TaskGraphfor execuiton.
 boolean suspend(Identity identity)
          Suspends an ExecutableObjectthat is currently active in the taskgraph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskGraphHandlerImpl

public TaskGraphHandlerImpl()

TaskGraphHandlerImpl

public TaskGraphHandlerImpl(GenericTaskHandler taskHandler)
Method Detail

submit

public void submit(TaskGraph taskgraph)
            throws IllegalSpecException,
                   InvalidSecurityContextException,
                   InvalidServiceContactException,
                   TaskSubmissionException
Description copied from interface: TaskGraphHandler
Submits the given TaskGraphfor execuiton. The TaskGraph is submitted to the TaskHandler in an asynchronous mode, whereby the method returns immediately after submitting the task graph. The status and output of the tasks can be monitored asynchronously by the ExecutableObject.addStatusListener(StatusListener)and Task.addOutputListener(OutputListener)methods respectively.

Specified by:
submit in interface TaskGraphHandler
Parameters:
taskgraph - the TaskGraph to be submitted
Throws:
InvalidServiceContactException - when the ServiceContactassociated with any task in this code>TaskGraph is invalid
InvalidSecurityContextException - when the SecurityContextassociated with with any task in this code>TaskGraph is invalid
TaskSubmissionException - when generic errors occur during taskgraph submission
IllegalSpecException - when the Specificationassociated with any task in this code>TaskGraph is illegal

suspend

public boolean suspend(Identity identity)
                throws InvalidSecurityContextException,
                       TaskSubmissionException
Description copied from interface: TaskGraphHandler
Suspends an ExecutableObjectthat is currently active in the taskgraph. A suspended object can be resumed using the TaskGraphHandler.resume(Identity)method

Specified by:
suspend in interface TaskGraphHandler
Parameters:
identity - the identity of the ExecutableObject to be suspended
Throws:
InvalidSecurityContextException - when the SecurityContextassociated with ExecutableObject is invalid
TaskSubmissionException - when generic errors occur

resume

public boolean resume(Identity identity)
               throws InvalidSecurityContextException,
                      TaskSubmissionException
Description copied from interface: TaskGraphHandler
Resumes the execution of an ExecutableObjectin the taskgraph that was previously suspended by the TaskGraphHandler.suspend(Identity)method.

Specified by:
resume in interface TaskGraphHandler
Parameters:
identity - the identity of the ExecutableObject to be suspended
Throws:
InvalidSecurityContextException - when the SecurityContextassociated with ExecutableObject is invalid
TaskSubmissionException - when generic errors occur

cancel

public boolean cancel(Identity identity)
               throws InvalidSecurityContextException,
                      TaskSubmissionException
Description copied from interface: TaskGraphHandler
Cancels the execution of an ExecutableObject.

Specified by:
cancel in interface TaskGraphHandler
Parameters:
identity - the identity of the ExecutableObject to be suspended
Throws:
TaskSubmissionException - when generic errors occur
InvalidSecurityContextException - when the SecurityContextassociated with ExecutableObject is invalid

getGraph

public TaskGraph getGraph()
Specified by:
getGraph in interface TaskGraphHandler

statusChanged

public void statusChanged(StatusEvent event)
Specified by:
statusChanged in interface StatusListener

getUnsubmittedNodes

public Enumeration getUnsubmittedNodes()
Specified by:
getUnsubmittedNodes in interface TaskGraphHandler

getSubmittedNodes

public Enumeration getSubmittedNodes()
Specified by:
getSubmittedNodes in interface TaskGraphHandler

getActiveNodes

public Enumeration getActiveNodes()
Specified by:
getActiveNodes in interface TaskGraphHandler

getFailedNodes

public Enumeration getFailedNodes()
Specified by:
getFailedNodes in interface TaskGraphHandler

getCompletedNodes

public Enumeration getCompletedNodes()
Specified by:
getCompletedNodes in interface TaskGraphHandler

getSuspendedNodes

public Enumeration getSuspendedNodes()
Specified by:
getSuspendedNodes in interface TaskGraphHandler

getCanceledNodes

public Enumeration getCanceledNodes()
Specified by:
getCanceledNodes in interface TaskGraphHandler

executeIfAvailable

protected boolean executeIfAvailable(ExecutableObject node)
                              throws Exception
Throws:
Exception

graphChanged

public void graphChanged(ChangeEvent event)
                  throws Exception
Specified by:
graphChanged in interface ChangeListener
Throws:
Exception

setTaskHandlerPolicy

public void setTaskHandlerPolicy(int policy)
Specified by:
setTaskHandlerPolicy in interface TaskGraphHandler

getTaskHandlerPolicy

public int getTaskHandlerPolicy()
Specified by:
getTaskHandlerPolicy in interface TaskGraphHandler