[cdi-dev] Dynamic stereotypes

Mark Struberg struberg at yahoo.de
Wed May 2 07:54:16 EDT 2012


I have not seen those dynamic stereotypes in free nature yet.

Actually I'm not using Stereotypes that much at all. Mainly because their usage is limited by the Java Annotation boundaries.

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

With such an annotation I could use:

@Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
public String doSomething() {...



But that's not possible with Java Annotations. Or do you have any ideas how to do that? (without having to manually propagate this in each and every interceptor).


LieGrue,
strub



----- Original Message -----
> From: Pete Muir <pmuir at redhat.com>
> To: cdi-dev at lists.jboss.org; deltaspike-dev at incubator.apache.org; David Blevins <david.blevins at gmail.com>
> Cc: 
> Sent: Wednesday, May 2, 2012 1:05 PM
> Subject: [cdi-dev] Dynamic stereotypes
> 
> Hi all
> 
> The Java EE spec leads would like feedback on how often stereotypes are 
> "dynamic" vs "static".
> 
> A static stereotype is one that is defined in Java code, compiled, and then 
> deployed without modification from a container extension.
> 
> A dynamic stereotype is one that defined in Java code, compiled, and then 
> modified by an extension.
> 
> Another way of putting it is:
> 
> * Are there any extensions which modify stereotypes?
> * Is this something that is common or not?
> 
> This relates to David's metatype proposal.
> 
> Pete
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 



More information about the cdi-dev mailing list