public Class loadClass(String name) throws ClassNotFoundException { return isAccepted(name) ? delegate.loadClass(name) : parent.loadClass(name); }
public void refresh() throws BeansException, IllegalStateException { if (classLoader != null) { classLoader.reload(); } super.refresh(); }
public void setupReloading(String[] watchList, String acceptClasses, ServletContext servletContext, boolean reloadConfig) { this.reloadConfig = reloadConfig; classLoader = new ReloadingClassLoader(ClassReloadingXMLWebApplicationContext.class.getClassLoader()); patterns.add(Pattern.compile(pattern)); classLoader.setAccepClasses(patterns); classLoader.addResourceStore(new JarResourceStore(file)); getAllPaths(file, dirs); classLoader.addResourceStore(new FileResourceStore(file));
protected void initReloadClassLoader() { //when the configuration is reloaded, a new classloader will be setup if (isReloadEnabled() && reloadingClassLoader == null) reloadingClassLoader = new ReloadingClassLoader(getClassLoader()); }
protected void initReloadClassLoader() { // when the configuration is reloaded, a new classloader will be setup if (isReloadEnabled() && reloadingClassLoader == null) reloadingClassLoader = new ReloadingClassLoader(getClassLoader()); }
ReloadingClassLoader classloader = new ReloadingClassLoader(this.getClass().getClassLoader()); ReloadingListener listener = new ReloadingListener(); listener.addReloadNotificationListener(classloader); FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor(); fam.addListener(directory, listener); fam.start();
private void reload(File file) { if (classLoader != null) { LOG.debug("Change detected in file [{}], reloading class loader", file.getAbsolutePath()); classLoader.reload(); if (reloadConfig && Dispatcher.getInstance() != null) { LOG.debug("Change detected in file [{}], reloading configuration", file.getAbsolutePath()); Dispatcher.getInstance().getConfigurationManager().reload(); } } }