|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.JPPFJob
public class JPPFJob
Instances of this class represent a JPPF submission and hold all the required elements:
tasks, execution policy, task listener, data provider, priority, blocking indicator.
This class also provides the API for handling JPPF-annotated tasks and POJO tasks.
All jobs have an id. It can be specified by calling setId(String).
If left unspecified, JPPF will automatically assign a uuid as its value.
| Constructor Summary | |
|---|---|
JPPFJob()
Default constructor, creates a blocking job with no data provider, default SLA values and a priority of 0. |
|
JPPFJob(DataProvider dataProvider)
Initialize a blocking job with the specified parameters. |
|
JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA)
Initialize a blocking job with the specified parameters. |
|
JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
boolean blocking,
TaskResultListener resultsListener)
Initialize a job with the specified parameters. |
|
JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
JPPFJobMetadata jobMetadata,
boolean blocking,
TaskResultListener resultsListener)
Initialize a job with the specified parameters. |
|
JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
TaskResultListener resultsListener)
Initialize a non-blocking job with the specified parameters. |
|
JPPFJob(DataProvider dataProvider,
TaskResultListener resultsListener)
Initialize a non-blocking job with the specified parameters. |
|
JPPFJob(String jobUuid)
Default constructor, creates a blocking job with no data provider, default SLA values and a priority of 0. |
|
JPPFJob(TaskResultListener resultsListener)
Initialize a non-blocking job with the specified parameters. |
|
| Method Summary | |
|---|---|
JPPFTask |
addTask(Object taskObject,
Object... args)
Add a task to this job. |
JPPFTask |
addTask(String method,
Object taskObject,
Object... args)
Add a POJO task to this job. |
boolean |
equals(Object obj)
Determine whether this object is equal to another. |
DataProvider |
getDataProvider()
Get the container for data shared between tasks. |
ExecutionPolicy |
getExecutionPolicy()
Deprecated. use JPPFJobSLA.getExecutionPolicy() instead. |
String |
getId()
Get the user-defined display name for this job. |
JPPFJobMetadata |
getJobMetadata()
Get the user-defined metadata asoociated with this job. |
JPPFJobSLA |
getJobSLA()
Get the service level agreement between the job and the server. |
String |
getJobUuid()
Get the universal unique id for this job. |
int |
getPriority()
Deprecated. use JPPFJobSLA.getPriority() instead. |
TaskResultListener |
getResultListener()
Get the listener that receives notifications of completed tasks. |
List<JPPFTask> |
getTasks()
Get the list of tasks to execute. |
int |
hashCode()
COmpute the hascode of this job. |
boolean |
isBlocking()
Determine whether the execution of this job is blocking on the client side. |
void |
setBlocking(boolean blocking)
Specify whether the execution of this job is blocking on the client side. |
void |
setDataProvider(DataProvider dataProvider)
Set the container for data shared between tasks. |
void |
setExecutionPolicy(ExecutionPolicy executionPolicy)
Deprecated. use JPPFJobSLA.setExecutionPolicy(ExecutionPolicy) instead. |
void |
setId(String id)
Set the user-defined display name for this job. |
void |
setJobMetadata(JPPFJobMetadata jobMetadata)
Set this job's metadata. |
void |
setJobSLA(JPPFJobSLA jobSLA)
Get the service level agreement between the job and the server. |
void |
setPriority(int priority)
Deprecated. use JPPFJobSLA.setPriority(int) instead. |
void |
setResultListener(TaskResultListener resultsListener)
Set the listener that receives notifications of completed tasks. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPPFJob()
public JPPFJob(String jobUuid)
jobUuid - the uuid to assign to this job.public JPPFJob(DataProvider dataProvider)
dataProvider - the container for data shared between tasks.
public JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA)
dataProvider - the container for data shared between tasks.jobSLA - sevice level agreement between job and server.public JPPFJob(TaskResultListener resultsListener)
resultsListener - the listener that receives notifications of completed tasks.
public JPPFJob(DataProvider dataProvider,
TaskResultListener resultsListener)
dataProvider - the container for data shared between tasks.resultsListener - the listener that receives notifications of completed tasks.
public JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
TaskResultListener resultsListener)
dataProvider - the container for data shared between tasks.jobSLA - sevice level agreement between job and server.resultsListener - the listener that receives notifications of completed tasks.
public JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
boolean blocking,
TaskResultListener resultsListener)
dataProvider - the container for data shared between tasks.jobSLA - sevice level agreement between job and server.blocking - determines whether this job is blocking.resultsListener - the listener that receives notifications of completed tasks.
public JPPFJob(DataProvider dataProvider,
JPPFJobSLA jobSLA,
JPPFJobMetadata jobMetadata,
boolean blocking,
TaskResultListener resultsListener)
dataProvider - the container for data shared between tasks.jobSLA - sevice level agreement between job and server.jobMetadata - the user-defined job metadata.blocking - determines whether this job is blocking.resultsListener - the listener that receives notifications of completed tasks.| Method Detail |
|---|
public String getJobUuid()
getJobUuid in interface JPPFDistributedJobpublic String getId()
getId in interface JPPFDistributedJobpublic void setId(String id)
id - the display name as a string.public List<JPPFTask> getTasks()
public JPPFTask addTask(Object taskObject,
Object... args)
throws JPPFException
JPPFTask,
annotated with JPPFRunnable, or an instance of Runnable or Callable.
taskObject - the task to add to this job.args - arguments to use with a JPPF-annotated class.
JPPFTask that is either the same as the input if the input is a subclass of JPPFTask,
or a wrapper around the input object in the other cases.
JPPFException - if one of the tasks is neither a JPPFTask or a JPPF-annotated class.
public JPPFTask addTask(String method,
Object taskObject,
Object... args)
throws JPPFException
taskObject - the task to add to this job.method - the name of the method to execute.args - arguments to use with a JPPF-annotated class.
JPPFTask that is a wrapper around the input task object.
JPPFException - if one of the tasks is neither a JPPFTask or a JPPF-annotated class.public DataProvider getDataProvider()
DataProvider instance.public void setDataProvider(DataProvider dataProvider)
dataProvider - a DataProvider instance.public TaskResultListener getResultListener()
TaskCompletionListener instance.public void setResultListener(TaskResultListener resultsListener)
resultsListener - a TaskCompletionListener instance.public boolean isBlocking()
public void setBlocking(boolean blocking)
blocking - true if the execution is blocking, false otherwise.public ExecutionPolicy getExecutionPolicy()
JPPFJobSLA.getExecutionPolicy() instead.
ExecutionPolicy instance.public void setExecutionPolicy(ExecutionPolicy executionPolicy)
JPPFJobSLA.setExecutionPolicy(ExecutionPolicy) instead.
executionPolicy - an ExecutionPolicy instance.public int getPriority()
JPPFJobSLA.getPriority() instead.
public void setPriority(int priority)
JPPFJobSLA.setPriority(int) instead.
priority - the priority as an int.public JPPFJobSLA getJobSLA()
getJobSLA in interface JPPFDistributedJobJPPFJobSLA.public void setJobSLA(JPPFJobSLA jobSLA)
jobSLA - an instance of JPPFJobSLA.public JPPFJobMetadata getJobMetadata()
getJobMetadata in interface JPPFDistributedJobJPPFJobMetadata instance.public void setJobMetadata(JPPFJobMetadata jobMetadata)
jobMetadata - a JPPFJobMetadata instance.public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class Objectobj - the object to compare with.
Object.equals(java.lang.Object)
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||