[jbosstools-issues] [JBoss JIRA] (JBIDE-13419) Support invocation handler binding extension of Deltaspike

Viacheslav Kabanovich (JIRA) issues at jboss.org
Mon Mar 10 15:47:10 EDT 2014


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

Viacheslav Kabanovich commented on JBIDE-13419:
-----------------------------------------------

Test cases:
1. Create annotation type
{code}
@PartialBeanBinding
public @interface BindingA {

}
{code}
2. Create bean based on an abstract class
{code}
@BindingA 
@Named
public abstract class BeanA {
}
{code}
ASSERT: Name "beanA" is available for expression language.
ASSERT: Annotation @BindingA in BeanA has warning "Partial bean ... should have an invocation handler" (because handler is not created yet).
3. Create handler
{code}
@BindingA
//@ApplicationScoped
public class HandlerA implements InvocationHandler {
 
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		return null;
	}

}
{code}
ASSERT: Warning in BeanA at @BindingA disappears.
ASSERT: @BindingA in HandlerA has warning "Invocation handler class should be a normal-scoped bean".
4. Uncomment @ApplicationScoped
ASSERT: Warning in HandlerA disappears.
5. Create copy of class HandlerA with name HandlerB.
ASSERT: @BindingA in both handlers has warning "Multiple handlers are found for binding ...".
6. Remove modifier 'abstract' from definition of class BeanA.
ASSERT: @BindingA in BeanA has warning "Binding annotation... can be applied only to abstract classes, 
 interfaces, and classes implementing InvocationHandler".
7. Replace 'class' with 'interface' in BeanA.
ASSERT: Warning at @BindingA in BeanA disappears.
7. Create copy of annotation type BindingA and name it BindingB. Add annotation @BindingB after @BindingA to BeanA definition.
ASSERT: @BindingB in BeanA has warning "Binding annotation BindingB is ignored because class is already annotated with binding annotation BindingA".
                
> Support invocation handler binding extension of Deltaspike
> ----------------------------------------------------------
>
>                 Key: JBIDE-13419
>                 URL: https://issues.jboss.org/browse/JBIDE-13419
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: cdi-extensions
>    Affects Versions: 4.0.0.Final
>            Reporter: Viacheslav Kabanovich
>            Assignee: Viacheslav Kabanovich
>              Labels: new_and_noteworthy
>             Fix For: 4.2.x
>
>
> Objects:
> 1. Binding Annotations - annotation type with @PartialBeanBinding.
> 2. Partial Beans - abstract classes and interfaces annotated with a binding annotation.
> 3. Invocation Handlers - classes inplementing InvocationHandler and annotated with a binding annotation.
> Validation rules:
> 1. Class annotated with a binding annotation should be either abstract, or interface, or implement InvocationHandler.
> Error text: "Binding annotation %annotationName% can be applied only to abstract classes, interfaces, and classes implementing InvocationHandler."
> 2. There should be no more than one invocation handler for each binding annotation.
> Error text: "Multiple handlers are found for binding annotation %annotationName%."
> 3. Invocation handler class should be normal-scoped.
> Error text: "Invocation handler class should be a normal-scoped bean."
> 4. Each partial bean should be bound to an invocation handler.
> Error text: "Partial bean %className% should have an invocation handler for binding annotation %annotationName%."
> 5. Deltaspike implementation of the extension reads the first binding annotation on a class and ignores the next ones. Hence, they should be marked with a warning:
> "Binding annotation %annotationName% is ignored because class is already annotated with binding annotation %firstAnnotationName%."

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list