[jbosstools-issues] [JBoss JIRA] (JBIDE-18345) PartialBeanBinding validation in annotated mode

Viacheslav Kabanovich (JIRA) issues at jboss.org
Tue Sep 16 17:13:02 EDT 2014


    [ https://issues.jboss.org/browse/JBIDE-18345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003247#comment-13003247 ] 

Viacheslav Kabanovich edited comment on JBIDE-18345 at 9/16/14 5:12 PM:
------------------------------------------------------------------------

JBT should consider ExamplePartialBeanInterface as a bean, because Deltaspike generates an implementation that uses the bound invocation handler.
Our bug here is that with bean-discovery-mode=annotated we ignore annotation type ExamplePartialBeanBinding as having no scope annotation. But since ExamplePartialBeanInterface has a scope annotation, all its annotations should be included to bean discovery process.


was (Author: scabanovich):
JBT should consider ExamplePartialBeanInterface as a bean, because Deltaspike generates an implementation that uses the bound invocation handler.
Our bug here is that with bean-discovery-mode=annotated we ignore annotation type ExamplePartialBeanBinding as having no scope annotation. But since ExamplePartialBeanInterface has a scope annotations, all its annotations should be included to bean discovery process.

> PartialBeanBinding validation in annotated mode
> -----------------------------------------------
>
>                 Key: JBIDE-18345
>                 URL: https://issues.jboss.org/browse/JBIDE-18345
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: cdi-extensions
>    Affects Versions: 4.2.0.CR1
>            Reporter: Rastislav Wagner
>            Assignee: Viacheslav Kabanovich
>             Fix For: 4.3.0.Alpha1
>
>
> Create CDI 1.1 project with deltaspike libs (and PartialBean module).
> Create Binding Annotation
> {code}
> 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 {
> }
> {code}
> Create Partial Bean interface annotated with Binding Annotation
> {code}
> import javax.enterprise.context.ApplicationScoped;
> @ApplicationScoped
> @ExamplePartialBeanBinding
> public interface ExamplePartialBeanInterface {
>     String sayHello(String hello);
> }
> {code}
> 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 ?



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jbosstools-issues mailing list