在配置文件变更时自动加载

@param autoReload 是否自动加载
551823
public void autoLoad(boolean autoReload) {
		if (autoReload) {
			Assert.notNull(this.propertiesFileUrl, "Properties URL is null !");
			if (null != this.watchMonitor) {
				// 先关闭之前的监听
				this.watchMonitor.close();
			}
			this.watchMonitor = WatchUtil.createModify(this.propertiesFileUrl, new SimpleWatcher(){
				@Override
				public void onModify(WatchEvent<?> event, Path currentPath) {
					load();
				}
			});
			this.watchMonitor.start();
		} else {
			IoUtil.close(this.watchMonitor);
			this.watchMonitor = null;
		}
	}
672645
public function autodiscover(): void
    {
        $entityMappings = [];
        foreach ($this->fileSystem->getEntityDirectories() as $entityDirectory) {
            $namespace = $this->namespaceDetector->detectFromDirectory($entityDirectory);
            if (! $namespace) {
                continue;
            }

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'annotation',
                'dir' => $entityDirectory->getRealPath(),
                'is_bundle' => false, // performance
            ];
        }

        $xmlNamespaces = [];

        $directoryByNamespace = $this->resolveDirectoryByNamespace($this->fileSystem->getEntityXmlFiles());
        foreach ($directoryByNamespace as $namespace => $directory) {
            if (in_array($namespace, $xmlNamespaces, true)) {
                continue;
            }

            $xmlNamespaces[] = $namespace;

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'xml',
                'dir' => $directory,
                'is_bundle' => false,
            ];
        }

        if (! count($entityMappings)) {
            return;
        }

        // @see https://symfony.com/doc/current/reference/configuration/doctrine.html#mapping-entities-outside-of-a-bundle
        $this->containerBuilder->prependExtensionConfig('doctrine', [
            'orm' => ['mappings' => $entityMappings],
        ]);
    }
1201835
private void addCP() throws DependencyResolutionRequiredException, MalformedURLException, InvocationTargetException, NoSuchMethodException, IllegalAccessException {
        List runtimeClasspathElements = project.getRuntimeClasspathElements();

        for (Object runtimeClasspathElement : runtimeClasspathElements) {
            String element = (String) runtimeClasspathElement;
            addUrl(new File(element).toURI().toURL());
        }
    }
494116
private function initialize()
    {

        if (is_file($file = getcwd().'/vendor/autoload.php')) {
            include_once $file;
        }
        $functions = spl_autoload_functions();
        foreach ($functions as $loader) {
            if (is_array($loader)) {
                $ob = $loader[0];
                if (is_object($ob)) {
                    $this->addAutoloader($ob);
                }
            }
        }
    }
1070734
public synchronized void addWeakListener(L listener) {
    Preconditions.checkNotNull(listener);

    _log.info("Adding a weak listener " + listener);
    _autoListeners.put(listener, null);
  }
1017897
function (resourcesHandler) {
                if (ariaUtilsType.isString(resourcesHandler)) {
                    resourcesHandler = loadResourcesHandler(resourcesHandler, this);
                    this._autoDisposeHandler = true;
                }
                this._resourcesHandler = resourcesHandler;
            }
860826
protected function register_autoload() {
        $src_dir = $this->get_src_path();

        if ( file_exists( $src_dir ) ) {
            register_wp_autoload( $this->options->namespace, $src_dir );
        }
    }
752040
public function autoload_init()
	{
		$this->init();
		// Addons
		for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
			$this->addons[$i]->init();
		}
	}
59090
@Override
  public void initializeFromFile(TreeIndexHeader header, PageFile<FlatRStarTreeNode> file) {
    super.initializeFromFile(header, file);

    // reconstruct root
    int nextPageID = file.getNextPageID();
    dirCapacity = nextPageID;
    root = createNewDirectoryNode();
    for(int i = 1; i < nextPageID; i++) {
      FlatRStarTreeNode node = getNode(i);
      root.addDirectoryEntry(createNewDirectoryEntry(node));
    }

    if(LOG.isDebugging()) {
      LOG.debugFine("root: " + root + " with " + nextPageID + " leafNodes.");
    }
  }
94091
function init(domainManager) {
        if (!domainManager.hasDomain("AutoUpdate")) {
            domainManager.registerDomain("AutoUpdate", {
                major: 0,
                minor: 1
            });
        }
        _domainManager = domainManager;

        domainManager.registerCommand(
            "AutoUpdate",
            "initNode",
            initNode,
            true,
            "Initializes node for the auto update",
            [
                {
                    name: "initObj",
                    type: "object",
                    description: "json object containing init information"
                }
            ],
            []
        );

        domainManager.registerCommand(
            "AutoUpdate",
            "data",
            receiveMessageFromBrackets,
            true,
            "Receives messages from brackets",
            [
                {
                    name: "msgObj",
                    type: "object",
                    description: "json object containing message info"
                }
            ],
            []
        );

        domainManager.registerEvent(
            "AutoUpdate",
            "data",
            [
                {
                    name: "msgObj",
                    type: "object",
                    description: "json object containing message info to pass to brackets"
                }
            ]
        );
    }
