Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Annotated


        {
            if(!injectionPoint.isTransient())
            {
                if(!webBeansContext.getWebBeansUtil().isPassivationCapableDependency(injectionPoint))
                {
                    Annotated annotated = injectionPoint.getAnnotated();
                    if(annotated.isAnnotationPresent(Disposes.class) || annotated.isAnnotationPresent(TransientReference.class))
                    {
                        continue;
                    }
                    throw new WebBeansConfigurationException(
                            "Passivation capable beans must satisfy passivation capable dependencies. " +
View Full Code Here


   <T> void saveRemoteInjectionPoints(@Observes ProcessInjectionTarget<T> event, BeanManager beanManager) {
      final InjectionTarget<T> injectionTarget = event.getInjectionTarget();

      for (InjectionPoint injectionPoint : injectionTarget.getInjectionPoints()) {
         final Annotated annotated = injectionPoint.getAnnotated();
         final Type type = annotated.getBaseType();
         final Class<?> rawType = getRawType(annotated.getBaseType());
         final Set<Annotation> qualifiers = getQualifiers(beanManager, annotated.getAnnotations());

         if (rawType.equals(RemoteCache.class) && qualifiers.isEmpty()) {
            qualifiers.add(new AnnotationLiteral<Default>() {});
            addRemoteCacheInjectionPoint(type, qualifiers);

         } else if (!annotated.isAnnotationPresent(Remote.class)
               && getMetaAnnotation(annotated, Remote.class) != null
               && rawType.isAssignableFrom(RemoteCache.class)) {

            addRemoteCacheInjectionPoint(type, qualifiers);
         }
View Full Code Here

    @SuppressWarnings("rawtypes")
    @Test
    @SpecAssertion(section = INJECTION_POINT, id = "dac")
    public void testInjectionPointGetAnnotatedType() {

        Annotated lastAnnotated = null;

        notifier.fireInfoEvent();
        lastAnnotated = infoObserver.getLastAnnotated();
        assertTrue(lastAnnotated instanceof AnnotatedField);
        assertEquals(((AnnotatedField) lastAnnotated).getJavaMember().getName(), "infoEvent");
        assertTrue(lastAnnotated.isAnnotationPresent(Inject.class));

        notifier.fireConstructorInfoEvent();
        lastAnnotated = infoObserver.getLastAnnotated();
        assertTrue(lastAnnotated instanceof AnnotatedParameter);
        assertEquals(((AnnotatedParameter) lastAnnotated).getPosition(), 0);
        assertTrue(lastAnnotated.isAnnotationPresent(Nice.class));
    }
View Full Code Here

        /////////////////////////////////////////////////////////////////
       
        // check for InjectionPoint injection
        if (rawType.equals(InjectionPoint.class))
        {
            Annotated annotated = injectionPoint.getAnnotated();
            if (annotated.getAnnotations().size() == 1 && annotated.isAnnotationPresent(Default.class))
            {
                if (!bean.getScope().equals(Dependent.class))
                {
                    throw new WebBeansConfigurationException("Bean " + bean + "scope can not define other scope except @Dependent to inject InjectionPoint");
                }
View Full Code Here

    this.environment = environment;
  }
 
  @Produces @Property
  public String get(InjectionPoint ip) {
    Annotated annotated = ip.getAnnotated();
    Property property = annotated.getAnnotation(Property.class);
    String key = property.value();
    if (isNullOrEmpty(key)) {
      key = ip.getMember().getName();
    }
   
View Full Code Here

        configKey = p.getMember().getName();
        configValue = globalProperties.getProperty(configKey);
        if (configValue != null) return configValue;

        // Return the default value if any.
        Annotated annotated = p.getAnnotated();
        Config config = annotated.getAnnotation(Config.class);
        if (config != null) return config.value();
        return null;
    }
View Full Code Here

      }
   }

   public void processRemoteInjectionPointConsumer(@Observes ProcessInjectionPoint<?, ?> event, BeanManager manager)
   {
      Annotated annotated = event.getInjectionPoint().getAnnotated();

      Class<?> injectionPointDeclaringType = Types.toClass(event.getInjectionPoint().getMember().getDeclaringClass());
      Class<?> injectionBeanValueType = Types.toClass(annotated.getBaseType());

      Class<?> injectionPointConsumingType = null;
      if (event.getInjectionPoint().getBean() != null)
         injectionPointConsumingType = event.getInjectionPoint().getBean().getBeanClass();
      else
View Full Code Here

   {
      // 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)
         {
            beanTypeClosure.add(reifyWildcardsToObjects(type));
         }
View Full Code Here

      return false;
    }

    @Override
    public Annotated getAnnotated() {
      return new Annotated() {

        @Override
        public Type getBaseType() {
          // TODO Auto-generated method stub
          return null;
View Full Code Here

            {
                return invocation;
            }
            else
            {
                Annotated securingParameterAnnotatedType = injectionPoint.getAnnotated();
                Set<Annotation> securingParameterAnnotations = securingParameterAnnotatedType.getAnnotations();

                Set<Annotation> requiredBindingAnnotations = new HashSet<Annotation>();
                for (Annotation annotation : securingParameterAnnotations)
                {
                    if (annotation.annotationType().isAnnotationPresent(SecurityParameterBinding.class))
View Full Code Here

TOP

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

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.