All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nz.ac.auckland.jobs.periodic.depr.WrapperFactory.groovy Maven / Gradle / Ivy

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