|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.cog.abstraction.impl.common.taskgraph.TaskGraphImpl
| Field Summary |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.TaskGraph |
AbortOnFailure, ContinueOnFailure |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
TASK, TASKGRAPH |
| Constructor Summary | |
TaskGraphImpl()
|
|
TaskGraphImpl(Identity id)
|
|
| Method Summary | |
void |
add(ExecutableObject node)
Adds the ExecutableObject(Task or
TaskGraph) to this TaskGraph. |
void |
addChangeListener(ChangeListener listener)
Adds the listener to receive graph change events produced by this TaskGraph. |
void |
addDependency(ExecutableObject from,
ExecutableObject to)
Adds a single dependency between the given nodes. |
void |
addStatusListener(StatusListener listener)
Adds a listener to receive status events when the status of an ExecutableObject is changed. |
boolean |
contains(Identity id)
Returns a boolean indicating whether this TaskGraph
contains a node with the given Identity |
Enumeration |
elements()
Returns all the ExecutableObject(s) that is encapsulated by this
TaskGraph. |
boolean |
equals(Object object)
|
ExecutableObject |
get(Identity id)
Returns the ExecutableObjectthat is represented by the given
identity. |
int |
getActiveCount()
Returns the number of ExecutableObjects that have their status
as Status.ACTIVE |
Enumeration |
getAllAttributes()
|
Object |
getAttribute(String name)
|
int |
getCanceledCount()
Returns the number of ExecutableObjects that have their status
as Status.CANCELED |
int |
getCompletedCount()
Returns the number of ExecutableObjects that have their status
as Status.COMPLETED |
Calendar |
getCompletedTime()
Returns the time when this TaskGraph was completed |
Dependency |
getDependency()
Returns the dependency object associated with this TaskGraph. |
int |
getFailedCount()
Returns the number of ExecutableObjects that have their status
as Status.FAILED |
int |
getFailureHandlingPolicy()
Returns the failure handling policy of this TaskGraph. |
Identity |
getIdentity()
Returns the unique Identity assigned to this
ExecutableObject. |
String |
getName()
Returns the user-friendly name assigned to this ExecutableObject. |
int |
getObjectType()
Returns the type of this ExecutableObject. |
int |
getResumedCount()
Returns the number of ExecutableObjects that have their status
as Status.RESUMED |
int |
getSize()
Returns the total number of ExecutableObjectencapsulated by this
TaskGraph |
Status |
getStatus()
Returns the current Status of this
ExecutableObject. |
int |
getSubmittedCount()
Returns the number of ExecutableObjects that have their status
as Status.SUBMITTED |
Calendar |
getSubmittedTime()
Returns the time when this TaskGraph was submitted |
int |
getSuspendedCount()
Returns the number of ExecutableObjects that have their status
as Status.SUSPENDED |
int |
getUnsubmittedCount()
Returns the number of ExecutableObjects that have their status
as Status.UNSUBMITTED |
int |
hashCode()
|
boolean |
isEmpty()
Returns a boolean indicating whether this TaskGraph
contains any node |
ExecutableObject |
remove(Identity id)
Removes the ExecutableObjectthat is represented by the given
identity. |
void |
removeChangeListener(ChangeListener listener)
Removes the change listener for this TaskGraph. |
boolean |
removeDependency(ExecutableObject from,
ExecutableObject to)
Removes the dependency between the given nodes. |
void |
removeStatusListener(StatusListener listener)
Removes the status listener from the list of active listeners. |
void |
setAttribute(String name,
Object value)
|
void |
setDependency(Dependency dependency)
Sets all the dependencies associated with this TaskGraph. |
void |
setFailureHandlingPolicy(int policy)
Sets the policy adopted by this TaskGraph when any
Task fails. |
void |
setIdentity(Identity id)
Sets a unique Identity for this
ExecutableObject. |
void |
setName(String name)
Sets the name of this ExecutableObject. |
void |
setStatus(int status)
Sets the current status of this ExecutableObject. |
void |
setStatus(Status status)
Sets the current Status of this
ExecutableObject. |
ExecutableObject[] |
toArray()
Returns all the ExecutableObject(s) that is encapsulated by this
TaskGraph. |
void |
toXML(File file)
Checkpoints the current state of this TaskGraph in XML
format. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TaskGraphImpl()
public TaskGraphImpl(Identity id)
| Method Detail |
public void setIdentity(Identity id)
ExecutableObjectIdentity for this
ExecutableObject.
setIdentity in interface ExecutableObjectid - the unique Identity.public Identity getIdentity()
ExecutableObjectIdentity assigned to this
ExecutableObject.
getIdentity in interface ExecutableObjectpublic void setName(String name)
ExecutableObjectExecutableObject. Defines a
user-friendly name which need not be unique.
setName in interface ExecutableObjectname - a string specifying the name of this
ExecutableObject.public String getName()
ExecutableObjectExecutableObject.
getName in interface ExecutableObjectpublic int getObjectType()
ExecutableObjectExecutableObject. Currently, two
types are supported: Taskand TaskGraph. Additional
types can be supported by classes implementing this interface.
getObjectType in interface ExecutableObject
public void add(ExecutableObject node)
throws Exception
TaskGraphExecutableObject(Task or
TaskGraph) to this TaskGraph. By default
the added node is an unconnected node without dependencies on any of the
existing nodes in this TaskGraph.
add in interface TaskGraphnode - an ExecutableObjectto be added as a node
Exceptionpublic ExecutableObject remove(Identity id)
TaskGraphExecutableObjectthat is represented by the given
identity.
remove in interface TaskGraphid - the identity of the node to be removed
ExecutableObjectpublic ExecutableObject get(Identity id)
TaskGraphExecutableObjectthat is represented by the given
identity.
get in interface TaskGraphid - the identity of the node to be returned
ExecutableObjectrepresented by the given Identitypublic ExecutableObject[] toArray()
TaskGraphExecutableObject(s) that is encapsulated by this
TaskGraph.
toArray in interface TaskGraphTaskGraphpublic Enumeration elements()
TaskGraphExecutableObject(s) that is encapsulated by this
TaskGraph.
elements in interface TaskGraphTaskGraphpublic void setDependency(Dependency dependency)
TaskGraphTaskGraph.
setDependency in interface TaskGraphpublic Dependency getDependency()
TaskGraphTaskGraph.
getDependency in interface TaskGraph
public void addDependency(ExecutableObject from,
ExecutableObject to)
TaskGraph
addDependency in interface TaskGraphfrom - the ExecutableObjectrepresenting the parent nodeto - the ExecutableObjectrepresenting the child node
public boolean removeDependency(ExecutableObject from,
ExecutableObject to)
TaskGraph
removeDependency in interface TaskGraphfrom - the ExecutableObjectrepresenting the parent nodeto - the ExecutableObjectrepresenting the child nodepublic void setStatus(Status status)
ExecutableObjectStatus of this
ExecutableObject.
setStatus in interface ExecutableObjectstatus - the latest status of this ExecutableObject.public void setStatus(int status)
ExecutableObjectExecutableObject.
Supported status are:
Status.UNSUBMITTED, Status.SUBMITTED, Status.ACTIVE,
Status.SUSPENDED,Status.RESUMED,Status.FAILED,
Status.CANCELED,Status.COMPLETED,
Status.UNKNOWN
setStatus in interface ExecutableObjectpublic Status getStatus()
ExecutableObjectStatus of this
ExecutableObject.
getStatus in interface ExecutableObjectpublic int getSize()
TaskGraphExecutableObjectencapsulated by this
TaskGraph
getSize in interface TaskGraph
public void setAttribute(String name,
Object value)
setAttribute in interface TaskGraphpublic Object getAttribute(String name)
getAttribute in interface TaskGraphpublic Enumeration getAllAttributes()
getAllAttributes in interface TaskGraphpublic void addStatusListener(StatusListener listener)
ExecutableObjectExecutableObject is changed.
addStatusListener in interface ExecutableObjectlistener - the status listenerpublic void removeStatusListener(StatusListener listener)
ExecutableObject
removeStatusListener in interface ExecutableObjectpublic boolean contains(Identity id)
TaskGraphTaskGraph
contains a node with the given Identity
contains in interface TaskGraphid - the Identity of the desired nodepublic boolean isEmpty()
TaskGraphTaskGraph
contains any node
isEmpty in interface TaskGraphpublic int getUnsubmittedCount()
TaskGraphExecutableObjects that have their status
as Status.UNSUBMITTED
getUnsubmittedCount in interface TaskGraphpublic int getSubmittedCount()
TaskGraphExecutableObjects that have their status
as Status.SUBMITTED
getSubmittedCount in interface TaskGraphpublic int getActiveCount()
TaskGraphExecutableObjects that have their status
as Status.ACTIVE
getActiveCount in interface TaskGraphpublic int getCompletedCount()
TaskGraphExecutableObjects that have their status
as Status.COMPLETED
getCompletedCount in interface TaskGraphpublic int getSuspendedCount()
TaskGraphExecutableObjects that have their status
as Status.SUSPENDED
getSuspendedCount in interface TaskGraphpublic int getResumedCount()
TaskGraphExecutableObjects that have their status
as Status.RESUMED
getResumedCount in interface TaskGraphpublic int getFailedCount()
TaskGraphExecutableObjects that have their status
as Status.FAILED
getFailedCount in interface TaskGraphpublic int getCanceledCount()
TaskGraphExecutableObjects that have their status
as Status.CANCELED
getCanceledCount in interface TaskGraph
public void toXML(File file)
throws MarshalException
TaskGraphTaskGraph in XML
format. Using the TaskGraphUnmarshaller,
the checkpointed TaskGraph can once again be
re-instantiated.
toXML in interface TaskGraphfile - the file to store the checkpointed task graph.
MarshalException - during an error in XML translation.public Calendar getSubmittedTime()
TaskGraphTaskGraph was submitted
getSubmittedTime in interface TaskGraphTaskGraph submission time. null, if it is not
yet submittedpublic Calendar getCompletedTime()
TaskGraphTaskGraph was completed
getCompletedTime in interface TaskGraphTaskGraph completion time. null, if it is not
yet completedpublic void setFailureHandlingPolicy(int policy)
TaskGraphTaskGraph when any
Task fails. This policy determines the execution behaviour
of the nodes dependent on the failed nodes.
For example, if the policy is TaskGraph.AbortOnFailure, then
dependents of a failed ExecutableObject are not executed
at all. On the other hand, if the policy is
TaskGraph.ContinueOnFailure, then the dependents are executed
irrespective to the final status of the parents.
setFailureHandlingPolicy in interface TaskGraphpublic int getFailureHandlingPolicy()
TaskGraphTaskGraph.
getFailureHandlingPolicy in interface TaskGraphpublic void addChangeListener(ChangeListener listener)
TaskGraphTaskGraph. Change events are generated when an
ExecutableObject is either added or removed from this
TaskGraph.
addChangeListener in interface TaskGraphpublic void removeChangeListener(ChangeListener listener)
TaskGraphTaskGraph.
removeChangeListener in interface TaskGraphpublic boolean equals(Object object)
public int hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||