Builds a listable bean factory with the given beans.

@param extraBeans
@return new Created BeanFactory
760100
private static DefaultListableBeanFactory buildListableBeanFactory(Map<String, ?> extraBeans) {
        //new empty context
        final DefaultListableBeanFactory parentBeanFactory = new DefaultListableBeanFactory();  
        
        //Injection of the new beans in the context
        for (String key : extraBeans.keySet()) {
            parentBeanFactory.registerSingleton(key, extraBeans.get(key));
        }
        return parentBeanFactory;
    }
1077893
private static DefaultListableBeanFactory createBeanFactory() {
        return new DefaultListableBeanFactory() {
            {
                final InstantiationStrategy is = getInstantiationStrategy();
                setInstantiationStrategy(new InstantiationStrategy() {
                    @Override
                    public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) throws BeansException {
                        return is.instantiate(beanDefinition, beanName, owner);
                    }

                    @Override
                    public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Constructor<?> ctor, Object[] args) throws BeansException {
                        final Object bean = is.instantiate(beanDefinition, beanName, owner, ctor, args);
                        addDependencies(bean, args);
                        return bean;
                    }

                    @Override
                    public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner, Object factoryBean, Method factoryMethod, Object[] args) throws BeansException {
                        final Object bean = is.instantiate(beanDefinition, beanName, owner, factoryBean, factoryMethod, args);
                        addDependencies(bean, args);
                        return bean;
                    }
                });
            }

            private void addDependencies(Object bean, Object[] args) {
                if (bean instanceof Service) {
                    for (Object arg : args) {
                        if (arg instanceof Service) {
                            ((Service) arg).addDependedBy((Service) bean);
                            ((Service) bean).addDependsOn((Service) arg);
                        }
                    }
                }
            }
        };
    }
512716
protected void addPageInfo(CmsBrokenLinkBean bean, String extraTitle, String extraPath) {

        if (extraTitle != null) {
            bean.addInfo(messagePageTitle(), "" + extraTitle);
        }
        if (extraPath != null) {
            bean.addInfo(messagePagePath(), "" + extraPath);
        }
    }
1028224
public void postProcessBeanFactory(final ConfigurableListableBeanFactory reg)
			throws BeansException {
		DefaultListableBeanFactory  bf = (DefaultListableBeanFactory) reg;
		bf.setAutowireCandidateResolver(new FSMAnnotationResolver());
	}
406393
public static <BeanType> BeanType createBeanFromAttributeMap(Class<BeanType> beanType,
            Map<String, ? extends Object> attributeValues) {
        BeanType instance;
        try {
            instance = beanType.newInstance();
            BeanUtils.populate(instance, attributeValues);
        } catch (Exception e) {
            ReflectionUtils.handleReflectionException(e);
            throw new IllegalStateException("Should never get here");
        }
        return instance;
    }
1258732
public Bean<T> create() {
        if (!passivationCapable) {
            return new ImmutableBean<T>(beanClass, name, qualifiers, scope, stereotypes, types, alternative, nullable, injectionPoints, beanLifecycle, toString);
        } else {
            return new ImmutablePassivationCapableBean<T>(id, beanClass, name, qualifiers, scope, stereotypes, types, alternative, nullable, injectionPoints, beanLifecycle, toString);
        }
    }
1241580
protected void prepareBeanFactoryByRose(ConfigurableListableBeanFactory beanFactory)
            throws IOException {
        BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
        AnnotationConfigUtils.registerAnnotationConfigProcessors(registry);

        String[] messageBaseNames = getMessageBaseNames();
        if (messageBaseNames != null && messageBaseNames.length > 0) {
            if (logger.isDebugEnabled()) {
                logger.debug("[roseWebApp/messages] starting registerMessageSourceIfNecessary");
            }
            registerMessageSourceIfNecessary(registry, messageBaseNames);
            if (logger.isDebugEnabled()) {
                logger.debug("[roseWebApp/messages] finished registerMessageSourceIfNecessary");
            }
        }
    }
