[forge-dev] Adding @Named to an EJBs... or anywhere

Antonio Goncalves antonio.mailing at gmail.com
Sun Jun 15 16:41:55 EDT 2014


Here is the JIRA : https://issues.jboss.org/browse/FORGE-1880 (Being able
to add @Named to an EJBs... or any annotation anywhere)

I've linked it to https://issues.jboss.org/browse/FORGE-1838 (Being able to
generate methods) because at the end of the day, the idea behind both JIRAs
is being able to add Java artifacts (attributes, annotations, methods...)
to any kind of component (entity, backing bean, rest endpoint...)


2014-06-13 16:00 GMT+02:00 George Gastaldi <ggastald at redhat.com>:

> +1, is there a JIRA already for this?
>
> Em 13/06/2014, às 10:51, "Ivan St. Ivanov" <ivan.st.ivanov at gmail.com>
> escreveu:
>
> Hi folks!
>
> I think that java-add-annotation is a good command that we should have.
> But still it would be better to have also something more explicit for
> creating named beans and setting stereotypes. So, I think that the three
> levels of abstraction that Antonio described may be implemented. Well, at
> the end they will reuse one and the same code for adding annotation, so no
> repeating ourselves will occur.
>
> Cheers,
> Ivan
>
>
> On Fri, Jun 13, 2014 at 4:39 PM, George Gastaldi <ggastald at redhat.com>
> wrote:
>
>> I am leaning towards the java-add-annotation approach as it seems more
>> intuitive and could solve other use cases that may arise.
>>
>> Em 13/06/2014, às 04:19, Antonio Goncalves <antonio.mailing at gmail.com>
>> escreveu:
>>
>> When I create an EJB with Forge with the following command :
>>
>> ejb-new-bean --named MyService
>>
>> I get the following :
>>
>> @Stateless
>> @LocalBean
>> public class MyService implements Serializable
>>
>> In some cases, I would need to add an extra @Named annotation. Several
>> ways to do it. On the EJB command itself, we could add a parameter :
>>
>> ejb-new-bean --named MyService --addNamed
>>
>> But I think it would be good to have something more generic that could be
>> used anywhere. We could use the same logic as constraint-add (that adds
>> any kind of constraint on any Entity) and have something like
>>
>> cdi-add-qualifier --qualifier Named --target org.app.service.MyService
>> // or on a property, which could be useful
>> cdi-add-qualifier --qualifier Named --onProperty myProp
>> cdi-add-qualifier --qualifier Named --onMethod myMethod
>>
>> Or something even more generic would be to use the Java command
>>
>> java-add-annotation --annotation javax.inject.Named --target
>> org.app.service.MyService
>> java-add-annotation --annotation javax.inject.Named --target
>> org.app.service.MyService --onProperty myProp
>> java-add-annotation --annotation javax.inject.Named --target
>> org.app.service.MyService --onMethod myMethod
>> java-add-annotation --annotation javax.inject.Named --onProperty myProp
>> java-add-annotation --annotation javax.inject.Named --onMethod myMethod
>>
>> Any thoughts ?
>>
>> Antonio
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>



-- 
Antonio Goncalves
Software architect and Java Champion

Web site <http://www.antoniogoncalves.org/> | Twitter
<http://twitter.com/agoncal> | LinkedIn <http://www.linkedin.com/in/agoncal>
 | Paris JUG <http://www.parisjug.org/> | Devoxx France
<http://www.devoxx.fr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20140615/37badaf9/attachment.html 


More information about the forge-dev mailing list