*
* @param properties Properties
*/
public void init(Properties properties) {
StdSchedulerFactory sf = new StdSchedulerFactory();
if (properties != null) {
String quartzConf = properties.getProperty(QUARTZ_CONF);
try {
if (quartzConf != null && !"".equals(quartzConf)) {
if (log.isDebugEnabled()) {
log.debug("Initiating a Scheduler with configuration : " + quartzConf);
}
sf.initialize(quartzConf);
}
} catch (SchedulerException e) {
throw new SynapseTaskException("Error initiating scheduler factory "
+ sf + "with configuration loaded from " + quartzConf, e, log);
}
}
try {
if (name != null) {
scheduler = sf.getScheduler(name);
}
if (scheduler == null) {
scheduler = sf.getScheduler();
}
} catch (SchedulerException e) {
throw new SynapseTaskException("Error getting a scheduler instance form scheduler" +
" factory " + sf, e, log);