Notes from CDI EG 28/08/2012
by Pete Muir
Joe Bergmark
===========
We reviewed the status of the issue Joe had worked on:
* Close CDI-235 as a dupe of CDI-219 (done)
* CDI-180 & CDI-223 Joe is going to strengthen the text that requires that a request context that is not initialized by a call, should not be ended by that call (Action Joe to send pull request)
Pete Muir
=======
* CDI-138, allow definition of qualifiers and interceptor bindings using annotated types, to allow @Nonbinding to be added programmatically to member values with a proposal at https://github.com/jboss/cdi/pull/41
- Discussed whether it's better to fire a PAT (or another similar event?) for annotations, allowing them to be modified. Mark to file a new issue for this feature request. We need to collect use cases.
- Should be able to apply @Nonbinding at annotation level (https://issues.jboss.org/browse/CDI-253)
- Hold on applying this issue until we explore whether should fire an event to modify annotations
* CDI-218 Allow use of WEB-INF/classes/META-INF/beans.xml with a proposal at https://github.com/jboss/cdi/pull/74
- Apply (done)
* CDI-214, Remove BeanManager from Servlet context, a revert of CDI-73 with a proposal at https://github.com/jboss/cdi/pull/74
-Apply (done)
* CDI-177 Better handling of @Named defaults for qualifiers with a proposal at https://github.com/jboss/cdi/pull/77/files
- Joe raised an issue that we will break existing CDI apps who have explicitly or implicitly (e.g. via a producer method) the same as a now defaulted qualifier
- Mark thinks it's spec'd this way already, but Martin and I think it's not. Needs clarification!
- Pete to investigate, but probably have to special case it that the name is only defaulted if not explicitly specified elsewhere or something
- hold for now
* CDI-187 Interceptors and decorators should be required to be passivation capable, not serializable, with a proposal athttps://github.com/jboss/cdi/pull/78
- Apply (done)
* CDI-234 Handle array and annotation valued members on qualifiers, with a proposal at https://github.com/jboss/cdi/pull/79
- Definitely do this, removes a wart
- Concern that JDK defined equality of arrays is not ideal in many cases for the way people use arrays on qualifiers
- discussed a declarative approach (e.g. @Unordered)
- discussed a SPI approach (user can specify a comparator to use)
- discussed that we should expose a BeanManager.compare(qualifier1, qualifier2) type method that applys rules (https://issues.jboss.org/browse/CDI-223)
- group preferred SPI approach
- Pete to draft a proposal for SPI approach
* CDI-183 Require CDI.current() to work in Java EE servers with a proposal at https://github.com/jboss/cdi/pull/85
- Update to require it to work only between BBD and BS (Pete)
* CDI-184 Add CDI.setCDIProvider() for environments where service providers don't work e.g. OSGi with a proposal at https://github.com/jboss/cdi/pull/86
- Apply (done)
* CDI-165 Encourage custom context implementations to fire events when they are initialized and destroyed, with a proposal at https://github.com/jboss/cdi/pull/87
- Apply (done)
* CDI-43 Adding filters to extensions to limit when they are called, with a proposal at https://github.com/jboss/cdi/pull/88
- Update proposal to require considering meta-annotations as things the extension is interested in (Pete) and then then apply
* CDI-245 & CDI-249 Discussion how extensions work, and what can be injected into them, with a proposal at https://github.com/jboss/cdi/pull/89
- Update proposal with latest discussion on issue, and also add an IllegalStateException if BeanManager.fireEvent() is called with an EventType that is assignable to a container lifecycle event type
Mark Struberg
===========
* CDI-60, @Veto etc.
- Remove @Requires
- Discussed that @Disabled might still be useful, to declaratively disable a bean, put still run it's PAT
- Mike advocated very strongly in favor of @Vetoed which stops a class from passing through @PAT at all
- Write up proposal and seek community feedback (Pete)
* CDI-228
- Went through the issue and all agreed that the most important thing is to keep the semantics of all injection types the same by default
- Proposed adding a @Throwaway (name tbc!) parameter annotation which indicates to the container that an injected bean has a truncated lifecycle, and is destroyed when the method/constructor invocation ends. This allows non-serializables beans (e.g. factories) to be injected into serializable beans. It also allows a dependent bean graph which must be kept around (to call a @PreDestroy somewhere) to be got rid of early. Mark to write up a proposal.
11 years, 7 months
[JBoss JIRA] Created: (CDI-109) Invalid beans should not be injectable into extensions
by John Ament (JIRA)
Invalid beans should not be injectable into extensions
------------------------------------------------------
Key: CDI-109
URL: https://issues.jboss.org/browse/CDI-109
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: John Ament
Currently, you can inject beans that may not be ready yet into the extension's call back methods. As an example, I can inject something application scoped like this in to an extension, but it should really be throwing a definition exception (or similar):
public void handleABD(@Observes AfterBeanDiscovery abd, MyApplicationScopedBean masb) {
}
Pete had noted that really the only safe thing to inject, other than the observed call back, is the bean manager.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months
[JBoss JIRA] (CDI-43) Allow Extensions to specify the annotations that they are interested in
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-43?page=com.atlassian.jira.plugin.sys... ]
Pete Muir resolved CDI-43.
--------------------------
Resolution: Done
> Allow Extensions to specify the annotations that they are interested in
> -----------------------------------------------------------------------
>
> Key: CDI-43
> URL: https://issues.jboss.org/browse/CDI-43
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Portable Extensions
> Affects Versions: 1.0
> Reporter: Stuart Douglas
> Assignee: Pete Muir
> Fix For: 1.1.PRD
>
>
> Currently portable extensions that wish to look for a specific annotation have to look through all availible classes in the ProcessAnnotatatedType event, which is quite inefficient. It would be good if extensions could do something like:
> public void processAnnotatedType(@Observes @RequireAnnotations({(a)Unwraps.class}) ProcessAnnotatedType pat)
> This could allow the container to take advantage of annotation indexing to improve boot time performance, as well as reducing uneeded processing in the observer.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months
LJC comments/questions
by Luigi Bitonti
Hi All,
My name is Luigi Bitonti and I am a member of the London Java Community (LJC). We are interested in the CDI 1.1 specification and would like to help by contributing our point of view as developers. We are also keen to help with any tasks you feel like assigning to us. We have read the latest draft specification and put together a first round of comments and questions:
All the discussions and development are being tracked on Jira (https://issues.jboss.org/browse/CDI). The whole process seems very transparent and easy to follow which is a very good thing. We view very positively the adoption of JCP 2.8.
It looks like there is also a private mailing list the EG uses. Is that in use? What's its purpose?
It looks like good work is being done and some interesting new addition have already made it into this new version of the specification, such as:
- CDI-86 Support firing general purpose lifecycle events in Java EE environments
- CDI-129 Clarify behaviour of @ApplicationScoped in EARs
What we would like to see going forward is an "easier and clearer" specification, so the current efforts seem to be going in the right direction. Hopefully more good proposals will be implemented as part of the final version.
The lack of clear separation between the SE and EE parts of the specification seems to be an issue that limits adoption. This is also related to the lack of a standard way of bootstrapping the DI container in SE. In this respect we believe the following planned changes will bring improvements:
- CDI-160 Split the specification into "Core" and "EE integrations".
- CDI-26 Provide a bootstrap API for the CDI container outside of an EE container.
Do you think these will make it into CDI 1.1?
Other interesting proposals we would like to see implemented are:
- CDI-139 Support for unmanaged instances.
- CDI-110 Provide support for binding an invocation handler to an interface or abstract class
- CDI-30 An API for managing built in contexts
I've noticed the first 2 have been voted at the top of the most popular issues. I suppose they are very likely to make it into CDI 1.1. Is that correct?
Regarding the following issue, we have a question:
- CDI-51 Support static injection
Static injection would still not be allowed for final fields, just as for the non-static case, right?
Thanks for all your work on the specification. I hope we'll be able to help your efforts going forward.
Cheers,
Luigi
11 years, 7 months