Search in sources :

Example 1 with TypeSafeBeanResolver

use of org.jboss.weld.resolution.TypeSafeBeanResolver in project core by weld.

the class ResolutionTest method testResolveWithAnonymousAnnotationLiteral.

@Test
public // WELD-711
void testResolveWithAnonymousAnnotationLiteral() throws Exception {
    Annotation defaultQualifier = new AnnotationLiteral<Default>() {
    };
    assertNotNull(getReference(beanManager, Foo.class, defaultQualifier));
    TypeSafeBeanResolver resolver = beanManager.getBeanResolver();
    assertFalse(resolver.isCached(new ResolvableBuilder(beanManager).addType(Foo.class).addQualifier(defaultQualifier).create()));
}
Also used : TypeSafeBeanResolver(org.jboss.weld.resolution.TypeSafeBeanResolver) AnnotationLiteral(javax.enterprise.util.AnnotationLiteral) ResolvableBuilder(org.jboss.weld.resolution.ResolvableBuilder) Annotation(java.lang.annotation.Annotation) Test(org.junit.Test)

Example 2 with TypeSafeBeanResolver

use of org.jboss.weld.resolution.TypeSafeBeanResolver in project core by weld.

the class InstanceImpl method resolveBeans.

private Set<Bean<?>> resolveBeans() {
    // Perform typesafe resolution, and possibly attempt to resolve the ambiguity
    Resolvable resolvable = new ResolvableBuilder(getType(), getBeanManager()).addQualifiers(getQualifiers()).setDeclaringBean(getInjectionPoint().getBean()).create();
    TypeSafeBeanResolver beanResolver = getBeanManager().getBeanResolver();
    return beanResolver.resolve(beanResolver.resolve(resolvable, Reflections.isCacheable(getQualifiers())));
}
Also used : TypeSafeBeanResolver(org.jboss.weld.resolution.TypeSafeBeanResolver) ResolvableBuilder(org.jboss.weld.resolution.ResolvableBuilder) Resolvable(org.jboss.weld.resolution.Resolvable)

Aggregations

ResolvableBuilder (org.jboss.weld.resolution.ResolvableBuilder)2 TypeSafeBeanResolver (org.jboss.weld.resolution.TypeSafeBeanResolver)2 Annotation (java.lang.annotation.Annotation)1 AnnotationLiteral (javax.enterprise.util.AnnotationLiteral)1 Resolvable (org.jboss.weld.resolution.Resolvable)1 Test (org.junit.Test)1