/** * Called to give the ClassLoadHelper a chance to initialize itself, * including the opportunity to "steal" the class loader off of the calling * thread, which is the thread that is initializing Quartz. */ public void initialize() { loadHelpers = new LinkedList<ClassLoadHelper>(); loadHelpers.add(new LoadingLoaderClassLoadHelper()); loadHelpers.add(new SimpleClassLoadHelper()); loadHelpers.add(new ThreadContextClassLoadHelper()); loadHelpers.add(new InitThreadContextClassLoadHelper()); for(ClassLoadHelper loadHelper: loadHelpers) { loadHelper.initialize(); } }
/** * Enable sharing of the "best" class-loader with 3rd party. * * @return the class-loader user be the helper. */ public ClassLoader getClassLoader() { return (this.bestCandidate == null) ? Thread.currentThread().getContextClassLoader() : this.bestCandidate.getClassLoader(); }
/** * Returns an <code>URL</code> from the fileName as a resource. * * @param fileName * file name. * @return an <code>URL</code> from the fileName as a resource. */ protected URL getURL(String fileName) { return classLoadHelper.getResource(fileName); }
loadHelper.initialize(); jmxScheduler = (RemoteMBeanScheduler)loadHelper.loadClass(jmxProxyClass) .newInstance(); } catch (Exception e) { if(jobFactoryClass != null) { try { jobFactory = (JobFactory) loadHelper.loadClass(jobFactoryClass) .newInstance(); } catch (Exception e) { if(instanceIdGeneratorClass != null) { try { instanceIdGenerator = (InstanceIdGenerator) loadHelper.loadClass(instanceIdGeneratorClass) .newInstance(); } catch (Exception e) { tp = (ThreadPool) loadHelper.loadClass(tpClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("ThreadPool class '" js = (JobStore) loadHelper.loadClass(jsClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("JobStore class '" + jsClass if (lockHandlerClass != null) { try { Semaphore lockHandler = (Semaphore)loadHelper.loadClass(lockHandlerClass).newInstance();
/** * Returns an <code>InputStream</code> from the fileName as a resource. * * @param fileName * file name. * @return an <code>InputStream</code> from the fileName as a resource. */ protected InputStream getInputStream(String fileName) { return this.classLoadHelper.getResourceAsStream(fileName); }
loadHelper.initialize(); jmxScheduler = (RemoteMBeanScheduler)loadHelper.loadClass(jmxProxyClass) .newInstance(); } catch (Exception e) { if(jobFactoryClass != null) { try { jobFactory = (JobFactory) loadHelper.loadClass(jobFactoryClass) .newInstance(); } catch (Exception e) { if(instanceIdGeneratorClass != null) { try { instanceIdGenerator = (InstanceIdGenerator) loadHelper.loadClass(instanceIdGeneratorClass) .newInstance(); } catch (Exception e) { tp = (ThreadPool) loadHelper.loadClass(tpClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("ThreadPool class '" js = (JobStore) loadHelper.loadClass(jsClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("JobStore class '" + jsClass if (lockHandlerClass != null) { try { Semaphore lockHandler = (Semaphore)loadHelper.loadClass(lockHandlerClass).newInstance();
/** * Returns an <code>InputStream</code> from the fileName as a resource. * * @param fileName * file name. * @return an <code>InputStream</code> from the fileName as a resource. */ protected InputStream getInputStream(String fileName) { return this.classLoadHelper.getResourceAsStream(fileName); }
/** * Called to give the ClassLoadHelper a chance to initialize itself, * including the opportunity to "steal" the class loader off of the calling * thread, which is the thread that is initializing Quartz. */ public void initialize() { loadHelpers = new LinkedList<ClassLoadHelper>(); loadHelpers.add(new LoadingLoaderClassLoadHelper()); loadHelpers.add(new SimpleClassLoadHelper()); loadHelpers.add(new ThreadContextClassLoadHelper()); loadHelpers.add(new InitThreadContextClassLoadHelper()); for(ClassLoadHelper loadHelper: loadHelpers) { loadHelper.initialize(); } }
loadHelper.initialize(); jmxScheduler = (RemoteMBeanScheduler)loadHelper.loadClass(jmxProxyClass) .newInstance(); } catch (Exception e) { if(jobFactoryClass != null) { try { jobFactory = (JobFactory) loadHelper.loadClass(jobFactoryClass) .newInstance(); } catch (Exception e) { if(instanceIdGeneratorClass != null) { try { instanceIdGenerator = (InstanceIdGenerator) loadHelper.loadClass(instanceIdGeneratorClass) .newInstance(); } catch (Exception e) { tp = (ThreadPool) loadHelper.loadClass(tpClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("ThreadPool class '" js = (JobStore) loadHelper.loadClass(jsClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("JobStore class '" + jsClass if (lockHandlerClass != null) { try { Semaphore lockHandler = (Semaphore)loadHelper.loadClass(lockHandlerClass).newInstance();
Class<?> trigDelClass = classLoadHelper.loadClass(trigDelClassName); addTriggerPersistenceDelegate((TriggerPersistenceDelegate) trigDelClass.newInstance()); } catch (Exception e) {
/** * Enable sharing of the "best" class-loader with 3rd party. * * @return the class-loader user be the helper. */ public ClassLoader getClassLoader() { return (this.bestCandidate == null) ? Thread.currentThread().getContextClassLoader() : this.bestCandidate.getClassLoader(); }
/** * Returns an <code>URL</code> from the fileName as a resource. * * @param fileName * file name. * @return an <code>URL</code> from the fileName as a resource. */ protected URL getURL(String fileName) { return classLoadHelper.getResource(fileName); }
/** * Finds a resource with a given name. This method returns null if no * resource with this name is found. * @param name name of the desired resource * @return a java.io.InputStream object */ public InputStream getResourceAsStream(String name) { InputStream result = null; if (bestCandidate != null) { result = bestCandidate.getResourceAsStream(name); if(result == null) { bestCandidate = null; } else { return result; } } ClassLoadHelper loadHelper = null; Iterator<ClassLoadHelper> iter = loadHelpers.iterator(); while (iter.hasNext()) { loadHelper = iter.next(); result = loadHelper.getResourceAsStream(name); if (result != null) { break; } } bestCandidate = loadHelper; return result; }
if (this.jobSchedulingDataLocations != null) { ClassLoadHelper clh = new ResourceLoaderClassLoadHelper(this.resourceLoader); clh.initialize(); XMLSchedulingDataProcessor dataProcessor = new XMLSchedulingDataProcessor(clh); for (String location : this.jobSchedulingDataLocations) {
loadHelper.initialize(); jmxScheduler = (RemoteMBeanScheduler)loadHelper.loadClass(jmxProxyClass) .newInstance(); } catch (Exception e) { if(jobFactoryClass != null) { try { jobFactory = (JobFactory) loadHelper.loadClass(jobFactoryClass) .newInstance(); } catch (Exception e) { if(instanceIdGeneratorClass != null) { try { instanceIdGenerator = (InstanceIdGenerator) loadHelper.loadClass(instanceIdGeneratorClass) .newInstance(); } catch (Exception e) { tp = (ThreadPool) loadHelper.loadClass(tpClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("ThreadPool class '" js = (JobStore) loadHelper.loadClass(jsClass).newInstance(); } catch (Exception e) { initException = new SchedulerException("JobStore class '" + jsClass if (lockHandlerClass != null) { try { Semaphore lockHandler = (Semaphore)loadHelper.loadClass(lockHandlerClass).newInstance();
Class<?> trigDelClass = classLoadHelper.loadClass(trigDelClassName); addTriggerPersistenceDelegate((TriggerPersistenceDelegate) trigDelClass.newInstance()); } catch (Exception e) {
/** * Enable sharing of the class-loader with 3rd party (e.g. digester). * * @return the class-loader user be the helper. */ public ClassLoader getClassLoader() { return (this.bestCandidate == null) ? Thread.currentThread().getContextClassLoader() : this.bestCandidate.getClassLoader(); }
/** * Finds a resource with a given name. This method returns null if no * resource with this name is found. * @param name name of the desired resource * @return a java.net.URL object */ public URL getResource(String name) { URL result = null; if (bestCandidate != null) { result = bestCandidate.getResource(name); if(result == null) { bestCandidate = null; } else { return result; } } ClassLoadHelper loadHelper = null; Iterator<ClassLoadHelper> iter = loadHelpers.iterator(); while (iter.hasNext()) { loadHelper = iter.next(); result = loadHelper.getResource(name); if (result != null) { break; } } bestCandidate = loadHelper; return result; }