nz.ac.auckland.jobs.periodic.depr.WrapperFactory.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of periodic-jobs Show documentation
Show all versions of periodic-jobs Show documentation
Simple scheduler for periodic jobs. Requires Spring.
The newest version!
package nz.ac.auckland.jobs.periodic.depr
import nz.ac.auckland.jobs.periodic.AbstractJob
import nz.ac.auckland.jobs.periodic.Job
import nz.ac.auckland.jobs.periodic.PeriodicJobs
import nz.ac.auckland.jobs.periodic.ScheduledJob
/**
*
* author: Irina Benediktovich - http://plus.google.com/+IrinaBenediktovich
*/
class WrapperFactory {
public static AbstractJob wrapJob(ScheduledJob job){
return new AbstractJob() {
@Override
Long getInitialDelay() {
return 1
}
@Override
Boolean isEnabled() {
return job?.isEnabled()
}
@Override
Runnable getRunnable() {
return job?.getInstance()?.runnable
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy