Examples of NewLiteral


Examples of org.apache.webbeans.annotation.NewLiteral

            return ejbPlugin.defineNewSessionBean(type);
        }

        AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type);
        BeanAttributesImpl<T> defaultBeanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(annotatedType).build();
        BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<T>(defaultBeanAttributes.getTypes(), Collections.<Annotation>singleton(new NewLiteral(type)));
        // TODO replace this by InjectionPointBuilder
        ManagedBeanBuilder<T, ManagedBean<T>> beanBuilder = new ManagedBeanBuilder<T, ManagedBean<T>>(webBeansContext, annotatedType, newBeanAttributes);
        NewManagedBean<T> newBean
            = new NewManagedBean<T>(webBeansContext, WebBeansType.MANAGED, annotatedType, newBeanAttributes, type, beanBuilder.getBean().getInjectionPoints());
        return newBean;
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

            throw new WebBeansConfigurationException("@New annotation on type : " + bean.getBeanClass()
                    + " must defined as a simple or an enterprise web bean");
        }

        AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type);
        BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<T>(bean.getTypes(), Collections.<Annotation>singleton(new NewLiteral(type)));
        NewManagedBean<T> newBean = new NewManagedBean<T>(bean.getWebBeansContext(), bean.getWebBeansType(), annotatedType, newBeanAttributes, type, bean.getInjectionPoints());
        //TODO XXX set producer
        return newBean;
    }
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

        {
            throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
                                                     + " must defined as a simple or an enterprise web bean");
        }

        comp.addQualifier(new NewLiteral(clazz));
        comp.setName(null);
        if(apiType == null)
        {
            comp.addApiType(clazz);
        }
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

        {
            throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
                                                     + " must defined as a simple or an enterprise web bean");
        }

        comp.addQualifier(new NewLiteral(clazz));
        comp.setName(null);
        if(apiType == null)
        {
            comp.addApiType(clazz);
        }
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

        {
            throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
                                                     + " must defined as a simple or an enterprise web bean");
        }

        comp.addQualifier(new NewLiteral(clazz));
        comp.setName(null);
        if(apiType == null)
        {
            comp.addApiType(clazz);
        }
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

        {
            throw new WebBeansConfigurationException("@New annotation on type : " + clazz.getName()
                                                     + " must defined as a simple or an enterprise web bean");
        }

        comp.addQualifier(new NewLiteral(clazz));
        comp.setName(null);
        if(apiType == null)
        {
            comp.addApiType(clazz);
        }
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

            comp.getInterceptorStack().addAll(interceptorList);
        }


        comp.setImplScopeType(new DependentScopeLiteral());
        comp.addQualifier(new NewLiteral(bean.getBeanClass()));
        comp.setName(null);

        Set<InjectionPoint> injectionPoints = bean.getInjectionPoints();
        for(InjectionPoint injectionPoint : injectionPoints)
        {
View Full Code Here

Examples of org.apache.webbeans.annotation.NewLiteral

        OpenEjbBean<T> atNewEjb = new NewOpenEjbBean<T>((Class<T>) ejbBean.getBeanClass(), ejbBean.getEjbType());

        Class clazz = ejbBean.getBeanClass();

        atNewEjb.setImplScopeType(new DependentScopeLiteral());
        atNewEjb.addQualifier(new NewLiteral(clazz));

        atNewEjb.getTypes().addAll(ejbBean.getTypes());

        for (Field injectedField : ejbBean.getInjectedFields())
        {
View Full Code Here

Examples of org.jboss.cdi.tck.literals.NewLiteral

    }

    @Test
    @SpecAssertion(section = "3.14", id = "l")
    public void testNewBeanHasSameConstructor() {
        ExplicitConstructor newBean = getInstanceByType(ExplicitConstructor.class, new NewLiteral(
                ExplicitConstructorSessionBean.class));
        assert newBean.getConstructorCalls() == 1;
        assert newBean.getInjectedSimpleBean() != null;
    }
View Full Code Here

Examples of org.jboss.cdi.tck.literals.NewLiteral

    @Test
    @SpecAssertion(section = "3.14", id = "m")
    public void testNewBeanHasSameInitializers() {
        InitializerSimpleBeanLocal bean = getInstanceByType(InitializerSimpleBeanLocal.class);
        InitializerSimpleBeanLocal newBean = getInstanceByType(InitializerSimpleBeanLocal.class, new NewLiteral(
                InitializerSimpleBean.class));
        assert bean != newBean;
        assert bean.getInitializerCalls() == 2;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.