Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.InjectionPoint


        }
    }

    public static <T> void addFieldInjectionPointMetaData(AbstractOwbBean<T> owner, Field field)
    {
        InjectionPoint injectionPoint = InjectionPointFactory.getFieldInjectionPointData(owner, field);
        if (injectionPoint != null)
        {
            addImplicitComponentForInjectionPoint(injectionPoint);
            owner.addInjectionPoint(injectionPoint);
        }
View Full Code Here


    public static InjectionPoint getXMLInjectionPointData(Bean<?> owner, XMLInjectionPointModel xmlInjectionModel)
    {
        Asserts.assertNotNull(owner, "owner parameter can not be null");
        Asserts.assertNotNull(xmlInjectionModel, "xmlInjectionModel parameter can not be null");
       
        InjectionPoint injectionPoint = null;
       
        Set<Annotation> setAnns = xmlInjectionModel.getAnnotations();
        Annotation[] anns = new Annotation[setAnns.size()];
        anns = setAnns.toArray(anns);
       
View Full Code Here

       
        AnnotatedType<?> annotated = AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
        AnnotatedMethod method = AnnotatedElementFactory.getInstance().newAnnotatedMethod(member, annotated);
        List<AnnotatedParameter<?>> parameters = method.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            //@Observes is not injection point type for method parameters
            if(parameter.getAnnotation(Observes.class) == null)
View Full Code Here

        List<InjectionPoint> lists = new ArrayList<InjectionPoint>();

        List<AnnotatedParameter<X>> parameters = method.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            //@Observes is not injection point type for method parameters
            if(parameter.getAnnotation(Observes.class) == null)
View Full Code Here

        List<InjectionPoint> lists = new ArrayList<InjectionPoint>();

        List<AnnotatedParameter<T>> parameters = constructor.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            point = getGenericInjectionPoint(owner, parameter.getAnnotations().toArray(new Annotation[parameter.getAnnotations().size()]),
                                             parameter.getBaseType(), constructor.getJavaMember() , parameter);
View Full Code Here

        AnnotatedType<Object> annotated = (AnnotatedType<Object>)AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
        AnnotatedConstructor constructor = AnnotatedElementFactory.getInstance().newAnnotatedConstructor((Constructor<Object>)member,annotated);
        List<AnnotatedParameter<?>> parameters = constructor.getParameters();
       
        InjectionPoint point = null;
       
        for(AnnotatedParameter<?> parameter : parameters)
        {
            point = getGenericInjectionPoint(owner, parameter.getAnnotations().toArray(new Annotation[parameter.getAnnotations().size()]),
                                             parameter.getBaseType(), member , parameter);
View Full Code Here

        Set<Type> types = new LinkedHashSet<Type>();
        types.add(ILog.class);
       
        Decorator<?> decorator = getBeanManager().resolveDecorators(types, new Annotation[0]).iterator().next();
        InjectionPoint injectionPoint = decorator.getInjectionPoints().iterator().next();
       
        //Check that injection point is delegate
        Assert.assertTrue(injectionPoint.isDelegate());
       
        Bean<?> bean = getBeanManager().getBeans("org.apache.webbeans.newtests.decorators.simple.MyLog").iterator().next();
       
        ILog ilog = (ILog) getBeanManager().getReference(bean, ILog.class, getBeanManager().createCreationalContext(bean));
        ilog.log("DELEGATE TEST");
View Full Code Here

    @Override
    protected Event<T> createInstance(CreationalContext<Event<T>> creationalContext)
    {
        Event<T> instance = null;

        InjectionPoint injectionPoint = local.get();
        Type eventType = null;
       
        if(injectionPoint != null)
        {
            Type[] eventActualTypeArgs;
            Type type = injectionPoint.getType();                       
            ParameterizedType pt = (ParameterizedType) type;
            eventActualTypeArgs = pt.getActualTypeArguments();

            //First argument and sole argument is actual Event type
            //Example : Event<MyEvent>
            eventType = eventActualTypeArgs[0];
           
            //Event qualifiers
            Annotation[] qualifiers = new Annotation[injectionPoint.getQualifiers().size()];
            qualifiers = injectionPoint.getQualifiers().toArray(qualifiers);
           
            try
            {
                instance = new EventImpl<T>(qualifiers, eventType);
            }
View Full Code Here

        Bean<InjectionPointMetaDataOwner> bean2 = (Bean<InjectionPointMetaDataOwner>)getBeanManager().getBeans(InjectionPointMetaDataOwner.class.getName()).iterator().next();
       
        CreationalContext<InjectionPointMetaDataOwner> cc2 = getBeanManager().createCreationalContext(bean2);
        InjectionPointMetaDataOwner model2 = (InjectionPointMetaDataOwner) getBeanManager().getReference(bean2, InjectionPointMetaDataOwner.class, cc2);
       
        InjectionPoint point = model2.getInjectionPoint();
        Assert.assertTrue(point.getBean().equals(bean));
        Assert.assertTrue(point.getMember() instanceof Field);

        point = (InjectionPoint) deserialize(serialize(point));

        Assert.assertTrue(point.getBean().equals(bean));
        Assert.assertTrue(point.getMember() instanceof Field);
       
        shutDownContainer();

    }
View Full Code Here

    public void testFieldWithNamedValue() throws Exception
    {
        Bean<NamedFieldWithNamedValue> bean = defineManagedBean(NamedFieldWithNamedValue.class);
        Field field = NamedFieldWithNamedValue.class.getDeclaredField("paymentProcessor");
       
        InjectionPoint point =InjectionPointFactory.getFieldInjectionPointData(bean, field);
       
        WebBeansUtil.checkInjectionPointNamedQualifier(point);
       
        String value = qulifier(point);
       
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.InjectionPoint

Copyright © 2018 www.massapicom. 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.