org.rhq.enterprise.server.scheduler.jobs
Class AbstractStatefulJob

java.lang.Object
  extended by org.rhq.enterprise.server.scheduler.jobs.AbstractStatefulJob
All Implemented Interfaces:
org.quartz.Job, org.quartz.StatefulJob
Direct Known Subclasses:
AsyncResourceDeleteJob, CheckForSuspectedAgentsJob, CheckForTimedOutConfigUpdatesJob, CheckForTimedOutContentRequestsJob, CheckForTimedOutOperationsJob, CheckForTimedOutResourceFactoryJobs, CloudManagerJob, DataPurgeJob, DynaGroupAutoRecalculationJob, NotifyAgentsOfScheduleUpdatesJob, PurgePluginsJob, PurgeResourceTypesJob, SavedSearchResultCountRecalculationJob

public abstract class AbstractStatefulJob
extends Object
implements org.quartz.StatefulJob

Provides a wrapper around Quartz stateful job. Implementations of this job will never trigger a misfire because the execute method will never throw exceptions back to Quartz. Jobs extending this class are assured by Quartz to never run concurrently within the cluster.

Author:
John Mazzitelli

Constructor Summary
AbstractStatefulJob()
           
 
Method Summary
 void execute(org.quartz.JobExecutionContext context)
          Quartz will call this method when it needs to execute the job.
abstract  void executeJobCode(org.quartz.JobExecutionContext context)
          Subclasses should implement this method to perform the actual job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatefulJob

public AbstractStatefulJob()
Method Detail

execute

public void execute(org.quartz.JobExecutionContext context)
             throws org.quartz.JobExecutionException
Quartz will call this method when it needs to execute the job. This is simply a wrapper around the subclass' implementation code, catching and logging all exceptions (but not throwing those exceptions back to Quartz).

Specified by:
execute in interface org.quartz.Job
Throws:
org.quartz.JobExecutionException
See Also:
Job.execute(JobExecutionContext)

executeJobCode

public abstract void executeJobCode(org.quartz.JobExecutionContext context)
                             throws org.quartz.JobExecutionException
Subclasses should implement this method to perform the actual job.

Parameters:
context -
Throws:
org.quartz.JobExecutionException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.