[weld-dev] Spec clarification needed

Gurkan Erdogdu gurkanerdogdu at yahoo.com
Mon Apr 19 07:04:27 EDT 2010


Hi;

This is related with https://jira.jboss.org/jira/browse/CDITCK-137. Also, I have sent an email to EG about this issue but not getting response so far.

--Gurkan




________________________________
From: Pete Muir <pmuir at redhat.com>
To: Gavin King <gavin.king at gmail.com>
Cc: Weld-Dev List <weld-dev at lists.jboss.org>
Sent: Mon, April 19, 2010 12:18:24 PM
Subject: Re: [weld-dev] Spec clarification needed

Gavin, can you comment please?

On 9 Apr 2010, at 16:00, Gurkan Erdogdu wrote:

> >>>Otherwise InjectionPoint#isDelegate() would always return false
> No, Decorators are also beans and you can get its injection points with getInjectionPoints that one of them is @delegate therefore isDelegate returns true.
> 
> I think that "InjectionPoint injection" in the spec. has never written for that DependentScoped beans are injected into decorator delegates.
> 
> Thanks;
> 
> --Gurkan
> 
> From: Sven Linstaedt <sven.linstaedt at googlemail.com>
> To: Pete Muir <pmuir at redhat.com>
> Cc: Weld-Dev List <weld-dev at lists.jboss.org>
> Sent: Fri, April 9, 2010 12:16:46 PM
> Subject: Re: [weld-dev] Spec clarification needed
> 
> According to the java docs, I would also suppose your expression to be true. Otherwise InjectionPoint#isDelegate() would always return false, making this method dispensable. The interesting point imho is injecting the InjectionPoint in other cases than producer methods. I have not seen examples for this usage in the spec.
> 
> br, Sven
> 
> 
> 2010/4/9 Pete Muir <pmuir at redhat.com>
> Given these beans and decorators (enabled)
> 
> interface Animal {
>        String hello();
> }
> 
> class Cat implements Animal {
>  @Inject private InjectionPoint injectionPoint;
> 
>  public String hello() {
>     return "hello";
>  }
> 
>  public InjectionPoint getInjectionPoint() {
>     return injectionPoint;
>  }
> }
> 
> @Decorator
> class AnimalDecorator implements Animal {
> 
>        @Inject @Delegate
>        private Animal bean;
> 
>        public String hello() {
>                return bean.hello() + " world!";
>        }
> }
> 
> class Cattery {
> 
>  @Inject Cat cat;
> 
>  Cat getCat() {
>     return cat;
>  }
> 
> }
> 
> Should
> 
> cattery.getCat().getInjectionPoint().isDelegate() return true or false?
> 
> I believe it should return true, as Cat is being decorated, and hence injected into the decorator delegate injection point.
> 
> Ref is https://jira.jboss.org/jira/browse/CDITCK-138
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/weld-dev
> 
> 
> Yahoo! Türkiye açıldı!
> Haber, Ekonomi, Videolar, Oyunlar hepsi Yahoo! Türkiye'de!
> www.yahoo.com.tr_______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/weld-dev


_______________________________________________
weld-dev mailing list
weld-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-dev

__________________________________________________
Yahoo! kullanıyor musunuz?
İstenmeyen postadan bıktınız mı?  Yahoo! Posta'da piyasanın en iyi istenmeyen posta korunması var 
http://tr.mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20100419/a2006154/attachment-0001.html 


More information about the weld-dev mailing list