Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-18345

PartialBeanBinding validation in annotated mode

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 4.3.0.Alpha1
    • 4.2.0.CR1
    • cdi-extensions
    • None

      Create CDI 1.1 project with deltaspike libs (and PartialBean module).

      Create Binding Annotation

      import java.lang.annotation.ElementType;
      import java.lang.annotation.Retention;
      import java.lang.annotation.RetentionPolicy;
      import java.lang.annotation.Target;
      
      import org.apache.deltaspike.partialbean.api.PartialBeanBinding;
      
      @PartialBeanBinding
      @Target(ElementType.TYPE)
      @Retention(RetentionPolicy.RUNTIME)
      public @interface ExamplePartialBeanBinding {
      
      }
      

      Create Partial Bean interface annotated with Binding Annotation

      import javax.enterprise.context.ApplicationScoped;
      
      @ApplicationScoped
      @ExamplePartialBeanBinding
      public interface ExamplePartialBeanInterface {
          String sayHello(String hello);
      }
      

      In this case a warning saying "Partial bean %className% should have an invocation handler for binding annotation %annotationName%" should be displayed. However because bean-discovery-mode is set to annotated and our Binding Annotation doesn't specify scope (we dont create Binding Annotations with scope right ?) no warning is displayed. So we need to change bean-discovery-mode or add scope to our Binding Annotation. It would be nice to have the warning displayed even with "default" settings. WDYT ?

            scabanovich Viacheslav Kabanovich (Inactive)
            rawagner@redhat.com Rastislav Wagner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: