/* (non-Javadoc)
@see com.jdon.container.factory.ContainerLoader#loadAllContainerConfig(com.jdon.controller.context.AppContextWrapper)
426734
public ContainerComponents loadAllContainerConfig(AppContextWrapper context) {
		Debug.logVerbose("[JdonFramework] 1. read container components from:" + DEFAULT_CONTAINER_CONFIGURE_FILENAME, module);
		ContainerComponents configComponents = loadBasicComponents(DEFAULT_CONTAINER_CONFIGURE_FILENAME);
		loadContextContainerConfig(configComponents, context);
		loadUserContainerConfig(configComponents, context);
		return configComponents;
	}
182019
@Override
    public Iterable<Object> loadAllKeys() {
        if (isMapLoader()) {
            Iterable<Object> allKeys;
            try {
                allKeys = mapLoader.loadAllKeys();
            } catch (AbstractMethodError e) {
                // Invoke reflectively to preserve backwards binary compatibility. Removable in v4.x
                allKeys = ReflectionHelper.invokeMethod(mapLoader, "loadAllKeys");
            }
            return allKeys;
        }
        return null;
    }
155605
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->getConfig($this->defaults);

		$reader = $builder->addDefinition($this->prefix('delegatedReader'))
			->setFactory(AnnotationReader::class)
			->setAutowired(false);

		foreach ((array) $config['ignore'] as $annotationName) {
			$reader->addSetup('addGlobalIgnoredName', [$annotationName]);
			AnnotationReader::addGlobalIgnoredName($annotationName);
		}

		$this->loadCacheConfiguration();

		$builder->addDefinition($this->prefix('reader'))
			->setType(Reader::class)
			->setFactory(CachedReader::class, [
				$this->prefix('@delegatedReader'),
				$this->prefix('@cache'),
				$config['debug'],
			]);

		AnnotationRegistry::registerUniqueLoader('class_exists');
	}
461351
private List<I_CmsWorkplaceAppConfiguration> loadAppsUsingServiceLoader() {

        List<I_CmsWorkplaceAppConfiguration> appConfigurations = new ArrayList<I_CmsWorkplaceAppConfiguration>();
        Iterator<I_CmsWorkplaceAppConfiguration> configs = ServiceLoader.load(
            I_CmsWorkplaceAppConfiguration.class).iterator();
        while (configs.hasNext()) {
            try {
                I_CmsWorkplaceAppConfiguration config = configs.next();
                appConfigurations.add(config);
            } catch (Throwable t) {
                LOG.error("Error loading workplace app configuration from classpath.", t);
            }
        }
        return appConfigurations;
    }
447667
public void init(ClassLoader loader, ContextSource[] contextSources, boolean profilingEnabled)
        throws Exception {

        init(loader, contextSources, null, profilingEnabled);
    }
356824
private Container getContainer(final GeneratorContext context) {
		List<Container> containers = StartupUtil
				.getAllPublishedContainers(context.getServletContext());
		// TODO: here we assume there is only one DWR Servlet / Container ... we
		// should find a way to math the container with the DWR mapping config
		for (Container container : containers) {
			return container;
		}
		throw new RuntimeException("FATAL: unable to find DWR Container!");
	}
1204800
public ContainerWrapper findContainer(AppContextWrapper sc) {
		ContainerRegistryBuilder cb = (ContainerRegistryBuilder) sc.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
		if (cb == null)
			cb = prepare(sc);
		launch(sc, cb);
		return cb.getContainerWrapper();
	}
1322890
@Override
    public void setApplicationContext(ApplicationContext appContext) throws BeansException {
        if (this.appContext != null) {
            throw new ApplicationContextException("Attempt to reinitialize application context.");
        }
        
        this.appContext = appContext;
    }
779898
public function loadConfiguration(): void
	{
		$this->validateConfig($this->defaults);
		$builder = $this->getContainerBuilder();

		$builder->addDefinition($this->prefix('parsedown'))
			->setFactory(ParsedownExtraAdapter::class);
	}
795884
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();

		$builder->addDefinition($this->prefix('request'))
			->setType(Psr7Request::class)
			->setFactory(Psr7RequestFactory::class . '::fromNette');

		$builder->addDefinition($this->prefix('response'))
			->setType(Psr7Response::class)
			->setFactory(Psr7ResponseFactory::class . '::fromNette');
	}
65184
private static ClusterConfig loadConfig(File config, ClassLoader classLoader) {
    return new ConfigMapper(classLoader).loadResources(ClusterConfig.class, config.getAbsolutePath());
  }
421974
public void init(ClassLoader loader,
                     ContextSource[] contextSources,
                     String[] prefixes, boolean profilingEnabled) throws Exception {


        mSources = contextSources;
        int len = contextSources.length;
        ArrayList<Class<?>> contextList = new ArrayList<Class<?>>(len);
        ArrayList<ClassLoader> delegateList = new ArrayList<ClassLoader>(len);

        for (int j = 0; j < contextSources.length; j++) {
            Class<?> type = contextSources[j].getContextType();
            if (type != null) {
                contextList.add(type);
                ClassLoader scout = type.getClassLoader();
                if (scout != null && !delegateList.contains(scout)) {
                    delegateList.add(scout);
                }
            }
        }

        mContextsInOrder = contextList.toArray(new Class[contextList.size()]);
        ClassLoader[] delegateLoaders =
            delegateList.toArray(new ClassLoader[delegateList.size()]);

        mInjector = new ClassInjector
            (new DelegateClassLoader(loader, delegateLoaders));

        mProfilingEnabled = profilingEnabled;

        int observerMode = profilingEnabled ? MergedClass.OBSERVER_ENABLED | MergedClass.OBSERVER_EXTERNAL : MergedClass.OBSERVER_ENABLED;

        // temporarily include interface for UtilityContext for backwards
        // compatibility with old code relying on it.
        Class<?>[] interfaces = { UtilityContext.class };
        mConstr = MergedClass.getConstructor2(mInjector,
                                              mContextsInOrder,
                                              prefixes,
                                              interfaces,
                                              observerMode);
    }
890513
public function loadContextInstancesByContainer(ContainerInterface $container)
    {

        // initialize the array for the context instances
        $contextInstances = array();

        // iterate over all applications and create the context configuration
        foreach (glob($container->getAppBase() . '/*', GLOB_ONLYDIR) as $webappPath) {
            $context = $this->loadContextInstance($container->getContainerNode(), $webappPath);
            $contextInstances[$context->getName()] = $context;
        }

        // return the array with the context instances
        return $contextInstances;
    }
874870
public synchronized void prepare(String configureFileName, AppContextWrapper context) {
		ContainerRegistryBuilder cb;
		try {
			cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
			if (cb == null) {
				initialized(context);
				cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
			}
			ContainerDirector cd = new ContainerDirector(cb);
			cd.prepareAppRoot(configureFileName);
		} catch (Exception ex) {
			Debug.logError(ex, module);
		}
	}
825796
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;

		if (servletContext == null)
			if (applicationContext instanceof WebApplicationContext) {
				servletContext = ((WebApplicationContext) applicationContext).getServletContext();
				if (servletContext == null) {
					System.err.print("this class only fit for Spring Web Application");
					return;
				}

			}

		// start up jdon
		AppContextWrapper acw = new ServletContextWrapper(servletContext);
		ContainerFinder containerFinder = new ContainerFinderImp();
		containerWrapper = containerFinder.findContainer(acw);

	}
914792
public static DefaultResourceConfig newApplicationConfig(UIContext context)
    {
        final Set<Object> singletons = getSingletons(context);
        final Set<Class<?>> classes = getClasses();

        return new DefaultResourceConfig()
        {
            @Override
            public Set<Class<?>> getClasses()
            {
                return classes;
            }

            @Override
            public Set<Object> getSingletons()
            {
                return singletons;
            }
        };
    }
1157838
protected Configuration[] getWebAppContextConfigurations(WebAppContext webAppContext,
			ServletContextInitializer... initializers) {
		List<Configuration> configurations = new ArrayList<>();
		configurations.add(
				getServletContextInitializerConfiguration(webAppContext, initializers));
		configurations.addAll(getConfigurations());
		configurations.add(getErrorPageConfiguration());
		configurations.add(getMimeTypeConfiguration());
		return configurations.toArray(new Configuration[0]);
	}