[JBoss JIRA] (CDI-225) Clarify whether bean discovery MAY or MUST NOT include class loading
by Harald Wellmann (JIRA)
Harald Wellmann created CDI-225:
-----------------------------------
Summary: Clarify whether bean discovery MAY or MUST NOT include class loading
Key: CDI-225
URL: https://issues.jboss.org/browse/CDI-225
Project: CDI Specification Issues
Issue Type: Clarification
Components: Resolution
Affects Versions: 1.1.EDR1
Reporter: Harald Wellmann
The CDI 1.0 spec and also the current 1.1 draft is rather vague about the issue of class loading vs. class file byte code scanning for bean discovery.
By default, I would assume the term "class" in a specification to refer to a loaded class, unless explicitly stated otherwise. A feature like Seam Solder's
{code}
@Requires(OptionalDependency.class)
public class OptionalBean
{code}
will necessarily break if the CDI container loads OptionalBean during bean discovery - when OptionalDepencency is not available, OptionalBean cannot be loaded, and the CDI container won't even see the @Requires annotation.
See also http://seamframework.org/Seam3/Compatibility, Section Overzealous class scanner.
The way I read the CDI spec, GlassFish is fully spec compliant (but maybe not very efficient) in loading bean archive classes for the purpose of discovery.
@Requires is also spec compliant, but not portable because it tacitly assumes that classes get scanned but not loaded.
So if scanning in place of loading has been a tacit assumption of the CDI 1.0 authors all the time, it should be made explicit in CDI 1.1. Otherwise, if loading is also a valid option, this should be clearly stated so that extension authors will not rely on accidental features of a given CDI implementation.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] (CDI-229) introduce @OverridesAttribute for @StereoType
by Mark Struberg (JIRA)
Mark Struberg created CDI-229:
---------------------------------
Summary: 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.EDR1
Reporter: Mark Struberg
We recently had a thread on the DeltaSpike list about using StereoTypes in real world applications: http://markmail.org/thread/uqozhsix2znwiebn
------
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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (CDI-132) Clarify which initial info AnnotatedType should contain
by Mark Struberg (JIRA)
Clarify which initial info AnnotatedType should contain
-------------------------------------------------------
Key: CDI-132
URL: https://issues.jboss.org/browse/CDI-132
Project: CDI Specification Issues
Issue Type: Clarification
Reporter: Mark Struberg
The spec is not exactly clear about the initial content of AnnotatedType.
When initially building the AnnotatedType (e.g. before handing it over to the Extensions) we need to pre-fill them with the info from the annotations from the classes.
Should this AnnotatedType:
1.) contain no annotations from superclasses?
2.) contain all annotations from superclasses?
3.) contain @Inherited annotations from superclasses?
I think the other questions already got cleared up in CDI-70:
Should AnnotatedType contain derived public? protected? private? methods/fields from a superclass?
Imo it should contain all information which would be available by manually parsing any annotations. In other words: it should be possible to completely modify or emulate annotations of a parsed type.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months