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

br.com.caelum.vraptor.tasks.jobs.JobProviders Maven / Gradle / Ivy

There is a newer version: 4.3.1
Show newest version
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 job){
		
		for(JobProvider provider : providers){
			if(provider.canProvide(job))
				return provider;
		}
		
		return new DefaultJobProvider();
		
	}	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy