[JBoss JIRA] (CDI-469) Allow nonbinding producer methods to have scopes
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-469?page=com.atlassian.jira.plugin.sy... ]
Pete Muir commented on CDI-469:
-------------------------------
The injection point isn't valid there, even if the qualifiers are the same. I still don't really understand what you are asking for.
> Allow nonbinding producer methods to have scopes
> ------------------------------------------------
>
> Key: CDI-469
> URL: https://issues.jboss.org/browse/CDI-469
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Beans, Contexts
> Affects Versions: 1.2.Final
> Reporter: John Ament
>
> Currently, you cannot have a nonbinding producer method, e.g. one where the annotation is read at runtime, with a scope. This means that repeated injections always happen. It would be better if you could scope the nonbinding producer methods, so that the results were bound, e.g. to a request scope, so that look ups can be done once.
> The current way to avoid this is to use a holder object with the proper scope.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months
[JBoss JIRA] (CDI-469) Allow nonbinding producer methods to have scopes
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-469?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-469:
----------------------------------
I think you can't relax this restriction as the InjectionPoint is not only about required type and qualifiers. There's bean, member info, etc. As a workaround you could have a separate @ApplicationScoped bean which takes the {{Converted#value()}} as a param and performs the lookup.
> Allow nonbinding producer methods to have scopes
> ------------------------------------------------
>
> Key: CDI-469
> URL: https://issues.jboss.org/browse/CDI-469
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Beans, Contexts
> Affects Versions: 1.2.Final
> Reporter: John Ament
>
> Currently, you cannot have a nonbinding producer method, e.g. one where the annotation is read at runtime, with a scope. This means that repeated injections always happen. It would be better if you could scope the nonbinding producer methods, so that the results were bound, e.g. to a request scope, so that look ups can be done once.
> The current way to avoid this is to use a holder object with the proper scope.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months
[JBoss JIRA] (CDI-476) Inheritance of private observer and initializer methods
by Martin Kouba (JIRA)
Martin Kouba created CDI-476:
--------------------------------
Summary: Inheritance of private observer and initializer methods
Key: CDI-476
URL: https://issues.jboss.org/browse/CDI-476
Project: CDI Specification Issues
Issue Type: Clarification
Components: Inheritance and Specialization
Affects Versions: 1.2.Final
Reporter: Martin Kouba
Initializer and observer methods may be private. In Java, private members are not inherited. However, the spec is not entirely clear in this area.
"4. Inheritance and specialization"
{quote}
Member-level metadata is not inherited. However, injected fields, initializer methods, lifecycle callback methods and non-static observer methods are inherited by beans from their superclasses.
{quote}
"4.2. Inheritance of member-level metadata" (simplified):
{quote}
* If X declares an initializer or non-static observer 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}
There is no mention we strictly follow the JSL here. At first glance, it seems the private members should not be inherited. However, these may be part of a bean initialization. And what happens if we *specialize* a bean with such private members?
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months
[JBoss JIRA] (CDI-280) clarify usage of 'bean' term usage in the spec
by Antoine Sabot-Durand (JIRA)
[ https://issues.jboss.org/browse/CDI-280?page=com.atlassian.jira.plugin.sy... ]
Antoine Sabot-Durand updated CDI-280:
-------------------------------------
Fix Version/s: 2.0 (discussion)
(was: TBD)
> clarify usage of 'bean' term usage in the spec
> ----------------------------------------------
>
> Key: CDI-280
> URL: https://issues.jboss.org/browse/CDI-280
> Project: CDI Specification Issues
> Issue Type: Clarification
> Reporter: Mark Struberg
> Assignee: Antoine Sabot-Durand
> Labels: CDI_api_chge, CDI_spec_chge
> Fix For: 2.0 (discussion)
>
>
> We should go to the spec and look up all 'bean' words as they are 5 different meaning the word 'bean' is used for
> * The Bean<T> extends Contextual<T>. Should be referred as 'Bean' or 'CDI Bean'
> * The class which gets scanned. Should be referred as 'Bean Class' to
> * The instance stored in the context. Should be referred to as 'Contextual Instance'
> * The proxy for a Contextual Instance should be referred to as 'Contextual Reference'
> * The type of an injection point should be referred to as 'InjectionPoint Type'
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months
[JBoss JIRA] (CDI-291) Clarify interceptor/decorator resolution rules
by Antoine Sabot-Durand (JIRA)
[ https://issues.jboss.org/browse/CDI-291?page=com.atlassian.jira.plugin.sy... ]
Antoine Sabot-Durand updated CDI-291:
-------------------------------------
Fix Version/s: 2.0 (discussion)
(was: TBD)
> Clarify interceptor/decorator resolution rules
> ----------------------------------------------
>
> Key: CDI-291
> URL: https://issues.jboss.org/browse/CDI-291
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Decorators, Interceptors
> Affects Versions: 1.0
> Reporter: Jozef Hartinger
> Assignee: Pete Muir
> Fix For: 2.0 (discussion)
>
>
> Currently the spec only says:
> {quote}
> A decorator is bound to a bean if:
> * The bean is assignable to the delegate injection point according to the rules defined in Section 5.2, "Typesafe resolu-
> tion" (using Section 8.3.1, "Assignability of raw and parameterized types for delegate injection points").
> * The decorator is enabled in the bean archive containing the bean.
> {quote}
> AND
> {quote}
> An interceptor is bound to a method if:
> * The method has all the interceptor bindings of the interceptor. A method has an interceptor binding of an interceptor if
> it has an interceptor binding with (a) the same type and (b) the same annotation member value for each member which
> is not annotated @javax.enterprise.util.Nonbinding.
> * The interceptor intercepts the given kind of lifecycle callback or business method.
> * The interceptor is enabled in the bean archive containing the bean.
> {quote}
> What remains unspecified is:
> * In a scenario where a module A enables interceptor X in its beans.xml, does X have to be accessible from A. That effectively means that an EJB jar could (or could not) legally use an interceptor/decorator packaged in a web application.
> * Even if X is accessible, does it have to be packaged in a bean archive or is it enough for it to be packaged in a library that does not contain beans.xml but is accessible from A? This means that a CDI implementation would need to additionally scan those classes as they would not be scanned by normal bean archive discovery.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months
[JBoss JIRA] (CDI-414) Support for "self" injection
by Antoine Sabot-Durand (JIRA)
[ https://issues.jboss.org/browse/CDI-414?page=com.atlassian.jira.plugin.sy... ]
Antoine Sabot-Durand commented on CDI-414:
------------------------------------------
You're right [~agoncal]. But if we decide go that way we should propose something nicely design for *interceptors* and *decorators*. To satisfy this there are two obvious solutions IMO.
# enhance an annotation used by both mechanism. {{@Priority}} seems the only candidate here, or
# introduce an new annotation in interceptor spec to configure this behaviour on the bean or the interceptor / Decorator. Something like {{@InterceptorAttribute}} with different values (in the same spirit than {{@TransactionAttibute}} in EJB spec)
I prefer solution 2 since this annotation could be put at different levels. wdyt?
> Support for "self" injection
> ----------------------------
>
> Key: CDI-414
> URL: https://issues.jboss.org/browse/CDI-414
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Resolution
> Reporter: arjan tijms
>
> Many features of CDI and EJB work by means of a proxy that intercepts calls and adds 'aspects'. In Java it's however not possible to decorate the {{this}} pointer, so methods called on the same bean instance from within a method in the bean do not get their 'aspects' applied.
> This is a well known limitation, but in EJB it's possible to work around this by injecting a bean into itself. E.g.
> {code}
> @Stateless
> public class Foo {
> @EJB
> private Foo self;
> // ...
> }
> {code}
> Also see http://adam-bien.com/roller/abien/entry/how_to_self_invoke_ejb
> Unfortunately using CDI and {{@Inject}} this doesn't work. Weld for instance fails the deployment and logs:
> {noformat}
> WELD-001443 Pseudo scoped bean has circular dependencies.
> {noformat}
> See also: http://adam-bien.com/roller/abien/entry/inject_vs_ejb
> Although there are workarounds, it would be great if {{@Inject}} in combination with CDI could support self injection as well.
> With that projects migrating from {{@EJB}} to {{@Inject}} can do so more easily and the capability can be convenient for new projects as well (e.g. calling two separate {{@Transactional}} methods from a single method without being required to create a new bean).
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
9 years, 10 months