[JBoss JIRA] (CDI-479) How to identify the bean a static observer method belongs to
by Tomas Remes (JIRA)
[ https://issues.jboss.org/browse/CDI-479?page=com.atlassian.jira.plugin.sy... ]
Tomas Remes commented on CDI-479:
---------------------------------
I am not sure but isn't the answer for the first question in `4.2. Inheritance of member-level metadata`:
{quote}
If X declares an initializer, non-static observer, @PostConstruct or @PreDestroy method x()
then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X
and a superclass of Y overrides the method x()
{quote}
>From this I would say the observer shouldn't be detected (because is static) in the first case.
> How to identify the bean a static observer method belongs to
> ------------------------------------------------------------
>
> Key: CDI-479
> URL: https://issues.jboss.org/browse/CDI-479
> Project: CDI Specification Issues
> Issue Type: Clarification
> Reporter: Martin Kouba
>
> Let's sum up some parts of the spec which are relevant to static observer methods:
> "10.4. Observer methods":
> {quote}
> An observer method is a non-abstract method of a managed bean class or session bean class...
> An observer method may be either static or non-static.
> {quote}
> "10.3. Observer resolution":
> {quote}
> An event is delivered to an observer method if:
> * The observer method belongs to an enabled bean.
> * ...
> {quote}
> "12.4.3. Bean discovery":
> {quote}
> For each observer method of every enabled bean, the container registers an instance of the ObserverMethod interface defined in The ObserverMethod interface.
> {quote}
> Now what is the algorithm to *identify the bean a static observer method belongs to*? Is is bound to all beans whose Bean.getBeanClass() declares the method? There are two special scenarios I have in mind:
> h3. Static observer method on an abstract class
> {code:java}
> public abstract class Foo {
> public static observe1(@Observes Event1 event1) {
> }
> }
> public class Bar extends Foo {
> }
> {code}
> Foo is not a bean. Foo.observe1() is not a method of managed bean class Bar (if we strictly follow the JSL). Is the observer method detected? Does it belong to Bar? What if there are several subclasses of Foo?
> h3. Specialization
> {code:java}
> public class Foo {
> public static observe1(@Observes Event2 event2) {
> }
> }
> @Specializes
> public class Bar extends Foo {
> }
> {code}
> Foo is specialized by Bar and thus it's disabled. Is the observer method detected? Does it belong to Bar?
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-560) A bean archive does not have to contain a beans.xml file
by Tomas Remes (JIRA)
[ https://issues.jboss.org/browse/CDI-560?page=com.atlassian.jira.plugin.sy... ]
Tomas Remes commented on CDI-560:
---------------------------------
I created https://github.com/cdi-spec/cdi/pull/280
> A bean archive does not have to contain a beans.xml file
> --------------------------------------------------------
>
> Key: CDI-560
> URL: https://issues.jboss.org/browse/CDI-560
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Concepts
> Affects Versions: 2.0-EDR1
> Environment: Section 5.1 Modularity: The library is a bean archive if it contains
> a beans.xml file, as defined in Bean archives.
> It contradicts with the section 12.1
> An archive which:
> contains a beans.xml file with the bean-discovery-mode of none, or,
> contains an extension and no beans.xml file
> is not a bean archive.
> Therefore, an archive with beans.xml is not a bean archive if the bean-discovery-mode = "none".
> I think it is better to be "The library may be a bean archive, as defined in Bean archives."
> Reporter: Emily Jiang
> Priority: Minor
> Fix For: 2.0 (proposed)
>
>
> Section 5.1 Modularity: The library is a bean archive if it contains
> a beans.xml file, as defined in Bean archives.
> It contradicts with the section 12.1
> {quote}
> An archive which:
> * contains a beans.xml file with the bean-discovery-mode of none, or,
> * contains an extension and no beans.xml file
> is not a bean archive.
> {quote}
> Therefore, an archive with beans.xml is not a bean archive if the bean-discovery-mode = "none".
> I think it is better to be "The library may be a bean archive, as defined in Bean archives."
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-588) Adding missing annotation Literals
by Antonin Stefanutti (JIRA)
[ https://issues.jboss.org/browse/CDI-588?page=com.atlassian.jira.plugin.sy... ]
Antonin Stefanutti edited comment on CDI-588 at 3/9/16 7:12 AM:
----------------------------------------------------------------
I wonder whether that would make sense / be possible to provide literal for {{Priority}}.
I've just needed it here: https://github.com/apache/camel/blob/1b89ecd902cfce8b8a074580cfec084de8df...
The use case is to automatically select an alternative globally for the entire application from a test synthetic bean archive and not having it selected for the test bean archive only which is useless.
was (Author: stefanutti):
I wonder whether that would make sense / be possible to provide literal for {{Priority}}.
I've just needed it here: https://github.com/apache/camel/blob/1b89ecd902cfce8b8a074580cfec084de8df...
The use case is to select an alternative globally for the entire application from a test synthetic bean archive and not having it selected for the test bean archive only with is useless.
> Adding missing annotation Literals
> ----------------------------------
>
> Key: CDI-588
> URL: https://issues.jboss.org/browse/CDI-588
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Reporter: Antoine Sabot-Durand
> Assignee: Martin Kouba
>
> We forgot literals for {{Inject}} and more questionably literals for:
> * {{Observes}} and {{ObservesAsync}}
> * {{Produces}} and {{Disposes}}
> * {{Specializes}}
> * {{TransientReference}}
> * {{Vetoed}}
> Most of these can be used to help defining a new AnnotatedType to be added to set of discovered types.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-588) Adding missing annotation Literals
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-588?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba reassigned CDI-588:
--------------------------------
Assignee: Martin Kouba
> Adding missing annotation Literals
> ----------------------------------
>
> Key: CDI-588
> URL: https://issues.jboss.org/browse/CDI-588
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Reporter: Antoine Sabot-Durand
> Assignee: Martin Kouba
>
> We forgot literals for {{Inject}} and more questionably literals for:
> * {{Observes}} and {{ObservesAsync}}
> * {{Produces}} and {{Disposes}}
> * {{Specializes}}
> * {{TransientReference}}
> * {{Vetoed}}
> Most of these can be used to help defining a new AnnotatedType to be added to set of discovered types.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-588) Adding missing annotation Literals
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-588?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-588:
----------------------------------
+1 for {{Priority}} literal!
> Adding missing annotation Literals
> ----------------------------------
>
> Key: CDI-588
> URL: https://issues.jboss.org/browse/CDI-588
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Reporter: Antoine Sabot-Durand
>
> We forgot literals for {{Inject}} and more questionably literals for:
> * {{Observes}} and {{ObservesAsync}}
> * {{Produces}} and {{Disposes}}
> * {{Specializes}}
> * {{TransientReference}}
> * {{Vetoed}}
> Most of these can be used to help defining a new AnnotatedType to be added to set of discovered types.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-588) Adding missing annotation Literals
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-588?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-588:
----------------------------------
+1 for {{Vetoed}}, {{Inject}}, {{Specializes}} and {{TransientReference}}
> Adding missing annotation Literals
> ----------------------------------
>
> Key: CDI-588
> URL: https://issues.jboss.org/browse/CDI-588
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Reporter: Antoine Sabot-Durand
>
> We forgot literals for {{Inject}} and more questionably literals for:
> * {{Observes}} and {{ObservesAsync}}
> * {{Produces}} and {{Disposes}}
> * {{Specializes}}
> * {{TransientReference}}
> * {{Vetoed}}
> Most of these can be used to help defining a new AnnotatedType to be added to set of discovered types.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-588) Adding missing annotation Literals
by Antoine Sabot-Durand (JIRA)
Antoine Sabot-Durand created CDI-588:
----------------------------------------
Summary: Adding missing annotation Literals
Key: CDI-588
URL: https://issues.jboss.org/browse/CDI-588
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: Antoine Sabot-Durand
We forgot literals for {{Inject}} and more questionably literals for:
* {{Observes}} and {{ObservesAsync}}
* {{Produces}} and {{Disposes}}
* {{Specializes}}
* {{TransientReference}}
* {{Vetoed}}
Most of these can be used to help defining a new AnnotatedType to be added to set of discovered types.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (CDI-527) allow proxying of classes with non-private final methods
by Romain Manni-Bucau (JIRA)
[ https://issues.jboss.org/browse/CDI-527?page=com.atlassian.jira.plugin.sy... ]
Romain Manni-Bucau commented on CDI-527:
----------------------------------------
Suggestion: @Passthrough
> allow proxying of classes with non-private final methods
> --------------------------------------------------------
>
> Key: CDI-527
> URL: https://issues.jboss.org/browse/CDI-527
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Beans
> Affects Versions: 1.2.Final
> Reporter: Mark Struberg
> Assignee: Mark Struberg
> Fix For: 2.0 (proposed)
>
>
> Currently we explicitly disallow proxying of classes with non-private final methods.
> EJB _does_ allow this. And there are a few final methods in the JDK and other libs. E.g. HashMap#initHashSeedAsNeeded. Currently we cannot have a producer method for it.
> We might rethink our decision and allow it. Probably with an own annotation like @AllowProxying which disables this check for certain cases (subclass managed-beans or producers).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months