br.com.caelum.vraptor.tasks.jobs.JobProviders Maven / Gradle / Ivy
package br.com.caelum.vraptor.tasks.jobs;
import java.util.List;
import org.quartz.Job;
import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.PrototypeScoped;
import br.com.caelum.vraptor.tasks.jobs.simple.DefaultJobProvider;
@Component
@PrototypeScoped
public class JobProviders {
private final List providers;
public JobProviders(List providers) {
this.providers = providers;
}
public JobProvider getProvider(Class extends Job> job){
for(JobProvider provider : providers){
if(provider.canProvide(job))
return provider;
}
return new DefaultJobProvider();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy