[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-671:
----------------------------------
More or less ;-). The {{@Default}} qualifier is not added unless required qualifiers are empty. I will update the table with examples.
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Antoine Sabot-Durand (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Antoine Sabot-Durand commented on CDI-671:
------------------------------------------
[~mkouba]I find your proposal interesting. But to be sure that everyone understand, in Weld when you request a custom qualifier (i.e. {{CDI.current().select(Foo.class,MyQualifier.Literal.INSTANCE)}}), is the {{@Default}} removed or not?
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-671:
----------------------------------
bq. I think John only meant to say that the spec does not mention that you cannot @Inject CDI<Object>.
It does not say you can ;-). I.e. there is no built-in bean with {{javax.enterprise.inject.spi.CDI}} in its set of bean types or other wording which would imply this.
bq. I don't really see any harm in not specifying this. It has been like that since 1.2 and apparently it caused no harm.
Note that in CDI 1.2 there was only {{javax.enterprise.inject.spi.CDI}}, in 2.0 we have two more use cases ({{SeContainer}}, {{BeanManager.createInstance()}}). So the probability that a user will run into incompatibilitites is much higher.
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Matej Novotny (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Matej Novotny commented on CDI-671:
-----------------------------------
I think John only meant to say that the spec does not mention that you cannot {{@Inject CDI<Object>}}. Not that we should support that. I also don't see any benefit there.
as for this issue itself - not sure how OWB stands in this; they might operate differently than we do in Weld, but to me it seems reasonable to say that by doing {{CDI.current()}} you actually get the same result as if you did {{@Inject Instance<Object>}} (meaning {{@Default}}. But in case there would be too much hassle about it, I don't really see any harm in not specifying this. It has been like that since 1.2 and apparently it caused no harm.
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-671:
----------------------------------
Well, why to {{@Inject CDI<Object>}} if you could {{@Inject Instance<Object>}} and {{@Inject BeanManager}}? I don't see a benefit.
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-671:
--------------------------------
Another thing not specified, which we may want to, is that you cannot {{@Inject CDI<Object>}} even though {{CDI}} inherits from {{Instance}}
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (CDI-671) SPI element related to Instance are missing info about their qualifier
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-671?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-671:
----------------------------------
Also note that the behavior for {{javax.enterprise.inject.spi.CDI}} is undefined in CDI 1.2 and there should be no TCK test for this.
> SPI element related to Instance are missing info about their qualifier
> ----------------------------------------------------------------------
>
> Key: CDI-671
> URL: https://issues.jboss.org/browse/CDI-671
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Javadoc and API
> Affects Versions: 2.0.Beta1
> Reporter: Antoine Sabot-Durand
> Fix For: 2.0 .Final
>
>
> Following elements are related to {{Instance}} interface:
> * {{CDI}} class implements {{Instance}}
> * {{SeContainer}} extends {{Instance}}
> * {{BeanManager.createInstance()}} returns and {{Instance}} object
> If these {{Instance}} usage are all {{Instance<Object>}} there's no information regarding their qualifier.
> We should state in Javadoc and spec that these Instance behaves like an injected instance with {{@Inject @Any Instance<Object>}} to allow access to all beans instance in the container.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years