|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.util.jobs.Job
Default IJob implementation to be used as base for concrete
Jobs.
| Field Summary | |
private boolean |
canceled
trueif the Job has been canceled;
otherwise false
|
private Exception |
exc
The Exception that may potentially occur |
private String |
jobName
The name of the Job |
private JobManager |
manager
The JobManager that is responsible for this
Job
|
private int |
priority
The Job priority. |
private JobStatus |
status
The status of the Job |
private Thread |
thread
The Thread that this Job runs in |
| Fields inherited from interface net.sourceforge.java.util.jobs.IJob |
HIGH_PRIORITY, LOW_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Job()
|
|
| Method Summary | |
void |
cancel()
Cancels this Job.
|
void |
done()
This method has to be called instantly after this Job is
done.
|
Exception |
getException()
Gets the Exception that may have potentially occured
causing the Job to fail. |
JobManager |
getJobManager()
Gets the JobManager that is responsible for the management
and scheduling of this Job.
|
String |
getName()
Gets the human readable name of this Job.
|
int |
getPriority()
Gets the priority of this Job.
|
JobStatus |
getStatus()
Gets the status of this Job.
|
Thread |
getThread()
Gets the Thread that this Job runs in.
|
boolean |
isCanceled()
Gets the cancellation status of this Job.
|
void |
join()
Joins this Job running in the set Thread as
returned by the getThread() method. |
void |
setException(Exception cause)
Sets the Exception that may have potentially occured
causing the Job to fail.
|
void |
setJobManager(JobManager manager)
Sets the JobManager that is responsible for the management
and scheduling of this Job.
|
void |
setName(String name)
Sets a human readable name for this Job.
|
void |
setPriority(int priority)
Sets the priority of this Job.
|
void |
setThread(Thread thread)
Sets the Thread that this Job runs in.
|
void |
start()
Starts this Job in the set Thread as
returned by the getThread() method.
|
void |
started()
This method has to be called instantly after this Job has
been started.
|
void |
statusChanged()
This method can be called if the JobStatus of this
Job changed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.operation.IRunnableWithProgress |
run |
| Field Detail |
private int priority
The Job priority. By default a Job has norm
priority.
private JobManager manager
The JobManager that is responsible for this
Job
private Thread thread
The Thread that this Job runs in
private Exception exc
The Exception that may potentially occur
private String jobName
The name of the Job
private JobStatus status
The status of the Job
private boolean canceled
trueif the Job has been canceled;
otherwise false
| Constructor Detail |
public Job()
| Method Detail |
public void setPriority(int priority)
Sets the priority of this Job.
IJob.LOW_PRIORITY for
the lowest priority (1)IJob.NORM_PRIORITY for
default priority (5)IJob.HIGH_PRIORITY for
the highest priority (10)IJob.LOW_PRIORITY and
IJob.HIGH_PRIORITY.
Priorites beyons this interval will be rejected and don't change the
current priority.
setPriority in interface IJobpriority - the priority to set for this JobgetPriority()public int getPriority()
Gets the priority of this Job.
IJob.LOW_PRIORITY for
the lowest priority (1)IJob.NORM_PRIORITY for
default priority (5)IJob.HIGH_PRIORITY for
the highest priority (10)IJob.LOW_PRIORITY and
IJob.HIGH_PRIORITY.
getPriority in interface IJobJobsetPriority(int)public void setJobManager(JobManager manager)
Sets the JobManager that is responsible for the management
and scheduling of this Job.
setJobManager in interface IJobmanager - the JobManager that is responsible for the
management and scheduling of this JobgetJobManager()public JobManager getJobManager()
Gets the JobManager that is responsible for the management
and scheduling of this Job.
getJobManager in interface IJobJobManager that is responsible for the
management and scheduling of this JobsetJobManager(JobManager)public void setThread(Thread thread)
Sets the Thread that this Job runs in.
setThread in interface IJobthread - the Thread that this Job runs ingetThread()public Thread getThread()
Gets the Thread that this Job runs in.
getThread in interface IJobThread that this Job runs insetThread(Thread)public void setException(Exception cause)
Sets the Exception that may have potentially occured
causing the Job to fail.
setException in interface IJobcause - the potential Exception; null
if no Exception was throwngetException()public Exception getException()
Gets the Exception that may have potentially occured
causing the Job to fail. This methode returns
null if the Job succeeded.
getException in interface IJobException; null if
no Exception was thrownsetException(Exception)public void setName(String name)
Sets a human readable name for this Job.
setName in interface IJobname - a human readable name for this JobgetName()public String getName()
Gets the human readable name of this Job.
getName in interface IJobJobsetName(String)public JobStatus getStatus()
Gets the status of this Job.
getStatus in interface IJobJobStatus object representing the
status of this Jobpublic void start()
Starts this Job in the set Thread as
returned by the getThread() method.
If no Thread is set this method does nothing.
start in interface IJobpublic void started()
This method has to be called instantly after this Job has
been started.
Subclasses may override this method but need to call
super.started() when finished to notify the responsible
JobManager that this Job has been started.
started in interface IJob
public void join()
throws InterruptedException
Joins this Job running in the set Thread as
returned by the getThread() method. If no Thread
is set this method does nothing.
join in interface IJobInterruptedException - if another Job has interrupted
the current Job. The interrupted status of the current
Job is cleared when this exception is thrownpublic void done()
This method has to be called instantly after this Job is
done.
Subclasses may override this method but need to call
super.done() when finished to notify the responsible
JobManager that this Job is done.
done in interface IJobpublic void statusChanged()
This method can be called if the JobStatus of this
Job changed. Subclasses may override this method but need
to call super.statusChanged() when finished to notify the
responsible JobManager that the status of this
Job changed.
statusChanged in interface IJobpublic void cancel()
Cancels this Job.
cancel in interface IJobpublic boolean isCanceled()
Gets the cancellation status of this Job.
isCanceled in interface IJobtrue if this Job has been
canceled; false otherwise
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||