1017071
public BuildableType.Builder builderFactory(BuilderFactory builderFactory) {
    this.builderFactory = Objects.requireNonNull(builderFactory);
    _unsetProperties.remove(Property.BUILDER_FACTORY);
    return (BuildableType.Builder) this;
  }
1178015
public static FacesBackingBeanFactory get( ServletContext servletContext )
    {
        FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext.getAttribute( CONTEXT_ATTR );
        assert factory != null
                : FacesBackingBeanFactory.class.getName() + " was not found in ServletContext attribute " + CONTEXT_ATTR;
        factory.reinit( servletContext );
        return factory;
    }
811001
@SuppressWarnings("rawtypes")
    public AbstractBeanDefinition bean(Class type, Object...args) {
        BeanConfiguration current = currentBeanConfig;
        try {
            Closure callable = null;
            Collection constructorArgs = null;
            if (args != null && args.length > 0) {
                int index = args.length;
                Object lastArg = args[index-1];

                if (lastArg instanceof Closure) {
                    callable = (Closure) lastArg;
                    index--;
                }
                if (index > -1) {
                    constructorArgs = resolveConstructorArguments(args, 0, index);
                }
            }
            currentBeanConfig =  constructorArgs == null ? springConfig.createSingletonBean(type) : springConfig.createSingletonBean(type, constructorArgs);
            if (callable != null) {
                callable.call(new Object[]{currentBeanConfig});
            }
            return currentBeanConfig.getBeanDefinition();

        }
        finally {
            currentBeanConfig = current;
        }
    }
393073
public Object convertJavaBeanToJavaBean(Document doc, ProvFactory pFactory) {
        BeanTraversal bt=new BeanTraversal(pFactory, pFactory);
        Document o=bt.doAction(doc);
        return o;
    }
78890
public List<BeanType<ValidationMappingDescriptor>> getAllBean()
   {
      List<BeanType<ValidationMappingDescriptor>> list = new ArrayList<BeanType<ValidationMappingDescriptor>>();
      List<Node> nodeList = model.get("bean");
      for(Node node: nodeList)
      {
         BeanType<ValidationMappingDescriptor>  type = new BeanTypeImpl<ValidationMappingDescriptor>(this, "bean", model, node);
         list.add(type);
      }
      return list;
   }
854661
@SuppressWarnings("unchecked")
  public B withExtraTypes(Class<?>... extraTypes) {
    config.setExtraTypes(Lists.newArrayList(extraTypes));
    return (B) this;
  }
801608
public FacesConfigManagedBeanType<WebFacesConfigDescriptor> getOrCreateManagedBean()
   {
      List<Node> nodeList = model.get("managed-bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigManagedBeanTypeImpl<WebFacesConfigDescriptor>(this, "managed-bean", model, nodeList.get(0));
      }
      return createManagedBean();
   }
539660
@Override
	public BeanDefinition buildPersisterBean(
			Class<?> statefulClass,
			String repoBeanId, 
			BeanDefinition repoBeanDefinitionFactory,
			String stateFieldName, 
			String startStateId,
			List<RuntimeBeanReference> stateBeans) {
		BeanDefinition persisterBean = BeanDefinitionBuilder
				.genericBeanDefinition(MemoryPersisterImpl.class)
				.getBeanDefinition();
		ConstructorArgumentValues args = persisterBean.getConstructorArgumentValues();
		args.addIndexedArgumentValue(0, stateBeans);
		args.addIndexedArgumentValue(1, new RuntimeBeanReference(startStateId));
		args.addIndexedArgumentValue(2, stateFieldName);
		return persisterBean;
	}
1008146
public static Map<String, String> mapBean(final Object bean,
        final String exclude)
        {
        final Set<String> excludes = new HashSet<String>();
        if (!StringUtils.isBlank(exclude))
            {
            excludes.add(exclude);
            }
        return mapBean(bean, excludes);
        }
654708
@SuppressWarnings("unchecked")
  public AtomicCounterMapBuilder<K> withExtraTypes(Class<?>... extraTypes) {
    config.setExtraTypes(Lists.newArrayList(extraTypes));
    return this;
  }