com.ibm.jdg2e.concurrency.jobs
Class CustomJob

java.lang.Object
  extended byorg.eclipse.core.runtime.PlatformObject
      extended byorg.eclipse.core.internal.jobs.InternalJob
          extended byorg.eclipse.core.runtime.jobs.Job
              extended bycom.ibm.jdg2e.concurrency.jobs.CustomJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable

public class CustomJob
extends org.eclipse.core.runtime.jobs.Job

An implementation of job processing that is used to demonstrate the function and capability of a job run using the Eclipse job framework.


Field Summary
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
 
Constructor Summary
CustomJob(java.lang.String name)
           
CustomJob(java.lang.String name, boolean fail, int result, boolean useLimitedRule)
          Values passed to this constructor are used to control behavior.
 
Method Summary
 boolean belongsTo(java.lang.Object family)
          Identifies that any job that is of this same type is a job in the same family.
protected  org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
          This method is used to demonstrate job behavior.
 void setAccessLock(org.eclipse.core.runtime.jobs.ILock accessLock)
          Identifies the lock, if any, that will be used by this job.
 void setRescheduleDelay(int rescheduleDelay)
          Identifies the delay that should be used for the schedule request when this is a repeating job.
 void setRescheduleJob(boolean rescheduleJob)
          Tells job to reschedule itself.
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, cancel, done, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, wakeUp, wakeUp
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo, toString
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

CustomJob

public CustomJob(java.lang.String name)
Parameters:
name -

CustomJob

public CustomJob(java.lang.String name,
                 boolean fail,
                 int result,
                 boolean useLimitedRule)
Values passed to this constructor are used to control behavior.

Parameters:
name - - the initial job name, this value is changed dynamically.
fail - - Request that this job fail by throwing an exception.
result - - Define the expected job result as defined in the status
useLimitedRule - - Request that a scheduling rule be used dynamically in job logic.
Method Detail

belongsTo

public boolean belongsTo(java.lang.Object family)
Identifies that any job that is of this same type is a job in the same family. This supports the use of a family image.

See Also:
Job.belongsTo(java.lang.Object)

run

protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
This method is used to demonstrate job behavior. No real processing is performed, the method uses calls to routines that include Thread.sleep requests. If required, the job is forced to fail, acquires a lock, uses a rule, checks for cancelation, and reschedules itself. The requested status is returned at the end.

See Also:
InternalJob.run(org.eclipse.core.runtime.IProgressMonitor)

setAccessLock

public void setAccessLock(org.eclipse.core.runtime.jobs.ILock accessLock)
Identifies the lock, if any, that will be used by this job.

Parameters:
accessLock -

setRescheduleDelay

public void setRescheduleDelay(int rescheduleDelay)
Identifies the delay that should be used for the schedule request when this is a repeating job.

Parameters:
rescheduleDelay -

setRescheduleJob

public void setRescheduleJob(boolean rescheduleJob)
Tells job to reschedule itself.

Parameters:
rescheduleJob -