You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Eric Covener <co...@gmail.com> on 2009/10/29 23:58:24 UTC

Re: svn commit: r831026 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: component/intercept/webbeans/CallBusinessInConstructorBean.java unittests/intercept/webbeans/CallingBusinessInConstructorTest.java

On Thu, Oct 29, 2009 at 12:56 PM,  <ge...@apache.org> wrote:
> Author: gerdogdu
> Date: Thu Oct 29 16:56:00 2009
> New Revision: 831026
>
> URL: http://svn.apache.org/viewvc?rev=831026&view=rev
> Log:
> Testing calling business method from constructor.
> +        defineSimpleWebBeanInterceptor(SecureInterceptor.class);
> +        Bean<CallBusinessInConstructorBean> bean = defineSimpleWebBean(CallBusinessInConstructorBean.class);
> +        CallBusinessInConstructorBean instance = (CallBusinessInConstructorBean) getInstanceByName("callBusinessInConstructorBean");
> +
> +        Assert.assertNotNull(instance);
> +
> +        Assert.assertTrue(SecureInterceptor.CALL);

While 7.2 of 299 does not cover this explicitly, Joe Bergmark made a
good argument offline that the proxy calling the underlying bean
constructor may not be correctly interpreted here as a business method
invocation, since it's the container making the call and not via a
contextual reference.

-- 
Eric Covener
covener@gmail.com

Re: svn commit: r831026 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: component/intercept/webbeans/CallBusinessInConstructorBean.java unittests/intercept/webbeans/CallingBusinessInConstructorTest.java

Posted by Gurkan Erdogdu <gu...@yahoo.com>.
+1

May we add ThreadLocal variable to JavassistProxyFactory while creating instance and check this in InterceptorHandler?

WDYT?

--Gurkan




________________________________
From: Eric Covener <co...@gmail.com>
To: openwebbeans-dev@incubator.apache.org
Sent: Fri, October 30, 2009 12:58:24 AM
Subject: Re: svn commit: r831026 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test:  component/intercept/webbeans/CallBusinessInConstructorBean.java  unittests/intercept/webbeans/CallingBusinessInConstructorTest.java

On Thu, Oct 29, 2009 at 12:56 PM,  <ge...@apache.org> wrote:
> Author: gerdogdu
> Date: Thu Oct 29 16:56:00 2009
> New Revision: 831026
>
> URL: http://svn.apache.org/viewvc?rev=831026&view=rev
> Log:
> Testing calling business method from constructor.
> +        defineSimpleWebBeanInterceptor(SecureInterceptor.class);
> +        Bean<CallBusinessInConstructorBean> bean = defineSimpleWebBean(CallBusinessInConstructorBean.class);
> +        CallBusinessInConstructorBean instance = (CallBusinessInConstructorBean) getInstanceByName("callBusinessInConstructorBean");
> +
> +        Assert.assertNotNull(instance);
> +
> +        Assert.assertTrue(SecureInterceptor.CALL);

While 7.2 of 299 does not cover this explicitly, Joe Bergmark made a
good argument offline that the proxy calling the underlying bean
constructor may not be correctly interpreted here as a business method
invocation, since it's the container making the call and not via a
contextual reference.

-- 
Eric Covener
covener@gmail.com