[cdi-dev] [JBoss JIRA] (CDI-229) introduce @OverridesAttribute for @StereoType

José Freitas (JIRA) jira-events at lists.jboss.org
Thu Oct 4 09:10:03 EDT 2012


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

José Freitas edited comment on CDI-229 at 10/4/12 9:08 AM:
-----------------------------------------------------------

That would be very useful.
I've crossed a dozens times with that need.


I also liked the @Propagate proposal.
                
      was (Author: spinner):
    That would be very useful.
I've crossed a dozens times with that need.

                  
> introduce @OverridesAttribute for @StereoType
> ---------------------------------------------
>
>                 Key: CDI-229
>                 URL: https://issues.jboss.org/browse/CDI-229
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Beans
>    Affects Versions: 1.1.EDR
>            Reporter: Mark Struberg
>             Fix For: 1.1 (Proposed)
>
>
> We recently had a thread on the DeltaSpike list about using StereoTypes in real world applications: http://markmail.org/thread/ntqwnsyukjvdwspm
> ------
> Imagine the following Stereotype for my Services (I spare out the standard
> stuff)
> @StereoType @Secured @Transactional @ApplicationScoped 
> public @interface @Service {}
> The problem here is that there is no way to 'propagate' any rolesAllowed from
> @Service to @Secured, etc.
> What I'd like to have is something like ... 
> public @interface @Service {
>     String[] rolesAllowed();     
>     TransactionAttributeType transactionType();
> }
> where the rolesAllowed() would get propagated to the @Secured meta-annotation
> and transactionType() to the @Transactional 
> -----------
> Gerhard Petracek now pointed me to a cool feature which is used in JSR-303 BVAL: @OverridesAttribute
> http://docs.oracle.com/javaee/6/api/javax/validation/OverridesAttribute.html
> We should ping the BVAL EG for the details. There are quite a few little tricks and side effects to consider.
> On the implementation side, we could e.g. pick the @StereoType annotation and automatically propagate those values to the AnnotatedType which get's passed to the Extensions

--
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 cdi-dev mailing list