Created
July 16, 2012 07:53
-
-
Save rtrcolin/3121429 to your computer and use it in GitHub Desktop.
Quartz Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.yammer.dropwizard.config.Configuration; | |
... | |
public class QuartzConfiguration extends Configuration { | |
@Valid | |
@JsonProperty | |
private Map<String,String> quartzSettings = new HashMap<String, String>(); | |
public Properties getSchedulerFactoryProperties(){ | |
Properties sfProps = new Properties(); | |
// Fixed Quartz settings. They could easily be added to the YAML config file | |
sfProps.setProperty("org.quartz.plugin.jobInitializer.class", "org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin"); | |
sfProps.setProperty("org.quartz.plugin.jobInitializer.failOnFileNotFound", "true"); | |
// Job XML files can be changed without restarting the service by being check at regular intervals | |
sfProps.setProperty("org.quartz.plugin.jobInitializer.scanInterval", "0"); | |
sfProps.setProperty("org.quartz.plugin.jobInitializer.wrapInUserTransaction", "false"); | |
// Quartz checks for updates. This should be turned off for production systems. | |
sfProps.setProperty("org.quartz.scheduler.skipUpdateCheck","true"); | |
// Quartz settings configured in YML file | |
sfProps.setProperty("org.quartz.scheduler.instanceName", quartzSettings.get("instanceName")); | |
sfProps.setProperty("org.quartz.threadPool.class", quartzSettings.get("threadPoolClass")); | |
sfProps.setProperty("org.quartz.threadPool.threadCount", quartzSettings.get("threadCount")); | |
sfProps.setProperty("org.quartz.threadPool.threadPriority", quartzSettings.get("threadPriority")); | |
sfProps.setProperty("org.quartz.jobStore.class", quartzSettings.get("jobStoreClass")); | |
sfProps.setProperty("org.quartz.plugin.jobInitializer.fileNames", quartzSettings.get("jobFiles")); | |
return sfProps; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment