Examples of InjectionPoint


Examples of javax.enterprise.inject.spi.InjectionPoint

   public void wireCrossContainerServices(@Observes AfterBeanDiscovery event, final BeanManager manager)
   {
      // needs to happen in the addon that is requesting the service
      for (final Entry<InjectionPoint, Class<?>> entry : requestedServices.entrySet())
      {
         final InjectionPoint injectionPoint = entry.getKey();
         final Annotated annotated = injectionPoint.getAnnotated();
         final Member member = injectionPoint.getMember();

         Class<?> beanClass = entry.getValue();
         Set<Type> typeClosure = annotated.getTypeClosure();
         Set<Type> beanTypeClosure = new LinkedHashSet<>();
         for (Type type : typeClosure)
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    return Collections.emptySet();
  }

  @Override
  public Object create(final CreationalContext creationalContext) {
    final InjectionPoint injectionPoint = Container.instance().services().get(CurrentInjectionPoint.class).peek();
    return ConversationalEventImpl.of(injectionPoint, manager, bus);
  }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    return Collections.emptySet();
  }

  @Override
  public Object create(CreationalContext creationalContext) {
    final InjectionPoint injectionPoint = Container.instance().services().get(CurrentInjectionPoint.class).peek();
    final Set<Annotation> qualifiers = injectionPoint.getQualifiers();
   
//    final ParameterizedType injectionPointType = (ParameterizedType) injectionPoint.getType();
//    final Type innerType = injectionPointType.getActualTypeArguments()[0];
//    Class senderType = null;
//
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    }

    @Test(groups = { INJECTION_POINT })
    @SpecAssertion(section = "5.5.7", id = "eb")
    public void testPassivationCapability() throws Exception {
        InjectionPoint ip1 = getInstanceByType(FieldInjectionPointBean.class).getInjectedBean().getInjectedMetadata();
        InjectionPoint ip2 = getInstanceByType(MethodInjectionPointBean.class).getInjectedBean().getInjectedMetadata();
        InjectionPoint ip3 = getInstanceByType(ConstructorInjectionPointBean.class).getInjectedBean().getInjectedMetadata();

        ip1 = (InjectionPoint) activate(passivate(ip1));
        ip2 = (InjectionPoint) activate(passivate(ip2));
        ip3 = (InjectionPoint) activate(passivate(ip3));

        assert ip1.getType().equals(BeanWithInjectionPointMetadata.class);
        assert ip2.getType().equals(BeanWithInjectionPointMetadata.class);
        assert ip3.getType().equals(BeanWithInjectionPointMetadata.class);
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    @Test(groups = { INJECTION_POINT })
    @SpecAssertion(section = "5.5.7", id = "dca")
    public void testIsTransient() {
        FieldInjectionPointBean bean1 = getInstanceByType(FieldInjectionPointBean.class);
        TransientFieldInjectionPointBean bean2 = getInstanceByType(TransientFieldInjectionPointBean.class);
        InjectionPoint ip1 = bean1.getInjectedBean().getInjectedMetadata();
        InjectionPoint ip2 = bean2.getInjectedBean().getInjectedMetadata();
        assert !ip1.isTransient();
        assert ip2.isTransient();
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    }

    @Override
    protected InjectionPoint createInstance(CreationalContext<InjectionPoint> creationalContext)
    {
        InjectionPoint ip = getStackOfInjectionPoints().peek();
        return ip;
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    @Override
    protected Instance<T> createInstance(CreationalContext<Instance<T>> creationalContext)
    {
        try
        {
            InjectionPoint injectionPoint = local.get();
            Set<Annotation> qualifiers;
            Type type;
            Class injectionPointClass = null;

            if (injectionPoint != null)
            {
                ParameterizedType injectedType = (ParameterizedType)injectionPoint.getType();
                qualifiers = injectionPoint.getQualifiers();
                type = injectedType.getActualTypeArguments()[0];
                if (injectionPoint.getBean() != null)
                {
                    injectionPointClass = injectionPoint.getBean().getBeanClass();
                }
            }
            else
            {
                qualifiers = getQualifiers();
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

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

Examples of javax.enterprise.inject.spi.InjectionPoint

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

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

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

                //Set for @Inject InjectionPoint
                if(WebBeansUtil.isDependent(injectedBean))
                {
                    if(!InjectionPoint.class.isAssignableFrom(ClassUtil.getClass(point.getType())))
                    {
                        injectionPointBeanLocalSetOnStack = InjectionPointBean.setThreadLocal(point);
                    }
                }                   
View Full Code Here

Examples of javax.enterprise.inject.spi.InjectionPoint

    public Object doInjection()
    {
        try
        {
            InjectionPoint injectedField = getInjectedPoints(field).get(0);
           
            if (!field.isAccessible())
            {
                injectionOwnerBean.getWebBeansContext().getSecurityService().doPrivilegedSetAccessible(field, true);
            }
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.