To avoid circular reference issues, this bean obtains its dependencies when the context
finishes starting.
551196
@EventListener
    public void init(ContextRefreshedEvent event) {
        idTokenFactory = context.getBean(IdTokenFactory.class);

        // Make sure we have a guestUsernameSelectors collection & sort it
        if (guestUsernameSelectors == null) {
            guestUsernameSelectors = Collections.emptyList();
        }
        Collections.sort(guestUsernameSelectors);
    }
379701
private void initMessageSource() {
        if (contextBeanRegistry.containsBean(MESSAGE_SOURCE_BEAN_ID)) {
            messageSource = contextBeanRegistry.getBean(MESSAGE_SOURCE_BEAN_ID, MessageSource.class);
            if (log.isDebugEnabled()) {
                log.debug("Using MessageSource [" + messageSource + "]");
            }
        } else {
            // Use empty MessageSource to be able to accept getMessage calls.
            messageSource = new DelegatingMessageSource();
            if (log.isDebugEnabled()) {
                log.debug("Unable to locate MessageSource with name '" + MESSAGE_SOURCE_BEAN_ID +
                        "': using default [" + messageSource + "]");
            }
        }
    }
338052
public void init(HttpInboundServiceContext context) {
        this.message = context.getRequest();
        if (this.useEE7Streams) {
            this.body = new HttpInputStreamEE7(context);
        } else {
            this.body = new HttpInputStreamImpl(context);
        }
    }
612560
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if( bean instanceof AuthenticationAware || bean instanceof LoginAware ) {

            // If the bean isn't a singleton, then add it to our list
            if( beanName == null || !getApplicationContext().containsBean( beanName )
                    || !getApplicationContext().isSingleton( beanName ) ) {
                addToNonSingletonListeners( bean );
            }

            // Install the last known authentication token
            if( bean instanceof AuthenticationAware ) {
                if( logger.isDebugEnabled() )
                    logger.debug( "NOTIFY bean '" + bean + "' of new authorization for '" + currentAuthentication
                            + "'" );

                AuthenticationAware aab = (AuthenticationAware) bean;
                aab.setAuthenticationToken(currentAuthentication);
            }
        }
        return bean;
    }
973932
protected void load(ApplicationContext context, Object[] sources) {
		if (logger.isDebugEnabled()) {
			logger.debug(
					"Loading source " + StringUtils.arrayToCommaDelimitedString(sources));
		}
		BeanDefinitionLoader loader = createBeanDefinitionLoader(
				getBeanDefinitionRegistry(context), sources);
		if (this.beanNameGenerator != null) {
			loader.setBeanNameGenerator(this.beanNameGenerator);
		}
		if (this.resourceLoader != null) {
			loader.setResourceLoader(this.resourceLoader);
		}
		if (this.environment != null) {
			loader.setEnvironment(this.environment);
		}
		loader.load();
	}
589607
public void initialized(AppContextWrapper context) {
		ContainerRegistryBuilder cb = (ContainerRegistryBuilder) context.getAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME);
		if (cb != null)
			return;
		try {
			synchronized (context) {
				cb = containerBuilderContext.createContainerBuilder(context);
				context.setAttribute(ContainerRegistryBuilder.APPLICATION_CONTEXT_ATTRIBUTE_NAME, cb);
				Debug.logVerbose("[JdonFramework] Initialize the container OK ..");
			}
		} catch (Exception e) {
			Debug.logError("[JdonFramework] initialized error: " + e, module);
		}
	}
1353466
private static <T> T getContextualReference(Class<T> type, BeanManager beanManager, Bean<?> bean)
    {
        //noinspection unchecked
        return getContextualReference(type, beanManager, new HashSet<Bean<?>>((Collection) Arrays.asList(bean)));
    }
1319095
public void init(HttpInboundServiceContext context) {
        this.isc = context;
        this.message = context.getResponse();
        this.body = null;
    }
367704
public final void initializeReferences(Collection<Bean> beans) {
        Map<BeanId, Bean> indexed = BeanUtils.uniqueIndex(beans);
        for (Bean bean : beans) {
            for (String name : bean.getReferenceNames()) {
                List<BeanId> ids = bean.getReference(name);
                if (ids == null) {
                    continue;
                }
                for (BeanId id : ids) {
                    Bean ref = indexed.get(id);
                    if (ref == null) {
                        Optional<Bean> optionalRef = getEager(id);
                        if (optionalRef.isPresent()) {
                            ref = optionalRef.get();
                        }
                    }
                    id.setBean(ref);
                }
            }
        }
    }
1144206
private AbstractBeanDefinition getSourcedBeanDefinition(BeanDefinitionBuilder builder, Object source,
			ParserContext context) {

		AbstractBeanDefinition definition = builder.getRawBeanDefinition();
		definition.setSource(context.extractSource(source));

		return definition;
	}
