Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08C184D1B for ; Thu, 2 Jun 2011 22:35:08 +0000 (UTC) Received: (qmail 35687 invoked by uid 500); 2 Jun 2011 22:35:07 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 35647 invoked by uid 500); 2 Jun 2011 22:35:07 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 35639 invoked by uid 99); 2 Jun 2011 22:35:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2011 22:35:07 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.136.44.60] (HELO smtp105.prem.mail.sp1.yahoo.com) (98.136.44.60) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 02 Jun 2011 22:35:02 +0000 Received: (qmail 71916 invoked from network); 2 Jun 2011 22:34:41 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=cEDCGyDHxhBTRyxPFJ9lfYGxu4ygbE+PeSRphlUEtrJ0nWCtn2B/NoBlT4C6c7DUd1CDugFhsHnSX38zyKIpQS9xlWa+C9oghbRRcXWcfCPe/J4PIoxXy4xD0eCGf/tP/WPGQ2xcRt2cqz0xwGcSkAUQ1orIm179CtgjlsoQBeM= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307054081; bh=spupH+kw0I5aRRhOhjVjXktVCx9v7KqM8EKkoPxGWTI=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=p0OGDEjx1KZL1vdjrkMMJtIpFjAFV/PuWpaw3wWAjlVrgxvE4eHjHnS/ntYqBd+7sZo97XRTTy3HPYXzOkHWK9oPbImKeH/enTEtUFsNwL8ngY5rmm1wcaORUhpy7WDJ44PHx3FyaNg8g3+jfDeXMbq0YgSv620FlpZTb7DiHR4= Received: from [10.0.1.4] (david_jencks@76.76.148.215 with plain) by smtp105.prem.mail.sp1.yahoo.com with SMTP; 02 Jun 2011 15:34:40 -0700 PDT X-Yahoo-SMTP: .9oIUzyswBANsYgUm_5uPui0skTnzGJXJQ-- X-YMail-OSG: fzYQxbkVM1mYKgTWMS2zk2ROlUWWa_oegZkyVhZqS6MpkU3 mlV5fGdYq6LwZbCo7RCkUn1bTmnr_g7bZIW2oanGXsVWbX1wXEwli2YAoRbn hKVRimUiaQhF6dHfjkIOIoxmrFKrR_Prw.41P77C.WKyMKQZCWjHuTA6IchW SHLoUBTsbP2OXNTz5WUuVQ11PsGzwKCrNWDYw.RxVdY_j1245_6bjYg7xcMo ncZaXcRvtUr6CIsQ_907V5YcUM6lb0q74R.ajdBtS1BAhLLHMgG3yhEsugMk wr2YrcdudmdmiCzbwcehuPZwn8zXIZODRapBzeggFhP5bvT0p_ZDFC49wVcZ y3KFo7Owq.E7gLo1GILqemBLHCGxanAeZwL85.LW97reiaMLASO20ew702dQ _59hPFMiZlBeQjIhYOG23B1iGDw-- X-Yahoo-Newman-Property: ymail-3 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: Another weaving problem? From: David Jencks In-Reply-To: Date: Thu, 2 Jun 2011 15:34:39 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3063CDA8-9025-4B04-9B21-997FA26F5EAC@yahoo.com> References: <9820D92C-5208-4DC3-892F-D0516CE61432@yahoo.com> To: dev@aries.apache.org X-Mailer: Apple Mail (2.1084) Hi Tim, First I fixed this in OWB by having their proxyability-checking code = ignore synthetic methods. This works and AFAICT the actual proxy = building code seems to work ok. However a couple of OWB committers have = objected to this and one of them has told me that starting in java 1.5 = marking methods final has no effect on whether the JIT can optimize = better. I'm a little nervous about this change also since the synthetic = flag is not exposed by the java reflection code. So when I get a minute I'm going to try removing the final modifier from = the generated synthetic methods and restore the OWB code. If you have = any concerns please speak up :-) thanks! david jencks On Jun 1, 2011, at 1:28 AM, Timothy Ward wrote: >=20 > Hi David, >=20 > The proxying code does indeed add a couple of final methods on the = highest woven supertype of a class hierarchy. The equivalent source for = these would be the following: >=20 > -------------------------------------------------------- >=20 > public final Callable = org_apache_aries_proxy_weaving_WovenProxy_unwrap() { > return dispatcherField; > } >=20 >=20 >=20 > public final boolean = org_apache_aries_proxy_weaving_WovenProxy_isProxyInstance() { >=20 > return dispatcherField !=3D null && listenerField !=3D null; >=20 > } >=20 > -------------------------------------------------------- >=20 > dispatcherField and listenerField are protected final member variables = with long, auto-generated field names that should never clash with = anything already in the class. >=20 > Both of these methods are marked synthetic in the bytecode, which I = would have hoped meant that they would be safely ignored. The primary = reason for making the methods final is to ensure the JIT can optimize = effectively, so if you'd like to try changing line 67 of = AbstractWovenProxyAdapter to remove the ACC_FINAL part of the bitmask = then that will stop the methods from being final. This should have no = functional effect on the proxy code, just a potential, minor performance = impact. >=20 > It's a shame that the webbeans implementation can't use the existing = proxying, but I suppose that's not possible... >=20 >=20 >=20 > For completeness, weaving also adds the following code to every class = that it weaves (not just the highest supertype): >=20 > -------------------------------------------------------- >=20 > protected Constructor(Callable dispatcher, InvocationListener = listener) { > //either this for the sub-types =20 > super(dispatcher, listener);=20 >=20 > //or this for the highest woven supertype > super(); // sometimes this(); if there is no no-args super > dispatcherField =3D dispatcher;=20 > listenerField =3D listener; >=20 > } >=20 > public WovenProxy = org_apache_aries_proxy_weaving_WovenProxy_createNewProxyInstance(Callable<= Object> dispatcher, InvocationListener listener) { > return new ThisClass(dispatcher, listener); > } >=20 > -------------------------------------------------------- >=20 >=20 > Regards, >=20 > Tim >=20 >=20 > ---------------------------------------- >> From: david_jencks@yahoo.com >> Subject: Another weaving problem? >> Date: Tue, 31 May 2011 17:05:04 -0700 >> To: dev@aries.apache.org >>=20 >> Thanks tim for fixing the SerialVersionUID problem. I think I'm = running into another problem with the weaving since this doesn't show up = with plain geronimo + owb. Most of the jcdi tck fails with deployment = errors like this: >>=20 >> 2011-05-31 16:02:27,902 ERROR [WebBeansConfigurationListener] An = error occured while starting application context path : = [/org.jboss.jsr299.tck.tests.context.ContextTest] >> 2011-05-31 16:02:27,903 ERROR [ContextTest]] Exception sending = context initialized event to listener instance of class = org.apache.geronimo.openwebbeans.WebBeansConfigurationListener >> javax.enterprise.inject.UnproxyableResolutionException: WebBeans with = api type with normal scope must be proxiable to inject. >> org.jboss.jsr299.tck.tests.context.MySessionBean has final methods! = CDI doesn't allow that. >> at = org.apache.webbeans.util.InjectionExceptionUtils.throwUnproxyableResolutio= nException(InjectionExceptionUtils.java:39) >> at = org.apache.webbeans.util.WebBeansUtil.checkUnproxiableApiType(WebBeansUtil= .java:1852) >> at = org.apache.webbeans.component.creation.ManagedBeanCreatorImpl.checkCreateC= onditions(ManagedBeanCreatorImpl.java:70) >> at = org.apache.webbeans.util.WebBeansUtil.defineManagedBean(WebBeansUtil.java:= 2598) >> at = org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.j= ava:859) >> at = org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDe= ployer.java:539) >> at = org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer= .java:484) >> at = org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:165) >> at = org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractL= ifeCycle.java:129) >> at = org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(W= ebContainerLifecycle.java:87) >> at = org.apache.geronimo.openwebbeans.WebBeansConfigurationListener.contextInit= ialized(WebBeansConfigurationListener.java:85) >> at = org.apache.catalina.core.StandardContext.listenerStart(StandardContext.jav= a:4521) >> at = org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)= >> at = org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)= >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) >> at java.util.concurrent.FutureTask.run(FutureTask.java:138) >> at = java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.= java:886) >> at = java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java= :908) >> at java.lang.Thread.run(Thread.java:680) >>=20 >> I don't see any final methods in MySessionBean: >>=20 >> @SessionScoped >> class MySessionBean implements Serializable >> { >> private static final long serialVersionUID =3D 1L; >>=20 >> private int id =3D 0; >>=20 >> public void setId(int id) >> { >> this.id =3D id; >> } >>=20 >> public int getId() >> { >> return id; >> } >>=20 >> public void ping() >> { >> } >>=20 >> } >>=20 >> so I'm guessing the weaving might have added something?? >>=20 >> Is there a description of what the weaving does in terms of java = code? Or even a description of what it does in java op codes? >>=20 >> thanks >> david jencks >>=20 > =20