org.gcube.application.enm.service
Class GenericJob

java.lang.Object
  extended by org.gcube.application.enm.service.GenericJob
All Implemented Interfaces:
Comparable<GenericJob>, Callable<String>
Direct Known Subclasses:
COMPSsJob, OMWSJob

public abstract class GenericJob
extends Object
implements Callable<String>, Comparable<GenericJob>

Represents a job. Execution resource providers must extend this class with the implementation details specific to how the experiments are executed in their platforms. They must override the method Callable.call() with the logic that allows the management of the complete life-cycle of the job, and the constructors GenericJob(UUID, ExperimentRequest) and GenericJob(UUID, ExperimentRequest, ExperimentStatus, ExperimentResults, ExperimentLogs), which are used by PluginLoader to load and inject new providers into the service. Class JobMonitor uses this logic to manage the execution of the job. Note: This class has a natural ordering that is inconsistent with equals.

Author:
Erik Torres

Field Summary
protected  org.gcube.common.core.utils.logging.GCUBELog logger
           
protected  org.gcube.application.enm.common.xml.logs.ExperimentLogs logs
           
static int MAXIMUM_PRIORITY
           
static int MINIMUM_PRIORITY
           
protected  org.gcube.application.enm.common.xml.request.ExperimentRequest request
           
protected  org.gcube.application.enm.common.xml.results.ExperimentResults results
           
protected  org.gcube.application.enm.common.xml.status.ExperimentStatus status
           
protected  UUID uuid
           
 
Constructor Summary
GenericJob(UUID uuid, org.gcube.application.enm.common.xml.request.ExperimentRequest request)
           
GenericJob(UUID uuid, org.gcube.application.enm.common.xml.request.ExperimentRequest request, org.gcube.application.enm.common.xml.status.ExperimentStatus status, org.gcube.application.enm.common.xml.results.ExperimentResults results, org.gcube.application.enm.common.xml.logs.ExperimentLogs logs)
           
 
Method Summary
 void cancel()
           
 int compareTo(GenericJob other)
           
protected  List<String> currentJobIds()
           
protected  int currentStep()
           
 boolean equals(Object other)
           
abstract  ExecutionResource getExecutionResource()
           
 org.gcube.application.enm.common.xml.logs.ExperimentLogs getLogs()
           
 int getPriority()
           
 org.gcube.application.enm.common.xml.request.ExperimentRequest getRequest()
           
 org.gcube.application.enm.common.xml.results.ExperimentResults getResults()
           
 org.gcube.application.enm.common.xml.status.ExperimentStatus getStatus()
           
 UUID getUUID()
           
 boolean isCanceled()
           
protected  void next(int step, List<String> jobIds)
           
protected  void next(int step, String jobId)
           
protected  void next(int step, String[] jobIds)
           
 void setPriority(int priority)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Field Detail

logger

protected org.gcube.common.core.utils.logging.GCUBELog logger

MINIMUM_PRIORITY

public static int MINIMUM_PRIORITY

MAXIMUM_PRIORITY

public static int MAXIMUM_PRIORITY

uuid

protected final UUID uuid

request

protected final org.gcube.application.enm.common.xml.request.ExperimentRequest request

status

protected final org.gcube.application.enm.common.xml.status.ExperimentStatus status

results

protected final org.gcube.application.enm.common.xml.results.ExperimentResults results

logs

protected final org.gcube.application.enm.common.xml.logs.ExperimentLogs logs
Constructor Detail

GenericJob

public GenericJob(UUID uuid,
                  org.gcube.application.enm.common.xml.request.ExperimentRequest request)

GenericJob

public GenericJob(UUID uuid,
                  org.gcube.application.enm.common.xml.request.ExperimentRequest request,
                  org.gcube.application.enm.common.xml.status.ExperimentStatus status,
                  org.gcube.application.enm.common.xml.results.ExperimentResults results,
                  org.gcube.application.enm.common.xml.logs.ExperimentLogs logs)
Method Detail

next

protected void next(int step,
                    String jobId)

next

protected void next(int step,
                    List<String> jobIds)

next

protected void next(int step,
                    String[] jobIds)

currentStep

protected int currentStep()

currentJobIds

protected List<String> currentJobIds()

getUUID

public final UUID getUUID()

getRequest

public final org.gcube.application.enm.common.xml.request.ExperimentRequest getRequest()

getStatus

public final org.gcube.application.enm.common.xml.status.ExperimentStatus getStatus()

getResults

public final org.gcube.application.enm.common.xml.results.ExperimentResults getResults()

getLogs

public final org.gcube.application.enm.common.xml.logs.ExperimentLogs getLogs()

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

isCanceled

public final boolean isCanceled()

cancel

public final void cancel()

getExecutionResource

public abstract ExecutionResource getExecutionResource()

compareTo

public int compareTo(GenericJob other)
Specified by:
compareTo in interface Comparable<GenericJob>

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.