Refresh {@link ExtensionList}s by adding all the newly discovered extensions.

Exposed only for {@link PluginManager#dynamicLoad(File)}.
514207
public void refreshExtensions() throws ExtensionRefreshException {
        ExtensionList<ExtensionFinder> finders = getExtensionList(ExtensionFinder.class);
        for (ExtensionFinder ef : finders) {
            if (!ef.isRefreshable())
                throw new ExtensionRefreshException(ef+" doesn't support refresh");
        }

        List<ExtensionComponentSet> fragments = Lists.newArrayList();
        for (ExtensionFinder ef : finders) {
            fragments.add(ef.refresh());
        }
        ExtensionComponentSet delta = ExtensionComponentSet.union(fragments).filtered();

        // if we find a new ExtensionFinder, we need it to list up all the extension points as well
        List<ExtensionComponent<ExtensionFinder>> newFinders = Lists.newArrayList(delta.find(ExtensionFinder.class));
        while (!newFinders.isEmpty()) {
            ExtensionFinder f = newFinders.remove(newFinders.size()-1).getInstance();

            ExtensionComponentSet ecs = ExtensionComponentSet.allOf(f).filtered();
            newFinders.addAll(ecs.find(ExtensionFinder.class));
            delta = ExtensionComponentSet.union(delta, ecs);
        }

        for (ExtensionList el : extensionLists.values()) {
            el.refresh(delta);
        }
        for (ExtensionList el : descriptorLists.values()) {
            el.refresh(delta);
        }

        // TODO: we need some generalization here so that extension points can be notified when a refresh happens?
        for (ExtensionComponent<RootAction> ea : delta.find(RootAction.class)) {
            Action a = ea.getInstance();
            if (!actions.contains(a)) actions.add(a);
        }
    }
747344
protected void addCachedExtension(E extension)
    {
        if (!this.extensions.containsKey(extension.getId())) {
            // extensions
            this.extensions.put(extension.getId(), extension);

            // versions
            addCachedExtensionVersion(extension.getId().getId(), extension);
            if (!this.strictId) {
                for (String feature : extension.getFeatures()) {
                    addCachedExtensionVersion(feature, extension);
                }
            }
        }
    }
54114
private static Object loadExtension(Extension extension, ClassLoaderPlugin classLoaderPlugin)
   {
      try
      {
         Class<?> c = classLoaderPlugin.loadClass(extension.getClassName(),
               extension.getModuleName(), extension.getModuleSlot());
         return c.newInstance();
      }
      catch (Throwable t)
      {
         log.tracef("Throwable while loading %s using own classloader: %s", extension.getClassName(), t.getMessage());
      }

      return null;
   }
999748
@Nonnull
  public FineUploader5Validation addAllowedExtensions (@Nullable final Collection <String> aAllowedExtensions)
  {
    if (aAllowedExtensions != null)
      m_aValidationAllowedExtensions.addAll (aAllowedExtensions);
    return this;
  }
847019
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz, ExtensionLoaderListener<T> listener) {
        ExtensionLoader<T> loader = LOADER_MAP.get(clazz);
        if (loader == null) {
            synchronized (ExtensionLoaderFactory.class) {
                loader = LOADER_MAP.get(clazz);
                if (loader == null) {
                    loader = new ExtensionLoader<T>(clazz, listener);
                    LOADER_MAP.put(clazz, loader);
                }
            }
        }
        return loader;
    }
1245506
protected void addFiles(List<CmsFileInfo> fileInfos) {

        if (fileInfos != null) {
            for (CmsFileInfo file : fileInfos) {

                // store all files
                m_allFiles.put(file.getFileName(), file);

                // add those files to the list of files to upload that potential candidates
                if (!isTooLarge(file) && (file.getFileSize() != 0)) {
                    m_filesToUpload.put(file.getFileName(), file);
                }

                // remove those files from the list to upload that were previously unchecked by the user
                if ((m_listItems.get(file.getFileName()) != null)
                    && (m_listItems.get(file.getFileName()).getCheckBox() != null)
                    && !m_listItems.get(file.getFileName()).getCheckBox().isChecked()) {
                    m_filesToUpload.remove(file.getFileName());
                }
            }

            // now rebuild the list: handle all files
            m_fileList.clearList();
            List<String> sortedFileNames = new ArrayList<String>(m_allFiles.keySet());
            Collections.sort(sortedFileNames, String.CASE_INSENSITIVE_ORDER);
            for (String filename : sortedFileNames) {
                CmsFileInfo file = m_allFiles.get(filename);
                addFileToList(file, false, false, isTooLarge(file));
            }
            doResize();
        }
        loadAndShow();
    }
897581
private void registerExtensions() {
    Iterator<Cache2kExtensionProvider> it =
      ServiceLoader.load(Cache2kExtensionProvider.class, CacheManager.class.getClassLoader()).iterator();
    while (it.hasNext()) {
      try {
        it.next().registerCache2kExtension();
      } catch (ServiceConfigurationError ex) {
        Log.getLog(CacheManager.class.getName()).debug("Error loading cache2k extension", ex);
      }
    }
  }
