Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.Annotated


   {
      // 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();

         Set<Type> typeClosure = annotated.getTypeClosure();
         Class<?> beanClass = entry.getValue();

         Bean<?> serviceBean = new BeanBuilder<Object>(manager)
                  .beanClass(beanClass)
                  .types(typeClosure)
View Full Code Here


    /**
     * Lets detect all producer methods createing instances of {@link RouteBuilder} which are annotated with {@link org.apache.camel.cdi.ContextName}
     * so they can be auto-registered
     */
    public void detectProducerRoutes(@Observes ProcessProducerMethod<?, ?> event) {
        Annotated annotated = event.getAnnotated();
        ContextName annotation = annotated.getAnnotation(ContextName.class);
        Class<?> returnType = event.getAnnotatedProducerMethod().getJavaMember().getReturnType();
        if (isRoutesBean(returnType)) {
            addRouteBuilderBean(event.getBean(), annotation);
        }
    }
View Full Code Here

    }

    @Produces
    @Uri("")
    public Endpoint createEndpoint(InjectionPoint point) {
        Annotated annotated = point.getAnnotated();
        Uri uri = annotated.getAnnotation(Uri.class);
        ObjectHelper.notNull(uri, "Should be annotated with @Uri");
        return CamelContextHelper.getMandatoryEndpoint(getCamelContext(point, uri.context()), uri.value());
    }
View Full Code Here

    }

    @Produces
    @Uri("")
    public ProducerTemplate createProducerTemplate(InjectionPoint point) {
        Annotated annotated = point.getAnnotated();
        Uri uri = annotated.getAnnotation(Uri.class);
        CamelContext camelContext = getCamelContext(point, uri.context());
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
        ObjectHelper.notNull(uri, "Should be annotated with @Uri");
        Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(camelContext, uri.value());
        producerTemplate.setDefaultEndpoint(endpoint);
View Full Code Here

     * Lets detect all producer methods creating instances of {@link RouteBuilder} which are annotated with {@link org
     * .apache.camel.cdi.ContextName}
     * so they can be auto-registered
     */
    public void detectProducerRoutes(@Observes ProcessProducerMethod<?, ?> event) {
        Annotated annotated = event.getAnnotated();
        ContextName annotation = annotated.getAnnotation(ContextName.class);
        Class<?> returnType = event.getAnnotatedProducerMethod().getJavaMember().getReturnType();
        if (isRoutesBean(returnType)) {
            addRouteBuilderBean(event.getBean(), annotation);
        }
    }
View Full Code Here

  // Methods --------------------------------------------------------------------------------------------------------

  public <T> void collect(@Observes ProcessBean<T> event, BeanManager beanManager) {

    Annotated annotated = event.getAnnotated();
    Eager eager = getAnnotation(beanManager, annotated, Eager.class);

    if (eager != null) {

      Bean<?> bean = event.getBean();
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());

      if (Instance.class.isAssignableFrom(injectionBeanValueType))
      {
         Type type = event.getInjectionPoint().getType();
         if (type instanceof ParameterizedType)
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();

         Set<Type> typeClosure = annotated.getTypeClosure();
         Class<?> beanClass = entry.getValue();

         Bean<?> serviceBean = new BeanBuilder<Object>(manager)
                  .beanClass(beanClass)
                  .types(typeClosure)
View Full Code Here

        InjecteeImpl retVal = new InjecteeImpl(injectionPoint.getType());
       
        retVal.setRequiredQualifiers(getHK2Qualifiers(injectionPoint));
        retVal.setParent((AnnotatedElement) injectionPoint.getMember())// Also sets InjecteeClass
       
        Annotated annotated = injectionPoint.getAnnotated();
        if (annotated instanceof AnnotatedField) {
            retVal.setPosition(-1)
        }
        else {
            AnnotatedParameter<?> annotatedParameter = (AnnotatedParameter<?>) annotated;
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

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.