Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.InjectionPoint


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


    public void testOtherWithNamedValue() throws Exception
    {
        Bean<NamedOtherWithNamedValue> bean = defineManagedBean(NamedOtherWithNamedValue.class);
        Constructor<?> constructor = NamedOtherWithNamedValue.class.getDeclaredConstructor(new Class<?>[]{IPayment.class});
       
        InjectionPoint point =InjectionPointFactory.getConstructorInjectionPointData(bean, constructor).get(0);
       
        WebBeansUtil.checkInjectionPointNamedQualifier(point);
       
        String value = qulifier(point);
       
View Full Code Here

    public void testOtherWithoutNamedValue() throws Exception
    {
        Bean<NamedOtherWithoutNamedValue> bean = defineManagedBean(NamedOtherWithoutNamedValue.class);
        Constructor<?> constructor = NamedOtherWithoutNamedValue.class.getDeclaredConstructor(new Class<?>[]{IPayment.class});
       
        InjectionPoint point =InjectionPointFactory.getConstructorInjectionPointData(bean, constructor).get(0);
               
        String value = qulifier(point);
       
        Assert.assertEquals("", value);
       
View Full Code Here

   public M create(CreationalContext<M> creationalContext)
   {
      Set<Bean<?>> beans = manager.getBeans(InjectionPoint.class, defaultQualifiers);
      Bean<?> injectionPointBean = (Bean<?>) beans.iterator().next();
      InjectionPoint injectionPoint = (InjectionPoint) manager.getReference(injectionPointBean, InjectionPoint.class, creationalContext);
      UnwrapsInvocationHandler hdl = new UnwrapsInvocationHandler(manager, this.method, this, injectionPoint, declaringClassQualifiers);
      try
      {
         M obj = proxyClass.newInstance();
         ((ProxyObject) obj).setHandler(hdl);
View Full Code Here

    public Object create(CreationalContext<Object> creationalContext) {
        // get an instance of the bean declaring the producer method
        RestClientProducer producer = (RestClientProducer) manager.getReference(beanDefiningProducerMethod,
                RestClientProducer.class, manager.createCreationalContext(beanDefiningProducerMethod));

        InjectionPoint ip = (InjectionPoint) manager.getInjectableReference(injectionPoints.get(0), creationalContext);
        ClientExecutor executor = (ClientExecutor) manager.getInjectableReference(injectionPoints.get(1), creationalContext);

        return producer.produceRestClient(ip, executor);
    }
View Full Code Here

                   
                    //Annotated parameter
                    AnnotatedParameter<T> annotatedParameter = annotatedMethod.getParameters().get(i);
                   
                    //Creating injection point
                    InjectionPoint point = InjectionPointFactory.getPartialInjectionPoint(this.bean, type, this.observerMethod, annotatedParameter, bindingTypes);
                   
                    //Injected Bean
                    Bean<Object> injectedBean = (Bean<Object>)InjectionResolver.getInstance().getInjectionPointBean(point);
                   
                    //Set for @Inject InjectionPoint
                    if(WebBeansUtil.isDependent(injectedBean))
                    {
                        if(!InjectionPoint.class.isAssignableFrom(ClassUtil.getClass(point.getType())))
                        {
                            InjectionPointBean.local.set(point);  
                        }
                    }                          
                   
View Full Code Here

            {
                //Get parameter annotations
                Annotation[] bindingTypes = AnnotationUtil.getQualifierAnnotations(AnnotationUtil.
                        getAnnotationsFromSet(parameter.getAnnotations()));

                InjectionPoint point = InjectionPointFactory.getPartialInjectionPoint(this.bean, parameter.getBaseType(),
                        parameter.getDeclaringCallable().getJavaMember(), parameter, bindingTypes);

                //Get observer parameter instance
                @SuppressWarnings("unchecked")
                Bean<Object> injectedBean = (Bean<Object>)InjectionResolver.getInstance().getInjectionPointBean(point);

                //Set for @Inject InjectionPoint
                if(WebBeansUtil.isDependent(injectedBean))
                {
                    if(!InjectionPoint.class.isAssignableFrom(ClassUtil.getClass(point.getType())))
                    {
                        InjectionPointBean.local.set(point);  
                    }
                }                   
               
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.newAnnotatedType(member.getDeclaringClass());
        AnnotatedMethod method = AnnotatedElementFactory.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

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.