Get all beans of the given type and qualifier.

@param resolutionContext The bean resolution context
@param beanType          The bean type
@param qualifier         The qualifier
@param <T>               The bean type parameter
@return The found beans
333062
protected @Nonnull <T> Collection<T> getBeansOfType(
            @Nullable BeanResolutionContext resolutionContext,
            @Nonnull Class<T> beanType,
            @Nullable Qualifier<T> qualifier) {
        return getBeansOfTypeInternal(resolutionContext, beanType, qualifier);
    }
1076914
public static Type resolveType(Type targetType, Type rootType)
    {
        Type resolvedType;

        if (targetType instanceof ParameterizedType && rootType instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) targetType;

            resolvedType =
                resolveType((Class<?>) parameterizedType.getRawType(), parameterizedType.getActualTypeArguments(),
                    getTypeClass(rootType));
        } else {
            resolvedType = resolveType(getTypeClass(rootType), null, getTypeClass(targetType));
        }

        return resolvedType;
    }
722681
@NonNull
	public static ResolvedType resolve(@NonNull Type type, @NonNull Type... typeParameters)
	{
		return typeResolver.resolve(type, typeParameters);
	}
1372034
public List<RowCell> getCells(@Nonnull String family, @Nonnull ByteString qualifier) {
    Preconditions.checkNotNull(family, "family");
    Preconditions.checkNotNull(qualifier, "qualifier");

    int start = getFirst(family, qualifier);
    if (start < 0) {
      return ImmutableList.of();
    }

    int end = getLast(family, qualifier, start);

    return getCells().subList(start, end + 1);
  }
824081
protected @Nonnull <T> Provider<T> getBeanProvider(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
        return getBeanProvider(resolutionContext, beanType, null);
    }
558859
@SuppressWarnings({"unused", "unchecked"})
    @Internal
    protected final Object getValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
        MethodInjectionPoint injectionPoint = methodInjectionPoints.get(methodIndex);
        Argument argument = injectionPoint.getArguments()[argIndex];
        BeanResolutionContext.Path path = resolutionContext.getPath();
        path.pushMethodArgumentResolve(this, injectionPoint, argument);
        if (context instanceof ApplicationContext) {
            // can't use orElseThrow here due to compiler bug
            try {
                String valueAnnStr = argument.getAnnotationMetadata().getValue(Value.class, String.class).orElse(null);
                Class argumentType = argument.getType();

                if (isInnerConfiguration(argumentType)) {
                    Qualifier qualifier = resolveQualifier(resolutionContext, argument, true);
                    return ((DefaultBeanContext) context).getBean(resolutionContext, argumentType, qualifier);
                } else {
                    String argumentName = argument.getName();
                    String valString = resolvePropertyValueName(resolutionContext, injectionPoint.getAnnotationMetadata(), argument, valueAnnStr);


                    ApplicationContext applicationContext = (ApplicationContext) context;
                    ArgumentConversionContext conversionContext = ConversionContext.of(argument);
                    Optional value = resolveValue(applicationContext, conversionContext, valueAnnStr != null, valString);
                    if (argumentType == Optional.class) {
                        return resolveOptionalObject(value);
                    } else {
                        if (value.isPresent()) {
                            return value.get();
                        } else {
                            if (argument.isDeclaredAnnotationPresent(Nullable.class)) {
                                return null;
                            }
                            throw new DependencyInjectionException(resolutionContext, injectionPoint, conversionContext, valString);
                        }
                    }
                }
            } finally {
                path.pop();
            }
        } else {
            path.pop();
            throw new DependencyInjectionException(resolutionContext, argument, "BeanContext must support property resolution");
        }
    }
826593
@SuppressWarnings("unchecked")
    public static <T> Optional<Key<T>> resolveDefaultQualifier(Map<Key<?>, Class<?>> bindings,
            ClassConfiguration<?> classConfiguration, String property, Class<?> qualifiedClass,
            TypeLiteral<T> genericInterface) {
        Key<T> key = null;

        if (classConfiguration != null && !classConfiguration.isEmpty()) {
            String qualifierName = classConfiguration.get(property);
            if (qualifierName != null && !"".equals(qualifierName)) {
                try {
                    ClassLoader classLoader = ClassLoaders.findMostCompleteClassLoader(BusinessUtils.class);
                    Class<?> qualifierClass = classLoader.loadClass(qualifierName);
                    if (Annotation.class.isAssignableFrom(qualifierClass)) {
                        key = Key.get(genericInterface, (Class<? extends Annotation>) qualifierClass);
                    } else {
                        throw BusinessException.createNew(BusinessErrorCode.CLASS_IS_NOT_AN_ANNOTATION)
                                .put("class", qualifiedClass)
                                .put("qualifier", qualifierName);
                    }
                } catch (ClassNotFoundException e) {
                    key = Key.get(genericInterface, Names.named(qualifierName));
                }
            }
        }

        if (key == null || bindings.containsKey(Key.get(key.getTypeLiteral()))) {
            return Optional.empty();
        } else {
            return Optional.of(key);
        }
    }
586882
public static DependencyIdentifier getDependencyIdentifierForClass(Method method, SortedSet<String> qualifiers) {
        List<Type> typeList = new ArrayList<Type>();
        addTypeToList(method.getGenericReturnType(), typeList);
        return new DependencyIdentifier(typeList, qualifiers);
    }
