Help

I've just submitted an early draft of the Contexts and Dependency Injection 1.1 (CDI, JSR-346) to the JCP. We (the CDI community) have completed around a third of the features we want to see in CDI 1.1, so wanted to post an early draft to get some wider feedback. Whilst the JCP sort out the paperwork, you can read the draft on jboss.org :-)

So, what's been added since CDI 1.0?

  • @Disposes methods for producer fields
  • The CDI class, which provides programmatic access to CDI facilities from outside a managed bean
  • Pass the qualifiers an event was fired with to the ObserverMethod
  • Ability to veto beans declaratively using @Veto and @Requires
  • Ability to access the BeanManager from the ServletContext
  • Conversations in Servlet requests
  • Application lifecycle events in Java EE
  • Injection of Bean metadata into bean instances
  • Programmatic access to a container provided Producer, InjectionTarget, AnnotatedType
  • Ability to override attributes of a Bean via BeanAttributes
  • Ability to process modules via ProcessModule
  • Ability to wrap the InjectionPoint
  • Ability to obtain Extension instances from BeanManager
  • Injection of the ServletContext
  • Access to beans.xml in ProcessModule
  • Injection into enums
  • Around 60 issues addressed

However, don't worry if your favorite new feature isn't listed - we're still planning to add:

  • XML configuration
  • Global ordering for interceptors, decorators and events
  • Global enablement of interceptors, decorators and alternatives
  • Multi-plexed contexts (multi-tennancy support)
  • Service Handlers
  • Split specification into core and Java EE integration
  • Bootstrap support
  • Java SE context definition
  • Transaction scope

We're also tracking the development of other features such as:

  • Declarative transactions for managed beans
  • Async invocation and timers
  • JMS / CDI integration

So, what do you think? You can comment on this blog, email the cdi-dev@lists.jboss.org list, or direct comments to me.

What do you like? What have we missed? What don't you like? The purpose of the EDR is to get your feedback - so please, get in touch!

9 comments:
 
06. Oct 2011, 03:35 CET | Link
Franck

XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?

 
06. Oct 2011, 07:45 CET | Link
Franck wrote on Oct 05, 2011 21:35:
XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?

Why won't Gavin be happy about it? It wasn't his decision to take it out of the original spec.

 
06. Oct 2011, 08:19 CET | Link
Geoffrey De Smet
Franck wrote on Oct 05, 2011 21:35:
XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?

I presume the XML configuration is optional. Like orm.xml in JPA, only a minority will probably use it. But useful none the less.

 
06. Oct 2011, 08:51 CET | Link
Shane Bryzak wrote on Oct 06, 2011 01:45:
Franck wrote on Oct 05, 2011 21:35:
XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?
Why won't Gavin be happy about it? It wasn't his decision to take it out of the original spec.

Because the XML stuff took us half a year back then. And then came some big$$ companies and told us that it must look like the syntax defined in the EJB and EE spec. Expect that exactly that will happen again and again.

Plus it doesn't add any benefit to have it in the spec rather than an Extension. Au contraire: in an Extension you can easily add things like wildcard configuration, etc - which you cannot once it's written down in the CDI spec. Plus we will really be pissed in later CDI specs to keep this stuff compatible!

LieGrue,

strub

 
06. Oct 2011, 08:57 CET | Link
Shane Bryzak wrote on Oct 06, 2011 01:45:
Franck wrote on Oct 05, 2011 21:35:
XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?
Why won't Gavin be happy about it? It wasn't his decision to take it out of the original spec.

Well, it was my decision, though obviously pressure from other folks played a big part in this, and at the time I had some misgivings. But the truth is it was probably the right thing to do in 1.0. As for 1.1, I don't have an especially strong opinion, though I do hope if it does go in, then it winds up with the flavor of what we were contemplating in the original spec (and what has been done in Solder), rather then the flavor of the traditional EE schemas.

Oh, and, congrats Pete!

 
14. Oct 2011, 02:18 CET | Link
Under... We're also tracking the development of other features such as:

Be sure to add JSF. I hear, but don't know, that they are going to drop support for ManagedBeans and just rely on CDI.
I believe Arun Gupta did a poll or something at JavaOne.

Don't remember all of the details, but another one of those things that need to be tracked.

 
15. Oct 2011, 23:21 CET | Link
Gavin King wrote on Oct 06, 2011 02:57:
Shane Bryzak wrote on Oct 06, 2011 01:45:
Franck wrote on Oct 05, 2011 21:35:
XML Configuration??? I thought it was kept off intentionally. Gavin won't be happy about this one. Could you elaborate? Are you personally in favour of it?
Why won't Gavin be happy about it? It wasn't his decision to take it out of the original spec.
Well, it was my decision, though obviously pressure from other folks played a big part in this, and at the time I had some misgivings. But the truth is it was probably the right thing to do in 1.0. As for 1.1, I don't have an especially strong opinion, though I do hope if it does go in, then it winds up with the flavor of what we were contemplating in the original spec (and what has been done in Solder), rather then the flavor of the traditional EE schemas.

We've had a long discussion on the mailing list about this, but to bring everyone up to speed, what we've been asked to look at by the Java EE expert group is adding an XML configuration syntax along the lines the CDI 1.0 EG proposed originally, and has been implemented in Solder.

I'm fulling expecting the CDI 1.1 EG to be of the same opinion as the 1.0 EG - if we are told to use something akin to what is in EJB, then we would prefer to leave it out.

So I strongly suspect Gavin will be quite happy, given he originally designed the approach, and originally proposed that this should go into CDI ;-)

It's not something I personally care about a lot, however I do care about the opinion of our users, and so far I have 3 people telling me it shouldn't go in, and a whole room full telling me it should...

As I proposed on the mailing list I will set up a poll to get a more general read on people's opinions...

Oh, and, congrats Pete!

Thanks :-)

 
18. Dec 2011, 13:08 CET | Link
Maslen Lamovski

What about @Unwraps? I thought you wanted to add @Unwraps in the next CDI specification.

 
24. Jan 2012, 02:27 CET | Link
Paulo Reis

Please, CDI/JMS Integration, that's really important!