1026222
public static void enableAutoExpansion(final JTree tree) {

    tree.getModel().addTreeModelListener(new TreeModelListener() {

      public void treeNodesChanged(TreeModelEvent e) {
        // nothing to do
      }

      public void treeNodesInserted(TreeModelEvent e) {
        tree.expandPath(e.getTreePath());
      }

      public void treeNodesRemoved(TreeModelEvent e) {
        // nothing to do
      }

      public void treeStructureChanged(TreeModelEvent e) {
        // nothing to do
      }

    });

  }
1338422
private void addInstalledExtension(DefaultInstalledExtension installedExtension, String namespace)
    {
        addCachedExtension(installedExtension);

        boolean isValid = installedExtension.isValid(namespace);

        // Register the extension in the installed extensions for the provided namespace
        addInstalledFeatureToCache(installedExtension.getId(), namespace, installedExtension, isValid);

        // Add virtual extensions
        for (ExtensionId feature : installedExtension.getExtensionFeatures()) {
            addInstalledFeatureToCache(feature, namespace, installedExtension, isValid);
        }

        if (this.updateBackwardDependencies) {
            // Recalculate backward dependencies index
            updateMissingBackwardDependencies();
        }
    }
732974
public void onReload(final Container _container)
    {
        final Set<Class<?>> classesToRemove = new HashSet<>();
        final Set<Class<?>> classesToAdd = new HashSet<>();

        for (final Class<?> c : getClasses()) {
            if (!this.cachedClasses.contains(c)) {
                classesToAdd.add(c);
            }
        }

        for (final Class<?> c : this.cachedClasses) {
            if (!getClasses().contains(c)) {
                classesToRemove.add(c);
            }
        }

        getClasses().clear();

        init();

        getClasses().addAll(classesToAdd);
        getClasses().removeAll(classesToRemove);
    }
1060704
@FFDCIgnore(ClassCastException.class)
    void autoBind(WSName subname, Object obj) throws InvalidNameException, NotContextException, NameAlreadyBoundException {
        ContextNode target = this, parent = this;
        int i = 0;
        try {
            for (/* int i = 0 */; i < subname.size() - 1; i++) {
                String elem = subname.get(i);
                target = (ContextNode) target.children.get(elem);
                // create an auto-deleteable subcontext
                if (target == null) {
                    target = new ContextNode(parent, elem, true);
                    Object existingEntry = parent.children.putIfAbsent(elem, target);
                    if (existingEntry != null) {
                        // another thread just beat me to it creating this entry
                        // assume it is a context and continue
                        target = (ContextNode) existingEntry;
                    }
                }
                parent = target;
            }
        } catch (ClassCastException e) {
            throw new NotContextException("" + fullName.plus(subname.getPrefix(i + 1)));
        }
        // allow multiple entries during invocation by JndiServiceBinder
        boolean replaced = false;
        String lastName = subname.getLast();
        AutoBindNode abNode = new AutoBindNode(obj);
        while (!replaced) {
            Object oldObj = target.children.putIfAbsent(lastName, abNode);
            if (oldObj != null) {
                if (oldObj instanceof AutoBindNode) {
                    abNode = (AutoBindNode) oldObj;
                    // This synch ensures that addition of entries to an 
                    // AutoBindNode does not take place during removal of 
                    // the same AutoBindNode.
                    synchronized (abNode) {
                        abNode.addLastEntry(obj);
                        // This is a no-op in the normal case, but if we're racing an unbind, 
                        // we might need to modify a different AutoBindNode
                        replaced = target.children.replace(lastName, oldObj, abNode);
                    }
                } else {
                    throw new NameAlreadyBoundException("" + fullName.plus(lastName));
                }
            } else {
                replaced = true;
            }
        }
    }
731280
public final void addLifecycleListener(@NonNull LifecycleListener lifecycleListener) {
        if (!lifecycleListeners.contains(lifecycleListener)) {
            lifecycleListeners.add(lifecycleListener);
        }
    }
978114
public function autoloadServerAnnotation()
    {
        $bootScan = $this->getScanNamespaceFromProperties('bootScan');
        $resource = new ServerAnnotationResource($this->properties);
        $resource->addScanNamespace($bootScan);
        $definitions = $resource->getDefinitions();

        $this->definitions = array_merge($definitions, $this->definitions);
    }
359527
private void initFromSPIServiceLoader() {

        String property = System.getProperty("druid.load.spifilter.skip");
        if (property != null) {
            return;
        }

        ServiceLoader<Filter> druidAutoFilterLoader = ServiceLoader.load(Filter.class);

        for (Filter autoFilter : druidAutoFilterLoader) {
            AutoLoad autoLoad = autoFilter.getClass().getAnnotation(AutoLoad.class);
            if (autoLoad != null && autoLoad.value()) {
                if (LOG.isInfoEnabled()) {
                    LOG.info("load filter from spi :" + autoFilter.getClass().getName());
                }
                addFilter(autoFilter);
            }
        }
    }