328033
void endIfStarted(CodeAttribute b, ClassMethod method) {
        b.aload(getLocalVariableIndex(0));
        b.dup();
        final BranchEnd ifnotnull = b.ifnull();
        b.checkcast(Stack.class);
        b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRIPTOR);
        BranchEnd ifnull = b.gotoInstruction();
        b.branchEnd(ifnotnull);
        b.pop(); // remove null Stack
        b.branchEnd(ifnull);
    }
1259698
private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
        processPreStartRequirements(context, requirements);

        if (context.isFailing()) {
            return;
        }

        if (!matchesPresenceOfBeans(context, requirements)) {
            return;
        }

        if (!matchesAbsenceOfBeans(context, requirements)) {
            return;
        }

        matchesCustomConditions(context, requirements);
    }
1125189
protected void onStartup(ServletContext servletContext, Class<?> appConfig, int maxFileSize) {
    // Create the 'root' Spring application context
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setAllowBeanDefinitionOverriding(false);
    rootContext.register(appConfig);

    // Manage the lifecycle of the root application context
    servletContext.addListener(new ContextLoaderListener(rootContext));

    // Register and map the dispatcher servlet
    DispatcherServlet dispatcherServlet = new DispatcherServlet(rootContext);
    dispatcherServlet.setDispatchOptionsRequest(true);
    // instead of throwing a 404 when a handler is not found allow for custom handling
    dispatcherServlet.setThrowExceptionIfNoHandlerFound(true);

    ServletRegistration.Dynamic dispatcherServletRegistration =
        servletContext.addServlet("dispatcher", dispatcherServlet);
    if (dispatcherServletRegistration == null) {
      LOG.warn(
          "ServletContext already contains a complete ServletRegistration for servlet 'dispatcher'");
    } else {
      final long maxSize = (long) maxFileSize * MB;
      dispatcherServletRegistration.addMapping("/");
      dispatcherServletRegistration.setMultipartConfig(
          new MultipartConfigElement(null, maxSize, maxSize, FILE_SIZE_THRESHOLD));
      dispatcherServletRegistration.setAsyncSupported(true);
    }

    // add filters
    Dynamic browserDetectionFiler =
        servletContext.addFilter("browserDetectionFilter", BrowserDetectionFilter.class);
    browserDetectionFiler.setAsyncSupported(true);
    browserDetectionFiler.addMappingForUrlPatterns(
        EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), false, "*");

    Dynamic etagFilter = servletContext.addFilter("etagFilter", ShallowEtagHeaderFilter.class);
    etagFilter.setAsyncSupported(true);
    etagFilter.addMappingForServletNames(
        EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), true, "dispatcher");

    // enable use of request scoped beans in FrontController
    servletContext.addListener(new RequestContextListener());

    servletContext.addListener(HttpSessionEventPublisher.class);
  }
129026
protected function initializeDependencies()
    {
        if ($this->securityContext === null) {
            $this->securityContext = Bootstrap::$staticObjectManager->get(Context::class);
        }

        if ($this->policyService === null) {
            $this->policyService = Bootstrap::$staticObjectManager->get(PolicyService::class);
        }
    }
917810
@Override
  public PersistentDependency createDepend()
  {
    ArrayList<PathImpl> pathList = ((MergePath) _root)._pathList;

    if (pathList.size() == 1)
      return (PersistentDependency) pathList.get(0).createDepend();

    DependencyList dependList = new DependencyList();

    for (int i = 0; i < pathList.size(); i++) {
      PathImpl path = pathList.get(i);

      PathImpl realPath = path.lookup(_pathname);

      dependList.add((PersistentDependency) realPath.createDepend());
    }

    return dependList;
  }
1265333
@SuppressWarnings("unused")
    private void initalizeReferences(Collection<Bean> beans) {
        Map<BeanId, Bean> userProvided = BeanUtils.uniqueIndex(beans);
        for (Bean bean : beans) {
            for (String name : bean.getReferenceNames()) {
                List<BeanId> values = bean.getReference(name);
                if (values == null) {
                    continue;
                }
                for (BeanId beanId : values) {
                    // the does not exist in storage, but may exist in the
                    // set of beans provided by the user.
                    Bean ref = userProvided.get(beanId);
                    if (ref == null) {
                        Optional<Bean> optional = beanManager.getEager(beanId);
                        if (optional.isPresent()) {
                            ref = optional.get();
                        }
                    }
                    beanId.setBean(ref);
                    schemaManager.setSchema(Arrays.asList(beanId.getBean()));
                }
            }
        }
    }
718728
public static synchronized void initialize(Context context) {
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.beginSection("ImagePipelineFactory#initialize");
    }
    initialize(ImagePipelineConfig.newBuilder(context).build());
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.endSection();
    }
  }