@SuppressWarnings("unchecked") public <T> Class<? extends T> loadClass(String name, Class<T> clazz) throws ClassNotFoundException { return (Class<? extends T>) loadClass(name); }
ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();
/** * A simple factory method that automatically initialize a new CascadingClassLoadHelper and * pass to XmlJobLoader. */ public static XmlJobLoader newInstance() { CascadingClassLoadHelper clhelper = new CascadingClassLoadHelper(); clhelper.initialize(); // we must initialize this first! try { return new XmlJobLoader(clhelper); } catch (ParserConfigurationException e) { throw new QuartzRuntimeException("Failed to construct XmlJobLoader.", e); } }
ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();
PreparedStatement ps = null; CascadingClassLoadHelper cascadingClassLoadHelper = new CascadingClassLoadHelper(); cascadingClassLoadHelper.initialize(); ResultSet rs = null; try {
public void init() throws ParserConfigurationException, XPathException, ParseException, IOException, ValidationException, SchedulerException, SAXException, ClassNotFoundException { boolean noFiles = files == null || files.isEmpty(); if (noFiles || !schedulerManager.isAutoProvisioning()) { log.info("Not auto provisioning jobs: "+ ((noFiles)?"no files.":String.join(", ", files))); return; } Scheduler scheduler = schedulerManager.getScheduler(); ClassLoadHelper clh = new CascadingClassLoadHelper(); clh.initialize(); for (String file : files ) { XMLSchedulingDataProcessor proc = new XMLSchedulingDataProcessor(clh); InputStream in = getClass().getResourceAsStream(file); if (in == null) { throw new IllegalArgumentException("Couldn't find resource on classpath: "+ file); } try { proc.processStreamAndScheduleJobs(in, file, scheduler); log.info("Successfully provisioned jobs/triggers from :"+ file); } catch (ObjectAlreadyExistsException e) { log.info("Not fully processing: "+ file+ " because some parts already exist"); } } }
@SuppressWarnings("unchecked") public <T> Class<? extends T> loadClass(String name, Class<T> clazz) throws ClassNotFoundException { return (Class<? extends T>) loadClass(name); }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler) throws SchedulerException { super.initialize(name, scheduler); classLoadHelper = new CascadingClassLoadHelper(); classLoadHelper.initialize(); getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }
private QuartzJobDetail makeJobDetail(CascadingClassLoadHelper cascadingClassLoadHelper, ResultSet rs) throws SQLException, ClassNotFoundException, IOException { JobDetailImpl jobDetail = new JobDetailImpl(); String groupName = rs.getString(Constants.COL_JOB_GROUP); String jobName = rs.getString(Constants.COL_JOB_NAME); jobDetail.setName(jobName); jobDetail.setGroup(groupName); jobDetail.setDescription(rs.getString(Constants.COL_DESCRIPTION)); jobDetail.setJobClass( cascadingClassLoadHelper.loadClass(rs.getString(Constants.COL_JOB_CLASS), Job.class) ); jobDetail.setDurability(rs.getBoolean(Constants.COL_IS_DURABLE)); jobDetail.setRequestsRecovery(rs.getBoolean(Constants.COL_REQUESTS_RECOVERY)); Map<?, ?> map = (Map<?, ?>) getObjectFromBlob(rs, COL_JOB_DATAMAP); if (map != null) { jobDetail.setJobDataMap(new JobDataMap(map)); } JobId jobId = new QuartzJobId(groupName, jobName, engine.getClusterName()); QuartzJobDetail quartzJobDetail = new QuartzJobDetail(engine, jobId, jobDetail, rs.getTimestamp(WinderJDBCDelegate.COL_JOB_CREATED)); return quartzJobDetail; }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler) throws SchedulerException { super.initialize(name, scheduler); classLoadHelper = new CascadingClassLoadHelper(); classLoadHelper.initialize(); getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }
dbFailureRetryInterval); ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();
dbFailureRetryInterval); ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();
QuartzScheduler qs = new QuartzScheduler(qrs, -1, -1); ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();
QuartzScheduler qs = new QuartzScheduler(qrs, -1, -1); ClassLoadHelper cch = new CascadingClassLoadHelper(); cch.initialize();