[cdi-dev] Fwd: Enum injection

Lincoln Baxter lbaxter at redhat.com
Tue Sep 6 11:11:40 EDT 2011



--
Lincoln Baxter, III
JBoss, by Red Hat
lbaxter at redhat.com

"If you want something, you'll find a way; if you don't, you'll find an excuse."

----- Forwarded Message -----
From: "Lincoln Baxter" <lbaxter at redhat.com>
To: "Pete Muir" <pmuir at redhat.com>
Sent: Tuesday, September 6, 2011 11:11:26 AM
Subject: Re: [cdi-dev] Enum injection

I think that because Enums are not "Classes" they have been excluded. If you look at Brian's issue, I believe this doesn't work in Weld. Maybe it's just a bug, but in any case, the spec is not clear on the issue. 

--
Lincoln Baxter, III
JBoss, by Red Hat
lbaxter at redhat.com

"If you want something, you'll find a way; if you don't, you'll find an excuse."

----- Original Message -----
From: "Pete Muir" <pmuir at redhat.com>
To: "Lincoln Baxter" <lbaxter at redhat.com>
Sent: Tuesday, September 6, 2011 10:28:40 AM
Subject: Re: [cdi-dev] Enum injection

I believe enums in Bean Archives should be scanned today actually, can you see anything in the spec that stops this?

On 6 Sep 2011, at 15:23, Lincoln Baxter wrote:

> Wow, I'm glad to see this issue has been addressed. I didn't originally intend this issue to mean injection into Enums, but I'm sure there's some strange use for that.
> 
> I would be happy with scanning enums for annotations alone, but if we want to support injection as well, I think field and method injection (for things like observer methods and method initializers) makes a lot of sense.
> 
> Interesting, you've effectively defined a new language for injectable singletons with this change. That has interesting potential.
> 
> --
> Lincoln Baxter, III
> JBoss, by Red Hat
> lbaxter at redhat.com
> 
> "If you want something, you'll find a way; if you don't, you'll find an excuse."
> 
> ----- Original Message -----
> From: "Pete Muir" <pmuir at redhat.com>
> To: "CDI-Dev" <cdi-dev at lists.jboss.org>
> Sent: Monday, September 5, 2011 1:06:27 PM
> Subject: [cdi-dev] Enum injection
> 
> I've written up the spec changes for https://issues.jboss.org/browse/CDI-127 as https://github.com/jboss/cdi/pull/37 - please review :-)
> 
> There is an open question here. Currently I've defined it as being non-portable to inject into an enum defined in a shared library, as the behavior when injecting contextual instances becomes complex (as this is essentially static injection). Please let me know if this is going to cause a problem for you.
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev



More information about the cdi-dev mailing list