Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
*/
public class Job1Listener implements JobListener {

private static Logger _log = LoggerFactory.getLogger(Job1Listener.class);
private static final Logger LOG = LoggerFactory.getLogger(Job1Listener.class);

public String getName() {
return "job1_to_job2";
}

public void jobToBeExecuted(JobExecutionContext inContext) {
_log.info("Job1Listener says: Job Is about to be executed.");
LOG.info("Job1Listener says: Job Is about to be executed.");
}

public void jobExecutionVetoed(JobExecutionContext inContext) {
_log.info("Job1Listener says: Job Execution was vetoed.");
LOG.info("Job1Listener says: Job Execution was vetoed.");
}

public void jobWasExecuted(JobExecutionContext inContext, JobExecutionException inException) {
_log.info("Job1Listener says: Job was executed.");
LOG.info("Job1Listener says: Job was executed.");

// Simple job #2
JobDetail job2 = newJob(SimpleJob2.class).withIdentity("job2").build();
Expand All @@ -61,7 +61,7 @@ public void jobWasExecuted(JobExecutionContext inContext, JobExecutionException
// schedule the job to run!
inContext.getScheduler().scheduleJob(job2, trigger);
} catch (SchedulerException e) {
_log.warn("Unable to schedule job2!");
LOG.warn("Unable to schedule job2!");
e.printStackTrace();
}

Expand Down
10 changes: 0 additions & 10 deletions quartz-jobs/src/test/java/org/quartz/jobs/MyJobListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ public String getName() {
return "MyJobListener";
}

@Override
public void jobToBeExecuted(JobExecutionContext context) {
//
}

@Override
public void jobExecutionVetoed(JobExecutionContext context) {
//
}

@Override
public void jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ public interface DirectoryScanListener {
* @param updatedFiles The set of files that were updated/added since the
* last scan of the directory
*/
void filesUpdatedOrAdded(File[] updatedFiles);
default void filesUpdatedOrAdded(File[] updatedFiles){}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
*/
public interface FileScanListener {

void fileUpdated(String fileName);
default void fileUpdated(String fileName){}
}
9 changes: 0 additions & 9 deletions quartz/src/main/java/org/quartz/InterruptableJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@
* @author James House
*/
public interface InterruptableJob extends Job {

/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a user
Expand Down
9 changes: 0 additions & 9 deletions quartz/src/main/java/org/quartz/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@
* @author James House
*/
public interface Job {

/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
Expand Down
17 changes: 4 additions & 13 deletions quartz/src/main/java/org/quartz/JobListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@
* @author James House
*/
public interface JobListener {

/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/**
* <p>
* Get the name of the <code>JobListener</code>.
Expand All @@ -65,7 +56,7 @@ public interface JobListener {
*
* @see #jobExecutionVetoed(JobExecutionContext)
*/
void jobToBeExecuted(JobExecutionContext context);
default void jobToBeExecuted(JobExecutionContext context){}

/**
* <p>
Expand All @@ -77,7 +68,7 @@ public interface JobListener {
*
* @see #jobToBeExecuted(JobExecutionContext)
*/
void jobExecutionVetoed(JobExecutionContext context);
default void jobExecutionVetoed(JobExecutionContext context){}


/**
Expand All @@ -87,7 +78,7 @@ public interface JobListener {
* <code>triggered(xx)</code> method has been called.
* </p>
*/
void jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException);
default void jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException){}

}
65 changes: 35 additions & 30 deletions quartz/src/main/java/org/quartz/SchedulerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,13 @@
* @author James House
*/
public interface SchedulerListener {

/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Interface.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
* is scheduled.
* </p>
*/
void jobScheduled(Trigger trigger);
default void jobScheduled(Trigger trigger){}

/**
* <p>
Expand All @@ -55,23 +46,23 @@ public interface SchedulerListener {
*
* @see SchedulerListener#schedulingDataCleared()
*/
void jobUnscheduled(TriggerKey triggerKey);
default void jobUnscheduled(TriggerKey triggerKey){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
* has reached the condition in which it will never fire again.
* </p>
*/
void triggerFinalized(Trigger trigger);
default void triggerFinalized(Trigger trigger){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
* has been paused.
* </p>
*/
void triggerPaused(TriggerKey triggerKey);
default void triggerPaused(TriggerKey triggerKey){}

/**
* <p>
Expand All @@ -83,47 +74,47 @@ public interface SchedulerListener {
*
* @param triggerGroup the paused group, or null if all were paused
*/
void triggersPaused(String triggerGroup);
default void triggersPaused(String triggerGroup){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
* has been un-paused.
* </p>
*/
void triggerResumed(TriggerKey triggerKey);
default void triggerResumed(TriggerKey triggerKey){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a
* group of <code>{@link Trigger}s</code> has been un-paused.
* </p>
*/
void triggersResumed(String triggerGroup);
default void triggersResumed(String triggerGroup){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
* has been added.
* </p>
*/
void jobAdded(JobDetail jobDetail);
default void jobAdded(JobDetail jobDetail){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
* has been deleted.
* </p>
*/
void jobDeleted(JobKey jobKey);
default void jobDeleted(JobKey jobKey){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
* has been paused.
* </p>
*/
void jobPaused(JobKey jobKey);
default void jobPaused(JobKey jobKey){}

/**
* <p>
Expand All @@ -133,23 +124,23 @@ public interface SchedulerListener {
*
* @param jobGroup the paused group, or null if all were paused
*/
void jobsPaused(String jobGroup);
default void jobsPaused(String jobGroup){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
* has been un-paused.
* </p>
*/
void jobResumed(JobKey jobKey);
default void jobResumed(JobKey jobKey){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> when a
* group of <code>{@link org.quartz.JobDetail}s</code> has been un-paused.
* </p>
*/
void jobsResumed(String jobGroup);
default void jobsResumed(String jobGroup){}

/**
* <p>
Expand All @@ -165,51 +156,65 @@ public interface SchedulerListener {
* error that was encountered.
* </p>
*/
void schedulerError(String msg, SchedulerException cause);
default void schedulerError(String msg, SchedulerException cause){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it has move to standby mode.
* </p>
*/
void schedulerInStandbyMode();
default void schedulerInStandbyMode(){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it has started.
* </p>
*/
void schedulerStarted();

default void schedulerStarted() {}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it has paused.
* </p>
*/
default void schedulerPaused(){}

/**
* Called by the <code>{@link Scheduler}</code> to inform the listener that
* the scheduler has resumed after being paused.
*/
default void schedulerResumed(){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it is starting.
* </p>
*/
void schedulerStarting();
default void schedulerStarting(){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it has shutdown.
* </p>
*/
void schedulerShutdown();
default void schedulerShutdown(){}

/**
* <p>
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that it has begun the shutdown sequence.
* </p>
*/
void schedulerShuttingdown();
default void schedulerShuttingdown(){}

/**
* Called by the <code>{@link Scheduler}</code> to inform the listener
* that all jobs, triggers and calendars were deleted.
*/
void schedulingDataCleared();
default void schedulingDataCleared(){}
}
Loading