|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.cog.abstraction.impl.common.task.TaskImpl
| Field Summary |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.Task |
FILE_OPERATION, FILE_TRANSFER, INFORMATION_QUERY, JOB_SUBMISSION |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
TASK, TASKGRAPH |
| Constructor Summary | |
TaskImpl()
|
|
TaskImpl(String name,
int type)
|
|
| Method Summary | |
void |
addOutputListener(OutputListener listener)
Adds a listener to recieve the output events associated with this Task. |
void |
addService(Service service)
Adds the Serviceto the tail of the ordered list of services. |
void |
addStatusListener(StatusListener listener)
Adds a listener to receive status events when the status of an ExecutableObject is changed. |
boolean |
equals(Object object)
|
Enumeration |
getAllAttributes()
Returns all the attribute names associated with this Task. |
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. |
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. |
String |
getProvider()
|
int |
getRequiredServices()
Returns the maximum number of services required for this task. |
Service |
getService(int index)
Returns the Serviceat the given index of the ordered list of
services |
Specification |
getSpecification()
Returns the Specificationassociated with this Task. |
Status |
getStatus()
Returns the current Status of this
ExecutableObject. |
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. |
int |
hashCode()
|
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 Servicefrom the given position in the ordered list
of Grid services. |
void |
removeStatusListener(StatusListener listener)
Removes the status listener from the list of active listeners. |
void |
setAttribute(String name,
Object value)
Sets an attribute for this Task. |
void |
setIdentity(Identity id)
Sets a unique Identity for this
ExecutableObject. |
void |
setName(String name)
Sets the name of this ExecutableObject. |
void |
setProvider(String provider)
|
void |
setRequiredService(int value)
Sets the maximum number of services required for this task. |
void |
setService(int index,
Service service)
Sets one of the Servicerequired to execute this task. |
void |
setSpecification(Specification specification)
Sets the Specificationdescribing the execution parameters of
this Task. |
void |
setStatus(int status)
Sets the current status of this ExecutableObject. |
void |
setStatus(Status status)
Sets the current Status of this
ExecutableObject. |
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 class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TaskImpl()
public TaskImpl(String name,
int type)
| Method Detail |
public 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 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 int getObjectType()
ExecutableObjectExecutableObject. Currently, two
types are supported: Taskand TaskGraph. Additional
types can be supported by classes implementing this interface.
getObjectType in interface ExecutableObjectpublic void setType(int type)
TaskTask. Supported task types include:
JOB_SUBMISSION,FILE_TRANSFER, and
FILE_OPERATION.
setType in interface Tasktype - the type of this Task.public int getType()
TaskTask.
getType in interface Taskpublic void setProvider(String provider)
setProvider in interface Taskpublic String getProvider()
getProvider in interface Task
public void setService(int index,
Service service)
TaskServicerequired to execute this task. The index
at which this service is inserted determines its semantic role in the
execution of the task. A task can require more than one service for
execution. Thus, services are an ordered list.
setService in interface Taskindex - the index representing the position of the service in the
ordered list.service - the remote Grid service.public void addService(Service service)
TaskServiceto the tail of the ordered list of services.
addService in interface Taskservice - the remote Grid servicepublic Service removeService(int index)
TaskServicefrom the given position in the ordered list
of Grid services.
removeService in interface Taskindex - the index representing the position of the service in the
ordered list.
public Service getService(int index)
TaskServiceat the given index of the ordered list of
services
getService in interface Taskindex - the index representing the position of the service in the
ordered list.
public Collection removeAllServices()
Task
removeAllServices in interface TaskCollection of servicespublic void removeService(Collection collection)
TaskCollection of services.
removeService in interface TaskCollection of servicespublic Collection getAllServices()
Task
getAllServices in interface TaskCollection of servicespublic void setRequiredService(int value)
TaskJOB_SUBMISSION task requires a maximum of 1 service by
default, where as the FILE_TRANSFER task requires a
maximum of 2 services by default.
setRequiredService in interface Taskvalue - the maximum number of services requiredpublic int getRequiredServices()
Task
getRequiredServices in interface Taskpublic void setSpecification(Specification specification)
TaskSpecificationdescribing the execution parameters of
this Task.
setSpecification in interface Taskspecification - the execution specification associated with this
Task.public Specification getSpecification()
TaskSpecificationassociated with this Task.
getSpecification in interface Taskpublic void setStdOutput(String output)
TaskTask. This
method is used by the TaskHandlerto store the stdout of the
remote task execution if it is redirected to the local machine.
setStdOutput in interface Taskpublic String getStdOutput()
Task
getStdOutput in interface Taskpublic void setStdError(String error)
TaskTask. This
method is used by the TaskHandlerto store the stderr of the
remote task execution if it is redirected to the local machine.
setStdError in interface Taskpublic String getStdError()
Task
getStdError in interface Taskpublic 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 ExecutableObject
public void setAttribute(String name,
Object value)
TaskTask. The interpretation of
these attributes are TaskHandlerspecific and may not be utilized
at all by some handlers.
setAttribute in interface Taskname - a string representing the name of the attribute value an
object representing the value of this attributepublic Object getAttribute(String name)
Task
getAttribute in interface Taskname - the name of the desired attribute
public Enumeration getAllAttributes()
TaskTask.
getAllAttributes in interface Taskpublic void addStatusListener(StatusListener listener)
ExecutableObjectExecutableObject is changed.
addStatusListener in interface ExecutableObjectlistener - the status listenerpublic void removeStatusListener(StatusListener listener)
ExecutableObject
removeStatusListener in interface ExecutableObjectpublic void addOutputListener(OutputListener listener)
TaskTask. The listener reveives events related to the changes
in the stdout of this Task.
addOutputListener in interface Tasklistener - the output listener for this Task.public void removeOutputListener(OutputListener listener)
Task
removeOutputListener in interface Task
public void toXML(File file)
throws MarshalException
TaskTask in XML format.
Using the TaskUnmarshaller, the
checkpointed Task can once again be re-instantiated.
toXML in interface Taskfile - the file to store the checkpointed task.
MarshalException - during an error in XML translation.public String toString()
toString in interface Taskpublic boolean isUnsubmitted()
Task
isUnsubmitted in interface Taskpublic boolean isActive()
Task
isActive in interface Taskpublic boolean isCompleted()
Task
isCompleted in interface Taskpublic boolean isSuspended()
Task
isSuspended in interface Taskpublic boolean isFailed()
Task
isFailed in interface Taskpublic boolean isCanceled()
Task
isCanceled in interface Taskpublic Calendar getSubmittedTime()
TaskTask was submitted to the
remote service.
getSubmittedTime in interface TaskTask submission time. null, if this
Task is not yet submittedpublic Calendar getCompletedTime()
TaskTask was completed.
getCompletedTime in interface TaskTask completion time. null, if this
Task is not yet complete.public boolean equals(Object object)
public int hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||