[JBoss JIRA] (CDI-461) Configuration Workshop for CDI 2.0
by Antoine Sabot-Durand (JIRA)
Antoine Sabot-Durand created CDI-461:
----------------------------------------
Summary: Configuration Workshop for CDI 2.0
Key: CDI-461
URL: https://issues.jboss.org/browse/CDI-461
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: Antoine Sabot-Durand
This umbrella tickets gathers all tickets and work document about studying the possible introduction of configuration feature in CDI 2.0.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 6 months
[JBoss JIRA] (CDI-460) Support repeating qualifiers in CDI SPI
by Antonin Stefanutti (JIRA)
[ https://issues.jboss.org/browse/CDI-460?page=com.atlassian.jira.plugin.sy... ]
Antonin Stefanutti updated CDI-460:
-----------------------------------
Issue Type: Clarification (was: Feature Request)
> Support repeating qualifiers in CDI SPI
> ---------------------------------------
>
> Key: CDI-460
> URL: https://issues.jboss.org/browse/CDI-460
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Portable Extensions
> Affects Versions: 2.0 (discussion)
> Reporter: Antonin Stefanutti
>
> In CDI 1.2, it is not explicitly stated whether altering the annotation-based metadata in a way to add multiple annotations of the same type is possible or not. That situation occurs with the following combinations:
> {{AnnotatedType.getAnnotations()}} and {{ProcessAnnotatedType.setAnnotatedType(AnnotatedType at)}},
> {{BeanAttributes.getQualifiers()}}, and {{ProcessBeanAttributes.setBeanAttributes(BeanAttributes ba)}},
> {{InjectionPoint.getQualifiers}} and {{ProcessInjectionPoint.setInjectionPoint(InjectionPoint ip)}}.
> Being able to decorate these metadata with repeating annotations enables powerful and elegant use cases as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004], that is the ability to use an annotation both as a CDI qualifier and a metadata provider during injection.
> Given that Java 8 provides support for [repeating annotations|http://docs.oracle.com/javase/tutorial/java/annotations/repea...], it seems logical to have repeating annotations supported at the CDI SPI level. Tough, that's important to have that support explicitly stated and specified in CDI.
> Indeed, while Weld permits metadata alteration with repeating annotations, OpenWebBeans does not for the moment though developers understand the need and are willing to open that behavior as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004] as long as that support will be made explicit in the specification.
> That applies as well for {{EventMetadata.getQualifiers}} in _read-only_.
> While that request is technically independent from Java 8, it is correlated to the support of repeating qualifiers in the typesafe resolution mechanism that is likely to be treated as part of the Java 8 stream of the CDI 2.0 specification.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 6 months
[JBoss JIRA] (CDI-104) Support automatic dependency injection for non-managed objects
by Antonin Stefanutti (JIRA)
[ https://issues.jboss.org/browse/CDI-104?page=com.atlassian.jira.plugin.sy... ]
Antonin Stefanutti commented on CDI-104:
----------------------------------------
>From my understanding, this need has been addressed with [{{UnmanagedInstance}}|http://docs.jboss.org/cdi/api/1.1/javax/enterprise/inject/spi/Unmanaged.UnmanagedInstance.html] as documented in [Obtaining non-contextual instance|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bm_obtain_unman...] in CDI 1.1. Isn't it?
> Support automatic dependency injection for non-managed objects
> --------------------------------------------------------------
>
> Key: CDI-104
> URL: https://issues.jboss.org/browse/CDI-104
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Beans
> Affects Versions: 1.0
> Reporter: Dan Allen
> Fix For: TBD
>
>
> Allow objects created using the "new" keyword (or created by some other means) to be injected automatically.
> Conceptually it would look something like this:
> @AutoInject
> public class AccountService {
> private final Account account;
> @Inject
> private PaymentProcessor paymentProcessor;
> AccountService(Account account) {
> this.account = account;
> }
> public void doPayment(double amount) {
> paymentProcessor.processPayment(account, amount);
> }
> }
> We could then create the object using new and the fields will still be injected:
> AccountService a = new AccountService(account);
> a.doPayment(10);
> The inverse design would also be an option. An instance of Account could be retrieved from JPA and the AccountService would be injected into it during construction.
> To implement this feature may require a javaagent, which will modify the bytecode of @AutoInject annotated classes as they are loaded, so that the constructor bytecode looks up the values to inject and sets the injected field values appropriately. (There are other options suggested in the linked thread).
> The primary use case for this feature is to support rich domain models, though the usefulness of this feature extends beyond this case, so I don't think the feature should be dismissed if you don't agree with the rich domain models design.
> The feature also brings the "new" keyword back into the picture of modern programming. You can still create objects in the classic way, but benefit from modern programming model patterns (specifically CDI).
> Spring has a similar feature in it's AOP package: http://static.springsource.org/spring/docs/3.0.x/spring-framework-referen...
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 6 months
[JBoss JIRA] (CDI-460) Support repeating qualifiers in CDI SPI
by Antonin Stefanutti (JIRA)
[ https://issues.jboss.org/browse/CDI-460?page=com.atlassian.jira.plugin.sy... ]
Antonin Stefanutti updated CDI-460:
-----------------------------------
Description:
In CDI 1.2, it is not explicitly stated whether altering the annotation-based metadata in a way to add multiple annotations of the same type is possible or not. That situation occurs with the following combinations:
{{AnnotatedType.getAnnotations()}} and {{ProcessAnnotatedType.setAnnotatedType(AnnotatedType at)}},
{{BeanAttributes.getQualifiers()}}, and {{ProcessBeanAttributes.setBeanAttributes(BeanAttributes ba)}},
{{InjectionPoint.getQualifiers}} and {{ProcessInjectionPoint.setInjectionPoint(InjectionPoint ip)}}.
Being able to decorate these metadata with repeating annotations enables powerful and elegant use cases as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004], that is the ability to use an annotation both as a CDI qualifier and a metadata provider during injection.
Given that Java 8 provides support for [repeating annotations|http://docs.oracle.com/javase/tutorial/java/annotations/repea...], it seems logical to have repeating annotations supported at the CDI SPI level. Tough, that's important to have that support explicitly stated and specified in CDI.
Indeed, while Weld permits metadata alteration with repeating annotations, OpenWebBeans does not for the moment though developers understand the need and are willing to open that behavior as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004] as long as that support will be made explicit in the specification.
That applies as well for {{EventMetadata.getQualifiers}} in _read-only_.
While that request is technically independent from Java 8, it is correlated to the support of repeating qualifiers in the typesafe resolution mechanism that is likely to be treated as part of the Java 8 stream of the CDI 2.0 specification.
was:
In CDI 1.2, it is not explicitly stated whether altering the annotation-based metadata in a way to add multiple annotations of the same type is possible or not. That situation occurs with the following combinations:
{{AnnotatedType.getAnnotations()}} and {{ProcessAnnotatedType.setAnnotatedType(AnnotatedType at)}},
{{BeanAttributes.getQualifiers()}}, and {{ProcessBeanAttributes.setBeanAttributes(BeanAttributes ba)}},
{{InjectionPoint.getQualifiers}} and {{ProcessInjectionPoint.setInjectionPoint(InjectionPoint ip)}}.
Being able to decorate these metadata with repeating annotations enables powerful and elegant use cases as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004], that is the ability to use an annotation both as a CDI qualifier and a metadata provider during injection.
Given that Java 8 provides support for [repeating annotations|http://docs.oracle.com/javase/tutorial/java/annotations/repea...], it seems logical to have repeating annotations supported at the CDI SPI level. Tough, that's important to have that support explicitly stated and specified in CDI.
Indeed, while Weld permits metadata alteration with repeating annotations, OpenWebBeans does not for the moment though developers understand the need and are willing to open that behavior as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004] as long as that support will be made explicit in the specification.
That applies as well for {{EventMetadata.getQualifiers}} in _read-only_.
> Support repeating qualifiers in CDI SPI
> ---------------------------------------
>
> Key: CDI-460
> URL: https://issues.jboss.org/browse/CDI-460
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Portable Extensions
> Affects Versions: 2.0 (discussion)
> Reporter: Antonin Stefanutti
>
> In CDI 1.2, it is not explicitly stated whether altering the annotation-based metadata in a way to add multiple annotations of the same type is possible or not. That situation occurs with the following combinations:
> {{AnnotatedType.getAnnotations()}} and {{ProcessAnnotatedType.setAnnotatedType(AnnotatedType at)}},
> {{BeanAttributes.getQualifiers()}}, and {{ProcessBeanAttributes.setBeanAttributes(BeanAttributes ba)}},
> {{InjectionPoint.getQualifiers}} and {{ProcessInjectionPoint.setInjectionPoint(InjectionPoint ip)}}.
> Being able to decorate these metadata with repeating annotations enables powerful and elegant use cases as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004], that is the ability to use an annotation both as a CDI qualifier and a metadata provider during injection.
> Given that Java 8 provides support for [repeating annotations|http://docs.oracle.com/javase/tutorial/java/annotations/repea...], it seems logical to have repeating annotations supported at the CDI SPI level. Tough, that's important to have that support explicitly stated and specified in CDI.
> Indeed, while Weld permits metadata alteration with repeating annotations, OpenWebBeans does not for the moment though developers understand the need and are willing to open that behavior as discussed in [OWB-1004|https://issues.apache.org/jira/browse/OWB-1004] as long as that support will be made explicit in the specification.
> That applies as well for {{EventMetadata.getQualifiers}} in _read-only_.
> While that request is technically independent from Java 8, it is correlated to the support of repeating qualifiers in the typesafe resolution mechanism that is likely to be treated as part of the Java 8 stream of the CDI 2.0 specification.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 6 months