816192
public <T extends Assignable> ServiceExtensionLoader addOverride(final Class<T> extensionClass,
        final Class<? extends T> extensionImplClass) {
        addToCache(extensionClass, extensionImplClass);
        return this;
    }
561560
def refresh( self ):
        
        self.clear()
        
        for i, filename in enumerate(self.filenames()):
            name   = '%i. %s' % (i+1, os.path.basename(filename))
            action = self.addAction(name)
            action.setData(wrapVariant(filename))
550098
private synchronized void reloadSharedFunctionSourceList() {
		Map<String, Define> newMap = createSharedFunctionMap();
		for (int i = 0, size = sharedFunctionSourceList.size(); i < size; i++) {
			ISource source = sharedFunctionSourceList.get(i);
			String fileName = source instanceof FileSource ? ((FileSource)source).getFileName() : null;
			
			Env env = new Env(this);
			new Parser(env, source.getContent(), fileName).parse();
			addToSharedFunctionMap(newMap, env);
			if (devMode) {
				env.addSource(source);
			}
		}
		this.sharedFunctionMap = newMap;
	}
930304
public void load() {
        Stopwatchs.start("Load Plugins");

        classLoaders.clear();

        final ServletContext servletContext = AbstractServletListener.getServletContext();
        final Set<String> pluginDirPaths = servletContext.getResourcePaths("/plugins");

        final List<AbstractPlugin> plugins = new ArrayList<>();

        if (null != pluginDirPaths) {
            for (final String pluginDirPath : pluginDirPaths) {
                try {
                    LOGGER.log(Level.INFO, "Loading plugin under directory[{0}]", pluginDirPath);

                    final AbstractPlugin plugin = load(pluginDirPath, pluginCache);

                    if (plugin != null) {
                        plugins.add(plugin);
                    }
                } catch (final Exception e) {
                    LOGGER.log(Level.WARN, "Load plugin under directory[" + pluginDirPath + "] failed", e);
                }
            }
        }

        eventManager.fireEventSynchronously(new Event<>(PLUGIN_LOADED_EVENT, plugins));

        Stopwatchs.end();
    }
705255
public void updateAndRestart(ClassLoaderFiles files) {
		Set<URL> urls = new LinkedHashSet<>();
		Set<URL> classLoaderUrls = getClassLoaderUrls();
		for (SourceFolder folder : files.getSourceFolders()) {
			for (Entry<String, ClassLoaderFile> entry : folder.getFilesEntrySet()) {
				for (URL url : classLoaderUrls) {
					if (updateFileSystem(url, entry.getKey(), entry.getValue())) {
						urls.add(url);
					}
				}
			}
			urls.addAll(getMatchingUrls(classLoaderUrls, folder.getName()));
		}
		updateTimeStamp(urls);
		restart(urls, files);
	}
152205
@StaplerDispatchable
    public ExtensionList getExtensionList(String extensionType) throws ClassNotFoundException {
        return getExtensionList(pluginManager.uberClassLoader.loadClass(extensionType));
    }
169085
public List<ExtensionElement> getExtendedInfoAsList() {
        List<ExtensionElement> res = null;
        if (extendedInfo != null) {
            res = new ArrayList<>(1);
            res.add(extendedInfo);
        }
        return res;
    }
1353805
private void scanExtensions(List<T> factories, String extensionsDir) {
    LOG.info("Loading extension jars from {}", extensionsDir);
    scan(Arrays.asList(ExtensionUtils.listExtensions(extensionsDir)), factories);
  }
1201316
public void refreshSchemaAll() {
		//TODO we don't have a database lock here!
		for (ZooClassDef def: cache.getSchemata()) {
			def.jdoZooGetNode().refreshSchema(def);
			def.getProvidedContext().getIndexer().refreshWithSchema(def);
			def.associateJavaTypes(false, true);
		}
	}
435169
public static void allPluginsLoaded() {
		StringBuilder s = new StringBuilder(1024);
		s.append("Extension points:");
		synchronized (points) {
			for (ExtensionPoint<?> ep : points)
				ep.allPluginsLoaded();
			for (ExtensionPoint<?> ep : points) {
				s.append("\r\n- ");
				ep.printInfo(s);
			}
			points.trimToSize();
		}
		synchronized (customs) {
			for (Iterator<CustomExtensionPoint> it = customs.iterator(); it.hasNext(); ) {
				CustomExtensionPoint ep = it.next();
				s.append("\r\n- ");
				ep.printInfo(s);
				if (!ep.keepAfterInit())
					it.remove();
			}
			customs.trimToSize();
		}
		LCCore.getApplication().getDefaultLogger().info(s.toString());
		logRemainingPlugins();
	}