640157
@SuppressWarnings("unchecked")
    public <T extends DataSource> List<ConnectionAcquiringStrategyFactory<? extends ConnectionAcquiringStrategy, T>> getConnectionAcquiringStrategyFactories() {
        ConnectionAcquiringStrategyFactoryResolver<T> connectionAcquiringStrategyFactoryResolver =
                instantiateClass(PropertyKey.POOL_STRATEGIES_FACTORY_RESOLVER);
        if (connectionAcquiringStrategyFactoryResolver != null) {
            return connectionAcquiringStrategyFactoryResolver.resolveFactories();

        }
        return Collections.emptyList();
    }
281841
public List<CmsAliasBean> getAliases() {

        List<CmsAliasBean> beans = new ArrayList<CmsAliasBean>();
        for (AliasControls controls : m_aliasControls.values()) {
            beans.add(controls.getAlias());
        }
        return beans;
    }
365842
public List<A> findAllAttributesByQualifier(String qualifier) {
        if (StringUtil.isBlank(qualifier) || !attributesPerQualifier.containsKey(qualifier)) return Collections.emptyList();
        return Collections.unmodifiableList(attributesPerQualifier.get(qualifier));
    }
745208
public static Map<String, Object> getBeansWithAnnotation(ApplicationContext appContext,
            Class<? extends Annotation> annotationType) {
        try {
            return appContext.getBeansWithAnnotation(annotationType);
        } catch (BeansException e) {
            return new HashMap<String, Object>();
        }
    }
652590
@Internal
    @UsedByGeneratedCode
    protected final boolean containsValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
        if (context instanceof ApplicationContext) {
            FieldInjectionPoint injectionPoint = fieldInjectionPoints.get(fieldIndex);
            final AnnotationMetadata annotationMetadata = injectionPoint.getAnnotationMetadata();
            String valueAnnVal = annotationMetadata.getValue(Value.class, String.class).orElse(null);
            String valString = resolvePropertyValueName(resolutionContext, injectionPoint, valueAnnVal, annotationMetadata);
            ApplicationContext applicationContext = (ApplicationContext) context;
            Class fieldType = injectionPoint.getType();
            boolean isConfigProps = fieldType.isAnnotationPresent(ConfigurationProperties.class);
            boolean result = isConfigProps || Map.class.isAssignableFrom(fieldType) ? applicationContext.containsProperties(valString) : applicationContext.containsProperty(valString);
            if (!result && isConfigurationProperties()) {
                String cliOption = resolveCliOption(injectionPoint.getName());
                if (cliOption != null) {
                    return applicationContext.containsProperty(cliOption);
                }
            }
            return result;
        }
        return false;
    }
397401
public static <T> Collection<T> getAllBeansOfType(WeldContainer weldContainer, Class<T> type) {
    Collection<T> beans = Lists.newArrayList();
    Set<Bean<?>> cdiBeans = weldContainer.getBeanManager().getBeans(type, AnyLiteral.INSTANCE);
    // searches all beans for beans that have the matching goal name, ...
    for (Bean<?> b : cdiBeans) {
      @SuppressWarnings("unchecked")
      Bean<T> b2 = (Bean<T>) b;
      CreationalContext<T> creationalContext = weldContainer.getBeanManager().createCreationalContext(b2);
      T bean = b2.create(creationalContext);
      beans.add(bean);
    }
    return beans;
  }
1248792
public <A extends Annotation> A findAnnotationOnBean(Class<A> annotationType) {
        return applicationContext.findAnnotationOnBean(beanName, annotationType);
    }
353504
@Internal
    @UsedByGeneratedCode
    protected final boolean containsValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
        if (context instanceof ApplicationContext) {
            MethodInjectionPoint injectionPoint = methodInjectionPoints.get(methodIndex);
            Argument argument = injectionPoint.getArguments()[argIndex];
            String valueAnnStr = argument.getAnnotationMetadata().getValue(Value.class, String.class).orElse(null);
            String valString = resolvePropertyValueName(resolutionContext, injectionPoint.getAnnotationMetadata(), argument, valueAnnStr);
            ApplicationContext applicationContext = (ApplicationContext) context;
            Class type = argument.getType();
            boolean isConfigProps = type.isAnnotationPresent(ConfigurationProperties.class);
            boolean result = isConfigProps || Map.class.isAssignableFrom(type) ? applicationContext.containsProperties(valString) : applicationContext.containsProperty(valString);
            if (!result && isConfigurationProperties()) {
                String cliOption = resolveCliOption(argument.getName());
                if (cliOption != null) {
                    result = applicationContext.containsProperty(cliOption);
                }
            }
            if (result && injectionPoint instanceof MissingMethodInjectionPoint) {
                if (LOG.isWarnEnabled()) {
                    LOG.warn("Bean definition for type [{}] is compiled against an older version and value [{}] can no longer be set for missing method: {}",
                            getBeanType(),
                            valString,
                            injectionPoint.getName());
                }
                result = false;
            }
            return result;
        }
        return false;
    }
50392
protected @Nonnull List<BeanDefinitionReference> resolveBeanDefinitionReferences() {
        final SoftServiceLoader<BeanDefinitionReference> definitions = SoftServiceLoader.load(BeanDefinitionReference.class, classLoader);
        List<BeanDefinitionReference> list = new ArrayList<>(300);
        for (ServiceDefinition<BeanDefinitionReference> definition : definitions) {
            if (definition.isPresent()) {
                final BeanDefinitionReference ref = definition.load();
                list.add(ref);
            }
        }
        return list;
    }