|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A Task is the atomic unit of execution in cog-core. It
represents a generic Grid functionality including remote job execution, file
transfer request, file access operation, or information query.
It is a container object encapsulating the identity, execution status, protocol provider, specification, security contextm service contact, stdout, stderror, submission-, and completion-time.
| Field Summary | |
static int |
FILE_OPERATION
Represents a file operation task |
static int |
FILE_TRANSFER
Represents a file transfer task between two file resources |
static int |
INFORMATION_QUERY
Represents an information query task. |
static int |
JOB_SUBMISSION
Represents a remote job submission task |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
TASK, TASKGRAPH |
| Method Summary | |
void |
addOutputListener(OutputListener listener)
Adds a listener to recieve the output events associated with this Task. |
void |
addService(Service service)
Adds the Service to the tail of the ordered list of
services. |
Enumeration |
getAllAttributes()
|
Collection |
getAllServices()
Returns all the services associated with this task. |
Object |
getAttribute(String name)
Returns the value associated with the given attribute name. |
Calendar |
getCompletedTime()
Returns the time when this Task was completed. |
String |
getProvider()
Deprecated. Use Service.setProvider(String)instead. |
int |
getRequiredServices()
Returns the maximum number of services required for this task. |
Service |
getService(int index)
Returns the service at the given index |
Specification |
getSpecification()
Returns the execution specification associated with this Task. |
String |
getStdError()
Returns the standard error of the remote task execution. |
String |
getStdOutput()
Returns the standard output of the remote task execution. |
Calendar |
getSubmittedTime()
Returns the time when this Task was submitted to the
remote service. |
int |
getType()
Retruns the type of this Task. |
boolean |
isActive()
Returns a boolean indicating if the task is active. |
boolean |
isCanceled()
Returns a boolean indicating if the task is canceled. |
boolean |
isCompleted()
Returns a boolean indicating if the task is completed. |
boolean |
isFailed()
Returns a boolean indicating if the task is failed. |
boolean |
isSuspended()
Returns a boolean indicating if the task is suspended. |
boolean |
isUnsubmitted()
Returns a boolean indicating if the task is unsubmitted. |
Collection |
removeAllServices()
Removes all the services associated with this task. |
void |
removeOutputListener(OutputListener listener)
Removes the output listener. |
void |
removeService(Collection collection)
Removes all the services associated with this task that also belongs to the given Collection of services. |
Service |
removeService(int index)
Removes the service from the given position in the ordered list of Grid services. |
void |
setAttribute(String name,
Object value)
Sets an attribute for this Task. |
void |
setProvider(String provider)
Deprecated. Use Service.setProvider(String)instead. |
void |
setRequiredService(int value)
Sets the maximum number of services required for this task. |
void |
setService(int index,
Service service)
Sets one of the Service required to execute this task at
the given position.A task can require more than one service for
execution. |
void |
setSpecification(Specification specification)
Sets the specification describing the execution parameters of this Task. |
void |
setStdError(String error)
Sets the standard error produced by this Task. |
void |
setStdOutput(String output)
Sets the standard output produced by this Task. |
void |
setType(int type)
Sets the type of this Task. |
String |
toString()
|
void |
toXML(File file)
Checkpoints the current state of this Task in XML format. |
| Methods inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
addStatusListener, getIdentity, getName, getObjectType, getStatus, removeStatusListener, setIdentity, setName, setStatus, setStatus |
| Field Detail |
public static final int JOB_SUBMISSION
public static final int FILE_TRANSFER
public static final int INFORMATION_QUERY
public static final int FILE_OPERATION
| Method Detail |
public void setType(int type)
Task. Supported task types include:
JOB_SUBMISSION,FILE_TRANSFER, and
FILE_OPERATION.
type - the type of this Task.public int getType()
Task.
public void setProvider(String provider)
Service.setProvider(String)instead.
public String getProvider()
Service.setProvider(String)instead.
public void setService(int index,
Service service)
Service required to execute this task at
the given position.A task can require more than one service for
execution. Thus, services are an ordered list.
index - the index representing the position of the service in the
ordered list.service - the remote Grid service.public void addService(Service service)
Service to the tail of the ordered list of
services.
service - the remote Grid servicepublic Service removeService(int index)
index - the index representing the position of the service in the
ordered list.
public Collection removeAllServices()
Collection of servicespublic void removeService(Collection collection)
Collection of services.
Collection of servicespublic Service getService(int index)
index - the index representing the position of the service in the
ordered list.
public Collection getAllServices()
Collection of servicespublic void setRequiredService(int value)
JOB_SUBMISSION task requires a maximum of 1 service,
where as the FILE_TRANSFER task requires a maximum of 2
services.
value - the maximum number of services requiredpublic int getRequiredServices()
public void setSpecification(Specification specification)
Task.
specification - the execution specification associated with this
Task.public Specification getSpecification()
Task.
public void setStdOutput(String output)
Task. This
method is used by the TaskHandler to store the stdout of
the remote task execution if it is redirected to the local machine.
public String getStdOutput()
public void setStdError(String error)
Task. This
method is used by the TaskHandler to store the stderr of
the remote task execution if it is redirected to the local machine.
public String getStdError()
public void setAttribute(String name,
Object value)
Task. The interpretation of
these attributes are TaskHandler specific and may not be
utilized at all by some handlers.
name - a string representing the name of the attribute value an
object representing the value of this attributepublic Object getAttribute(String name)
name - the name of the desired attribute
public Enumeration getAllAttributes()
public void addOutputListener(OutputListener listener)
Task. The listener reveives events related to the changes
in the stdout of this Task.
listener - the output listener for this Task.public void removeOutputListener(OutputListener listener)
public void toXML(File file)
throws MarshalException
Task in XML format.
Using the , the
checkpointed Task can once again be re-instantiated.
file - the file to store the checkpointed task.
MarshalException - during an error in XML translation.public String toString()
public boolean isUnsubmitted()
public boolean isActive()
public boolean isCompleted()
public boolean isSuspended()
public boolean isFailed()
public boolean isCanceled()
public Calendar getSubmittedTime()
Task was submitted to the
remote service.
Task submission time. null, if this
Task is not yet submittedpublic Calendar getCompletedTime()
Task was completed.
Task completion time. null, if this
Task is not yet complete.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||