com.raritantechnologies.searchApp.scheduler
Class Job

java.lang.Object
  extended bycom.raritantechnologies.searchApp.scheduler.Job
All Implemented Interfaces:
IConfigurable

public class Job
extends java.lang.Object
implements IConfigurable

Wrapper class that represents a recurring, scheduled background "Job". Contains a JobSchedule and a JobProcess object. The Scheduler regularly polls the JobSchedule class to determine if the Job is ready to be run. If so, the Job object is added to the job processing queue. When a JobDispatcher thread picks up the Job, it requests the JobProcess object to execute its process.

XML Configuration Template:
    <Job jobId="[blank or assigned jobId]" >
       <JobSchedule schedulerClass="[implementation of JobSchedule]" 
         status="[blank or current schedule Status]" >
         <!-- JobSchedule implementation parameters here... -->
       </JobSchedule>
 
       <JobProcess processClass="[implementation of IJobProcess]" >
         <!-- initialization parameters for the IJobProcess object -->
       </JobProcess>
 
     </Job>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
Job()
           
Job(java.lang.Object jobSchedule, IJobProcess jobProcess)
           
 
Method Summary
 org.w3c.dom.Element getConfigurationElement()
           
 java.lang.String getConfigurationXML()
           
 java.lang.String getJobId()
           
 RaritanPageContext getJobParameters()
           
 IJobProcess getJobProcess()
          called by Scheduler when job is ready to be done...
 int getJobStatus()
          returns an integer code for the current Job Status: UNSCHEDULED = 0 SCHEDULED = 1 STARTED = 2 COMPLETED = 3 REMOTED = 4
 JobSchedule getSchedule()
          Called by Scheduler to get the job's timing info...
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void jobCompleted(java.lang.Object processOb, java.util.Date at, int status)
           
 void jobScheduled(java.util.Date at)
           
 void jobStarting(java.util.Date at)
           
 void setJobParameters(RaritanPageContext rpc)
           
 void setJobProcess(IJobProcess jobProcess)
           
 void setSchedule(JobSchedule jSchedule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Job

public Job()

Job

public Job(java.lang.Object jobSchedule,
           IJobProcess jobProcess)
Method Detail

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

setSchedule

public void setSchedule(JobSchedule jSchedule)

getSchedule

public JobSchedule getSchedule()
Called by Scheduler to get the job's timing info...


setJobProcess

public void setJobProcess(IJobProcess jobProcess)

getJobProcess

public IJobProcess getJobProcess()
called by Scheduler when job is ready to be done... return JobProcess with latest data...


setJobParameters

public void setJobParameters(RaritanPageContext rpc)

getJobParameters

public RaritanPageContext getJobParameters()

jobStarting

public void jobStarting(java.util.Date at)

jobCompleted

public void jobCompleted(java.lang.Object processOb,
                         java.util.Date at,
                         int status)

jobScheduled

public void jobScheduled(java.util.Date at)

getJobStatus

public int getJobStatus()
returns an integer code for the current Job Status: UNSCHEDULED = 0 SCHEDULED = 1 STARTED = 2 COMPLETED = 3 REMOTED = 4


getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationElement

public org.w3c.dom.Element getConfigurationElement()

getJobId

public java.lang.String getJobId()