You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Form a simple discovery test, I've created a Job managed programmatically because I aim at having a console to drive execution batchs by users.
Then in main:
// Manage my job programmatically
SundialJobScheduler.addJob( HelloJob.jobName(), HelloJob.class.getName());
// Run my job every 2 seconds and unlimitedly
SundialJobScheduler.addSimpleTrigger(
HelloJob.jobName() + "-Trigger", HelloJob.jobName(), -1, TimeUnit.SECONDS.toMillis(2));
In HelloJob.java:
@Override
public void doRun() throws JobInterruptException {
System.out.println( String.format( "Hello Job %d at [%s]", ++count, DF.format( new Date())));
if ( count >= 3 ) {
System.out.println( "interrupted by itself");
//SundialJobScheduler.removeTrigger( jobName() + "-Trigger");
//SundialJobScheduler.stopJob( jobName()); // ineffective call
throw new JobInterruptException(); // ineffective
}
}
Throwing JobInterruptException was hoping to trigger some behavior at monitor level, but nothing happened. Just wonder the utility of this exception then...
The text was updated successfully, but these errors were encountered:
Form a simple discovery test, I've created a Job managed programmatically because I aim at having a console to drive execution batchs by users.
Then in main:
In HelloJob.java:
Throwing JobInterruptException was hoping to trigger some behavior at monitor level, but nothing happened. Just wonder the utility of this exception then...
The text was updated successfully, but these errors were encountered: