Creates a simple, annotation defined Web Bean

@param <T>         The type
@param clazz       The class
@param beanManager the current manager
@return A Web Bean
358280
public static <T> ManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager) {
        return new ManagedBean<T>(attributes, clazz, createId(attributes, clazz), beanManager);
    }
1036649
private BeanManagerInfo getBeanManagerInfo(ClassLoader cl)
    {
        BeanManagerInfo bmi = bmpSingleton.bmInfos.get(cl);

        if (bmi == null)
        {
            synchronized (this)
            {
                bmi = bmpSingleton.bmInfos.get(cl);
                if (bmi == null)
                {
                    bmi = new BeanManagerInfo();
                    bmpSingleton.bmInfos.put(cl, bmi);
                }
            }
        }

        return bmi;
    }
854435
public DefinitionBinder bind(String beanName, Class<?> clazz) {
    return new DefinitionBinder(this).bind(beanName, clazz);
  }
6787
public static <T> List<Field> getAnnotatedFields(Class<?> clazz, Class<? extends Annotation> annotationClass) {
		List<Field> annotatedFields = new LinkedList<Field>();
		Field[] allFields = getAllDeclaredFields(clazz);
		for (Field field : allFields) {
			if (null != (field.getAnnotation(annotationClass))) {
				annotatedFields.add(field);
			}
		}
		return annotatedFields;
	}
996012
public <T> T createModel(Class<T> clazz) throws CreateModelException {
        return createModel(clazz, true);
    }
1190586
@SuppressWarnings("unchecked")
    public static <T extends Annotation> T createAnnotation(final Class<T> clazz) {
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz, Annotation.class}, new SimpleAnnoInvocationHandler(clazz));
    }
350889
public static <T> T toBean(Map<String, ?> property, Class<T> clazz) {
        T bean = null;
        try {
            bean = clazz.newInstance();
            BeanUtils.populate(bean, property);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return bean;
    }
991634
public static Multimap<Class<? extends Annotation>, Annotation> mergeBeanInterceptorBindings(BeanManagerImpl beanManager, AnnotatedType<?> clazz,
            Collection<Annotation> classBindingAnnotations, Collection<Annotation> inheritedBindingAnnotations) {

        SetMultimap<Class<? extends Annotation>, Annotation> mergedBeanBindings = SetMultimap.newSetMultimap();
        SetMultimap<Class<? extends Annotation>, Annotation> acceptedInheritedBindings = SetMultimap.newSetMultimap();
        MetaAnnotationStore metaAnnotationStore = beanManager.getServices().get(MetaAnnotationStore.class);

        // add all class-level interceptor bindings (these have precedence)
        for (Annotation binding : classBindingAnnotations) {
            Class<? extends Annotation> annotationType = binding.annotationType();
            if (!annotationType.isAnnotationPresent(Repeatable.class)) {
                // Detec conflicts for non repeating bindings
                for (Annotation mergedBinding : mergedBeanBindings.get(annotationType)) {
                    if (!metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(binding, mergedBinding, false)) {
                        throw new DeploymentException(BeanLogger.LOG.conflictingInterceptorBindings(clazz.getJavaClass()));
                    }
                }
            }
            mergedBeanBindings.put(binding.annotationType(), binding);
        }
        // add inherited interceptor bindings
        for (Annotation binding : inheritedBindingAnnotations) {
            Class<? extends Annotation> annotationType = binding.annotationType();

            if (!mergedBeanBindings.containsKey(annotationType) || annotationType.isAnnotationPresent(Repeatable.class)) {
                mergedBeanBindings.put(annotationType, binding);
                acceptedInheritedBindings.put(annotationType, binding);
            } else {
                Set<Annotation> inheritedBindings = acceptedInheritedBindings.get(annotationType);
                for (Annotation inheritedBinding : inheritedBindings) {
                    if (!metaAnnotationStore.getInterceptorBindingModel(annotationType).isEqual(binding, inheritedBinding, false)) {
                        throw new DeploymentException(BeanLogger.LOG.conflictingInterceptorBindings(clazz.getJavaClass()));
                    }
                }
            }
        }
        return mergedBeanBindings;
    }
473865
public static <T> SessionBean<T> of(BeanAttributes<T> attributes, InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, EnhancedAnnotatedType<T> type) {
        return new SessionBeanImpl<T>(attributes, type, ejbDescriptor, new StringBeanIdentifier(SessionBeans.createIdentifier(type, ejbDescriptor)), beanManager);
    }
69867
public static <A extends Annotation> A getAnnotation(final Class<?> clazz, Class<A> annoClazz) {
        if (clazz == null || annoClazz == null) {
            return null;
        }

        return clazz.getAnnotation(annoClazz);
    }
690096
protected <T> ManagedObjectFactory<T> getManagedBeanManagedObjectFactory(BeanMetaData bmd, Class<T> klass) throws EJBConfigurationException {
        ManagedObjectFactory<T> factory = null;
        ManagedObjectService managedObjectService = getManagedObjectService();
        if (managedObjectService != null) {
            try {
                factory = managedObjectService.createManagedObjectFactory(bmd._moduleMetaData, klass, true);
                //TODO the isManaged method could be moved to the ManagedObjectService and then wouldn't need to create the factory
                if (!factory.isManaged()) {
                    factory = null;
                }
            } catch (ManagedObjectException e) {
                throw new EJBConfigurationException(e);
            }
        }

        return factory;
    }
840502
@SuppressWarnings("unchecked")
    public <T> List<T> getAnnotations(final Class<? extends Annotation> clazz) {
        return (List<T>) foundAnnotations.get(clazz);
    }
932631
public <T> ConstructorInjectionPoint<T> createConstructorInjectionPoint(Bean<T> declaringBean,
            EnhancedAnnotatedType<T> type, BeanManagerImpl manager) {
        EnhancedAnnotatedConstructor<T> constructor = Beans.getBeanConstructorStrict(type);
        return createConstructorInjectionPoint(declaringBean, type.getJavaClass(), constructor, manager);
    }
642711
public BeanBox injectConstruct(Class<?> clazz, Object... configs) {
		this.beanClass = clazz;
		if (configs.length == 0) {
			this.constructor = BeanBoxUtils.getConstructor(clazz);
		} else {
			Class<?>[] paramTypes = new Class<?>[configs.length / 2];
			BeanBox[] params = new BeanBox[configs.length / 2];
			int mid = configs.length / 2;
			for (int i = 0; i < mid; i++)
				paramTypes[i] = (Class<?>) configs[i];
			for (int i = mid; i < configs.length; i++) {
				params[i - mid] = BeanBoxUtils.wrapParamToBox(configs[i]);
				params[i - mid].setType(paramTypes[i - mid]);
			}
			this.constructor = BeanBoxUtils.getConstructor(clazz, paramTypes);
			this.constructorParams = params;
		}
		return this;
	}
703010
public static <B> BeanPropertyAccessor<B> forClass(Class<B> clazz) {
        return forClass(clazz, PropertySet.ALL);
    }
1091287
public static BeanMapping create(Class srcClass, Class targetClass) {
        BeanMappingObject config = BeanMappingConfigHelper.getInstance().getBeanMappingObject(srcClass, targetClass);
        if (config == null) {
            throw new BeanMappingException("can not found mapping config for srcClass[" + srcClass.toString()
                                           + "] targetClass[" + targetClass + "]");
        }

        return new BeanMapping(config);
    }
992010
protected EntityManagerFactory lookupEntityManagerFactory(OpenEntityManager openEntityManager) {
        String emfBeanName = openEntityManager.name();
        String puName = openEntityManager.unitName();
        if (StringUtils.hasLength(emfBeanName)) {
            return this.applicationContext.getBean(emfBeanName, EntityManagerFactory.class);
        } else if (!StringUtils.hasLength(puName)
                && this.applicationContext.containsBean(
                        OpenEntityManagerInViewFilter.DEFAULT_ENTITY_MANAGER_FACTORY_BEAN_NAME)) {
            return this.applicationContext.getBean(
                    OpenEntityManagerInViewFilter.DEFAULT_ENTITY_MANAGER_FACTORY_BEAN_NAME,
                    EntityManagerFactory.class);
        } else {
            // Includes fallback search for single EntityManagerFactory bean by type.
            return EntityManagerFactoryUtils.findEntityManagerFactory(
                    this.applicationContext, puName);
        }
    }