atg.service.scheduler
Class ScheduledJob

java.lang.Object
  extended by atg.service.scheduler.ScheduledJob

public class ScheduledJob
extends java.lang.Object

A ScheduledJob represents all the information about a job in the scheduler. This includes the job's id, name, description, Schedule, and source, and separate thread flag. When the job occurs, this object is passed to the Schedulable object that is to receive the job.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static int REUSED_THREAD
           
static int SCHEDULER_THREAD
           
static int SEPARATE_THREAD
           
 
Constructor Summary
ScheduledJob(java.lang.String pJobName, java.lang.String pJobDescription, java.lang.String pSourceName, Schedule pSchedule, Schedulable pSchedulable, boolean pSeparateThread)
          Constructs a new ScheduledJobImpl
ScheduledJob(java.lang.String pJobName, java.lang.String pJobDescription, java.lang.String pSourceName, Schedule pSchedule, Schedulable pSchedulable, int pThreadMethod)
          Constructs a new ScheduledJobImpl
ScheduledJob(java.lang.String pJobName, java.lang.String pJobDescription, java.lang.String pSourceName, Schedule pSchedule, Schedulable pSchedulable, int pThreadMethod, boolean pTransactional)
          Constructs a new ScheduledJobImpl
 
Method Summary
 java.lang.String getJobDescription()
          Returns the description of the job
 int getJobId()
          Returns the id of the job
 java.lang.String getJobName()
          Returns the name of the job
 long getLastJobTime()
          Returns the last time the job was run, or 0 if the job has not yet been run.
 long getNextJobTime()
          Return the next job time, calculated from the last job time.
 int getRunCount()
          Returns the number of times the job has been run
 Schedulable getSchedulable()
          Returns the Schedulable object that will be notified of this job.
 Schedule getSchedule()
          Returns the Schedule for this job
 java.lang.String getSourceName()
          Returns the source name of the job
 int getThreadMethod()
          Returns the threading method used for the job.
 boolean getTransactional()
          Returns the flag indicating if the job should be running in its own transaction context.
 void setJobId(int pJobId)
          Sets the id of the job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


SCHEDULER_THREAD

public static final int SCHEDULER_THREAD
See Also:
Constant Field Values

SEPARATE_THREAD

public static final int SEPARATE_THREAD
See Also:
Constant Field Values

REUSED_THREAD

public static final int REUSED_THREAD
See Also:
Constant Field Values
Constructor Detail

ScheduledJob

public ScheduledJob(java.lang.String pJobName,
                    java.lang.String pJobDescription,
                    java.lang.String pSourceName,
                    Schedule pSchedule,
                    Schedulable pSchedulable,
                    boolean pSeparateThread)
Constructs a new ScheduledJobImpl

Parameters:
pJobName - the name of the job;
pJobDescription - the description of the job
pSourceName - the name of the job's source
pSchedule - the schedule for the job
pSchedulable - the object to be notified when the job occurs
pSeparateThread - if true, then the threadMethod is set to SEPARATE_THREAD, otherwise it is set to SCHEDULER_THREAD. This is here for backwards-compatibility before the threadMethod was available.

ScheduledJob

public ScheduledJob(java.lang.String pJobName,
                    java.lang.String pJobDescription,
                    java.lang.String pSourceName,
                    Schedule pSchedule,
                    Schedulable pSchedulable,
                    int pThreadMethod)
Constructs a new ScheduledJobImpl

Parameters:
pJobName - the name of the job;
pJobDescription - the description of the job
pSourceName - the name of the job's source
pSchedule - the schedule for the job
pSchedulable - the object to be notified when the job occurs
pThreadMethod - the threading method to be used for the job. Should be one of SCHEDULER_THREAD, SEPARATE_THREAD, or REUSED_THREAD.

ScheduledJob

public ScheduledJob(java.lang.String pJobName,
                    java.lang.String pJobDescription,
                    java.lang.String pSourceName,
                    Schedule pSchedule,
                    Schedulable pSchedulable,
                    int pThreadMethod,
                    boolean pTransactional)
Constructs a new ScheduledJobImpl

Parameters:
pJobName - the name of the job;
pJobDescription - the description of the job
pSourceName - the name of the job's source
pSchedule - the schedule for the job
pSchedulable - the object to be notified when the job occurs
pThreadMethod - the threading method to be used for the job. Should be one of SCHEDULER_THREAD, SEPARATE_THREAD, or REUSED_THREAD.
pTransactional - flag indicating if each occurrence of this job should execute in its own transaction
Method Detail

getJobId

public int getJobId()
Returns the id of the job


setJobId

public void setJobId(int pJobId)
Sets the id of the job. This should only be called by the Scheduler.


getJobName

public java.lang.String getJobName()
Returns the name of the job


getJobDescription

public java.lang.String getJobDescription()
Returns the description of the job


getSourceName

public java.lang.String getSourceName()
Returns the source name of the job


getSchedule

public Schedule getSchedule()
Returns the Schedule for this job


getSchedulable

public Schedulable getSchedulable()
Returns the Schedulable object that will be notified of this job.


getThreadMethod

public int getThreadMethod()
Returns the threading method used for the job. Should be one of SCHEDULER_THREAD, SEPARATE_THREAD, REUSED_THREAD.


getTransactional

public boolean getTransactional()
Returns the flag indicating if the job should be running in its own transaction context.


getLastJobTime

public long getLastJobTime()
Returns the last time the job was run, or 0 if the job has not yet been run.


getNextJobTime

public long getNextJobTime()
Return the next job time, calculated from the last job time. If no schedule has been set, then an NPE will occur.


getRunCount

public int getRunCount()
Returns the number of times the job has been run