Return-Path: X-Original-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1587EB6F for ; Thu, 27 Dec 2012 12:31:11 +0000 (UTC) Received: (qmail 7459 invoked by uid 500); 27 Dec 2012 12:31:11 -0000 Delivered-To: apmail-incubator-deltaspike-dev-archive@incubator.apache.org Received: (qmail 7359 invoked by uid 500); 27 Dec 2012 12:31:11 -0000 Mailing-List: contact deltaspike-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-dev@incubator.apache.org Delivered-To: mailing list deltaspike-dev@incubator.apache.org Received: (qmail 7340 invoked by uid 99); 27 Dec 2012 12:31:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 12:31:11 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [77.238.189.63] (HELO nm6.bullet.mail.ird.yahoo.com) (77.238.189.63) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 12:31:02 +0000 Received: from [77.238.189.53] by nm6.bullet.mail.ird.yahoo.com with NNFMP; 27 Dec 2012 12:30:41 -0000 Received: from [212.82.108.249] by tm6.bullet.mail.ird.yahoo.com with NNFMP; 27 Dec 2012 12:30:41 -0000 Received: from [127.0.0.1] by omp1014.mail.ird.yahoo.com with NNFMP; 27 Dec 2012 12:30:41 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 856607.90165.bm@omp1014.mail.ird.yahoo.com Received: (qmail 27678 invoked by uid 60001); 27 Dec 2012 12:30:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1356611441; bh=7I9mulqfHT0em8sduadxNvE8atXS21vk6536MHq03MU=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AlocHZMUWk+wIztBeusPi2kq/nMpxs/dAy14onT0uX+R7dAlAzssILjG5WLLFhs0Nn70/PJf/fDR4GpAyepp72SsvZ0j7mybDMqjLQ+XwWGYOBYFp9pZXjM/E5RSK3Hy3dFuqrNt6l8pjHjuCjtWtVYHqvpOSHDGCxboZPDH+nE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5KCOdQgMUD7R84uD5XEHcL0vRj6NQ/Bwez81fRI8H5kp16BVbuSuFr4fJFxbCrGdzUhqSsjbkF9fjbN1Zgq473+EVvkrZpG3w/IFidFmK3h/BKll2wGB6tycbKvlOlkQCCWokglb1l437rMG3f0ZwujHYZzg/u5W9D7rnRkJsPA=; X-YMail-OSG: i9mBkSwVM1kpimwdV6wco396xr8eL2JJMg7cjQoryNNP4M3 zOzN8m1xr8Odr9b3Bb1y2k0rVj30JN1iMCdMLQNaCEYmXmC.DfRvr_OJhhD. tJeU1dU4fyTsRpxhz.X1Q8QAMne843WsIyCVgBor8t6iq.jWTuI2_f4APuoD GbvLvocK8g6_Npio9yp4uKJGUhckp6v1X_V2rUU683GLQR2ntP1WaABeYR6_ l96oPPv4KuiFzden55vjUMjkObAoakg3T7ShzbKM43O3QJ3Inu6m6FxFiCks GeMY5VKiv_AOmjs62GJOQGu6IooiKLqTY0Au9qh94GWAl7TV29ZEiflhZ3.r 3Q4m72es_OFgVQtJeypS4fvlZhpk.h4aTz.tZZ36b23xvuUji5_9EPCr6kO0 XevpiD4Pju8hNXN5rafmqMtLYa.wU0pHDMh8Cf_3NgfLRGFQzmcLUagRghej 5joON7TYDa6j6GzHiyp15TrmlVoEl1CDihFYGi95_jNoZton70TQ.fw4_Vnr y4MdaOJjbbKHZUFw.J_fIzh_4Hy2luOwQCgT_MRW6D3tQ5Xb8NTD7BUihtR4 39uyPxPWHIrnQ6EL3s8ZniXaY7oAxEY36PoffGQi0nC1ZjwVj.QTGC8Pk1T2 rmetUyh4XJHKSrLT1klZkzuqP.XqFkA-- Received: from [80.108.122.184] by web28901.mail.ir2.yahoo.com via HTTP; Thu, 27 Dec 2012 12:30:41 GMT X-Rocket-MIMEInfo: 001.001,Y29tcGlsZSB0aW1lIHdvdWxkIGJlIGFuIG9wdGlvbiEKCkl0IGhhcHBlbnMgdGhhdCBNYXR0IGFuZCBJIGFyZSBjdXJyZW50bHkgd29ya2luZyBvbiBjb21tb25zLXdlYXZlciBbMV0uCkl0IHN0YXJ0ZWQgYXMgJ3ByaXZpbGl6ZXInICh0byBnZW5lcmF0ZSBkb1ByaWxpdmVkIGJsb2NrcyBmbyBAUHJpdmlsZWdlZCBhbm5vdGF0ZWQgbWV0aG9kcykgYnV0IHdlIG1vdmVkIGl0IHRvIGEgbW9yZSBnZW5lcmljIHBhdHRlcm4gcmVjZW50bHkuIApJdCBiYXNpY2FsbHkgcHJvdmlkZXMgYW4gYW50IHRhc2sgYW5kIGEBMAEBAQE- X-Mailer: YahooMailWebService/0.8.129.483 References: <97621E8BA4D496449BC4D1AB06E0FB7005010D@K99F-PEXC01.openknowledge.de> <2F97A990-361C-4375-AB19-D901AF0EB83D@redhat.com> <6B350D81-A216-4638-B9E0-698A22BB7898@redhat.com> <1356205818.2320.YahooMailNeo@web28904.mail.ir2.yahoo.com> <1356560121.27846.YahooMailNeo@web28904.mail.ir2.yahoo.com> <1356603859.4268.YahooMailNeo@web28901.mail.ir2.yahoo.com> <1356607225.53913.YahooMailNeo@web28903.mail.ir2.yahoo.com> <1356610206.2931.YahooMailNeo@web28902.mail.ir2.yahoo.com> Message-ID: <1356611441.7156.YahooMailNeo@web28901.mail.ir2.yahoo.com> Date: Thu, 27 Dec 2012 12:30:41 +0000 (GMT) From: Mark Struberg Reply-To: Mark Struberg Subject: Re: [DISCUSS] [DELTASPIKE-113] Review and Discuss ServiceHandler To: "deltaspike-dev@incubator.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org compile time would be an option!=0A=0AIt happens that Matt and I are curren= tly working on commons-weaver [1].=0AIt started as 'privilizer' (to generat= e doPrilived blocks fo @Privileged annotated methods) but we moved it to a = more generic pattern recently. =0AIt basically provides an ant task and a m= aven-plugin which trigger the WeaveProcessor. This WeaveProcessor picks up = all provided weaving plugins. In the privilizer plugin we just change the b= ytecode of the existing classes.=0AWe could easily create such a weaving pl= ugin which would change the abstract class into a full class and fill in th= e InvocationHandler calls.=0AThe resulting class files do not have any runt= ime dependencies that way. Javassist or whatever you choose to do the bytec= ode stuff is only used at compile time.=0A=0A=0ALieGrue,=0Astrub=0A=0A=0A= =0A>________________________________=0A> From: John D. Ament =0A>To: deltaspike-dev@incubator.apache.org; Mark Struberg =0A>Sent: Thursday, December 27, 2012 1:19 PM=0A>Subject: Re:= [DISCUSS] [DELTASPIKE-113] Review and Discuss ServiceHandler=0A> =0A>=0A>A= greed (separate module since it has a dependency on javassist)=0A>=0A>=0A>I= think abstract classes are a must. =A0I can think of some DAO use cases wh= ere the handler's approach may not match how they want the search to operat= e, plus if they want to do a criteria query I can't think of a generic way = to do that (yet).=0A>=0A>=0A>Can't we use a ProducerMethod to obscure the f= act that we cannot simply install a bean up front? Is there a timing issue = w/ when we can add the producer methods vs beans? =A0What about a compile-t= ime option where we generate the class up front via a compiler plugin or ma= ven plugin?=0A>=0A>=0A>John=0A>=0A>=0A>=0A>On Thu, Dec 27, 2012 at 7:10 AM,= Mark Struberg wrote:=0A>=0A>=0A>>=0A>>Indeed. If we ne= ed any byte code engineering library then it must not be in core-impl but i= n a separate module. core-impl shall not have _any_ 3rd party runtime depen= dencies.=0A>>=0A>>LieGrue,=0A>>strub=0A>>=0A>>=0A>>=0A>>=0A>>>_____________= ___________________=0A>>> From: Romain Manni-Bucau = =0A>>>To: Mark Struberg ; deltaspike-dev@incubator.apach= e.org=0A>>>Sent: Thursday, December 27, 2012 12:41 PM=0A>>=0A>>>Subject: Re= : [DISCUSS] [DELTASPIKE-113] Review and Discuss ServiceHandler=0A>>>=0A>>>= =0A>>>We proxy abstract classes? Is that mandatory? I would like to be able= to skip javassist as forced dependency.=0A>>>Le 27 d=E9c. 2012 12:20, "Mar= k Struberg" a =E9crit=A0:=0A>>>=0A>>>As pointed out by = Gerhard on IRC we have 2 different areas where we need interception=0A>>>>= =0A>>>>1.) on the InvocationHandler and=0A>>>>=0A>>>>2.) on the abstract cl= ass.=0A>>>>=0A>>>>In hindsight of DELTASPIKE-60 I'm thinking about @Transac= tional and @Securec, etc.=0A>>>>=0A>>>>LieGrue,=0A>>>>strub=0A>>>>=0A>>>>= =0A>>>>=0A>>>>----- Original Message -----=0A>>>>> From: Mark Struberg =0A>>>>> To: "deltaspike-dev@incubator.apache.org" =0A>>>>> Cc:=0A>>>>> Sent: Thursday, December 2= 7, 2012 11:24 AM=0A>>>>> Subject: Re: [DISCUSS] [DELTASPIKE-113] Review and= Discuss ServiceHandler=0A>>>>>=0A>>>>> You are right! And we need to take = this C. route. But for other reasons than=0A>>>>> having a different state = lifecycle in the servicehandler than in the service.=0A>>>>>=0A>>>>> The re= ason is that the CDI spec doesn't define a portable way how to=0A>>>>> inte= rcept contextual instances generated via a Bean. This is only=0A>>>>> de= fined for Decorators and 'Managed Beans' (Bean resulting from=0A>>>>> a = scanned class).=0A>>>>>=0A>>>>> In practice there would also be an option t= o generate a Proxy class and add an=0A>>>>> AnnotatedType for it. I think t= his also works in all containers. The problem=0A>>>>> here being that this = doesn't work in CDI-1.0 as there are yet no=0A>>>>> 'synthetic annotated ty= pes' plus we have the problem that we would need=0A>>>>> to know this info = in BeforeBeanDiscovery (for #addAnnotatedType). So we would=0A>>>>> need to= manually scan with some other tools than ProcessAnnoatedType. That would= =0A>>>>> btw something to consider in our CDI spec. a Method=0A>>>>>=0A>>>>= > ProcessAnnotatedType#addSyntheticAnnotatedType(..);=0A>>>>>=0A>>>>>=0A>>>= >> Anyway. It doesn't work in CDI-1.0 thus we only have the way to pick up = the=0A>>>>> InvocationHandlers via CDI itself. Which means they also have t= heir own scope!=0A>>>>> Otherwise we would not be able to add an @Transacti= onal to the servicehandler=0A>>>>> InvocationHandler.=0A>>>>>=0A>>>>> LieGr= ue,=0A>>>>> strub=0A>>>>>=0A>>>>>=0A>>>>>=0A>>>>> ----- Original Message --= ---=0A>>>>>> =A0From: John D. Ament =0A>>>>>> =A0To= : deltaspike-dev@incubator.apache.org; Mark Struberg=0A>>>>> =0A>>>>>> =A0Cc:=0A>>>>>> =A0Sent: Thursday, December 27, 2012 12:57 A= M=0A>>>>>> =A0Subject: Re: [DISCUSS] [DELTASPIKE-113] Review and Discuss Se= rviceHandler=0A>>>>>>=0A>>>>>> =A0i think there's a C here as well that can= be considered (which is what=0A>>>>>> =A0I've=0A>>>>>> =A0been driving to)= :=0A>>>>>>=0A>>>>>> =A0Allow the scope of the InvocationHandler to drive th= e scope of the=0A>>>>>> =A0InvocationProxy (the interface/abstract class we= just proxied), with an=0A>>>>>> =A0override to a narrower scope (if so cho= sen by the app developer).=A0 This=0A>>>>>> =A0approach closely mirrors the= CDI approach of injecting a session scoped=0A>>>>>> =A0object in to a requ= est scoped object, or another session scoped object (so=0A>>>>>> =A0it's re= late-able).=A0 We don't veto the InvocationHandler and instead=0A>>>>>=0A>>= >>>> =A0allow=0A>>>>>> =A0it to retain its original scope (in fact, we don'= t have to do anything=0A>>>>> with=0A>>>>>> =A0the invocation handler until= runtime and validation).=A0 We just have to make=0A>>>>>> =A0sure we insta= ll the InvocationProxy with the appropriate scopes.=0A>>>>>>=0A>>>>>>=0A>>>= >>> =A0On Wed, Dec 26, 2012 at 5:15 PM, Mark Struberg = =0A>>>>> wrote:=0A>>>>>>=0A>>>>>>> =A0 I think we have to first point out a= ll available options.=0A>>>>>>>=0A>>>>>>> =A0 Option A.) is to treat the In= vocationHandler as CDI bean and create=0A>>>>> all=0A>>>>>>> =A0 the proxie= s as @Dependent beans and inject them directly.=0A>>>>>>> =A0 So you would = _not_ get a normalscoped CDI proxy (Contextual Reference)=0A>>>>> but=0A>>>= >>>> =A0 our own proxy which is different for each injection point. And thi= s=0A>>>>> own=0A>>>>>>> =A0 proxy resolves the InvocationHandler as CDI bea= ns.=0A>>>>>>>=0A>>>>>>> =A0 Option B.) The InvocationHandler is _no_ CDI be= an at all. It's=0A>>>>> even=0A>>>>>> =A0vetoed=0A>>>>>>> =A0 as bean! We t= ake the scope and the qualifiers, etc from the=0A>>>>>> =A0'serviced'=0A>>>= >>>> =A0 interface/abstract class and create a Bean for each of it=0A>>>= >> which=0A>>>>>> =A0gets=0A>>>>>>> =A0 those scopes and qualifiers. The re= gistered Beans will create=0A>>>>> Contextual=0A>>>>>>> =A0 Instances which= are _our_ servicehandler proxies. Those will be stored=0A>>>>> in=0A>>>>>>= > =A0 the Contexts. During injection the CDI container will apply all=0A>>>= >>>> =A0 NormalScoped mechanism like the CDI proxy over our internal=0A>>>>= > servicehandler=0A>>>>>>> =A0 proxy.=0A>>>>>>>=0A>>>>>>> =A0 Both ways wil= l provide similar results, but they each have a different=0A>>>>>>> =A0 imp= act on side effects, states and handling.=0A>>>>>>>=0A>>>>>>> =A0 I think B= .) is what Gerhard implemented, right?=0A>>>>>>>=0A>>>>>>>=0A>>>>>>> =A0 Wh= at option was used in Seam?=0A>>>>>>>=0A>>>>>>> =A0 LieGrue,=0A>>>>>>> =A0 = strub=0A>>>>>>>=0A>>>>>>>=0A>>>>>>>=0A>>>>>>>=0A>>>>>>> =A0 ----- Original = Message -----=0A>>>>>>> =A0 > From: Gerhard Petracek =0A>>>>>>> =A0 > To: deltaspike-dev@incubator.apache.org=0A>>>>>>> = =A0 > Cc:=0A>>>>>>> =A0 > Sent: Wednesday, December 26, 2012 9:59 PM=0A>>>>= >>> =A0 > Subject: Re: [DISCUSS] [DELTASPIKE-113] Review and Discuss=0A>>>>= >> =A0ServiceHandler=0A>>>>>>> =A0 >=0A>>>>>>> =A0 > hi john,=0A>>>>>>> =A0= >=0A>>>>>>> =A0 > as mentioned before:=0A>>>>>>> =A0 >=0A>>>>>>> =A0 >>=A0= @ InvocationHandler as a separated bean (at runtime):=0A>>>>>>> =A0 >>=A0 = currently i can't see a benefit for DELTASPIKE-60.=0A>>>>>>> =A0 >=0A>>>>>>= > =A0 > regards,=0A>>>>>>> =A0 > gerhard=0A>>>>>>> =A0 >=0A>>>>>>> =A0 >=0A= >>>>>>> =A0 >=0A>>>>>>> =A0 > 2012/12/26 John D. Ament =0A>>>>>>> =A0 >=0A>>>>>>> =A0 >>=A0 Gerhard,=0A>>>>>>> =A0 >>=0A>>>>>>= > =A0 >>=A0 Just so I'm clear, when I was referring to the current=0A>>>>>>= =A0implementation,=0A>>>>>>> =A0 > it=0A>>>>>>> =A0 >>=A0 was the one ship= ped with Seam3/Solder:=0A>>>>>>> =A0 >>=0A>>>>>>> =A0 >>=0A>>>>>>> =A0 >=0A= >>>>>>>=0A>>>>>>=0A>>>>> https://github.com/seam/solder/tree/develop/impl/s= rc/main/java/org/jboss/solder/serviceHandler=0A>>>>>>> =A0 >>=0A>>>>>>> =A0= >>=A0 It does look like we're doing something very similar by=0A>>>>>> =A0= veto'ing=0A>>>>>>> =A0 > the=0A>>>>>>> =A0 >>=A0 handler classes.=0A>>>>>>>= =A0 >>=0A>>>>>>> =A0 >>=A0 =A0 =A0 =A0 =A0 else if=0A>>>>>> =A0(Invocation= Handler.class.isAssignableFrom(beanClass))=0A>>>>>>> =A0 >>=A0 =A0 =A0 =A0 = =A0 {=0A>>>>>>> =A0 >>=A0 =A0 =A0 =A0 =A0 =A0 =A0 validateInvocationHandler= (beanClass,=0A>>>>>>> =A0 bindingAnnotationClass);=0A>>>>>>> =A0 >>=0A>>>>>= >> =A0 >>=A0 =A0 =A0 =A0 =A0 =A0 =A0=0A>>>>> this.partialBeanHandlers.put(b= indingAnnotationClass,=0A>>>>>>> =A0 >>=A0 (Class) beanClass);=0A>>>>>>> =A0 >>=A0 =A0 =A0 =A0 =A0 =A0 =A0 pat.veto();=0A= >>>>>>> =A0 >>=A0 =A0 =A0 =A0 =A0 }=0A>>>>>>> =A0 >>=0A>>>>>>> =A0 >>=A0 I = believe as a result, we have to do what you're doing=0A>>>>> in=0A>>>>>>> = =A0 >>=A0 PartialBeanLifecycle.create (line 75) to manually create the=0A>>= >>>=0A>>>>>> =A0instance.=0A>>>>>>> =A0 >>=A0=A0 If we just let the scopes = handle the scopes whether this is=0A>>>>> a=0A>>>>>> =A0new=0A>>>>>>> =A0 >= >=A0 instance or an existing instance should resolve itself more=0A>>>>>> = =A0naturally.=0A>>>>>>> =A0 >>=0A>>>>>>> =A0 >>=0A>>>>>>> =A0 >>=0A>>>>>>> = =A0 >>=A0 On Wed, Dec 26, 2012 at 2:06 PM, John D. Ament=0A>>>>>> =A0>>>>>> =A0 >>=A0 >wrote:=0A>>>>>>> =A0 >>=0A>>>>>>> = =A0 >>=A0 > Gerhard,=0A>>>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=A0 > I apologiz= e, I hadn't realized you implemented this=0A>>>>>=0A>>>>>> =A0feature,=0A>>= >>>>> =A0 > considering=0A>>>>>>> =A0 >>=A0 > it has been assigned to me.= =0A>>>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=A0 > John=0A>>>>>>> =A0 >>=A0 >=0A>= >>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=A0 > On Wed, Dec 26, 2012 at 1:56 PM, G= erhard Petracek <=0A>>>>>>> =A0 >>=A0 > gerhard.petracek@gmail.com> wrote:= =0A>>>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=A0 >> hi john,=0A>>>>>>> =A0 >>=A0 = >>=0A>>>>>>> =A0 >>=A0 >> that can't be - the described example=0A>>>>> (/e= xcerpt) is=0A>>>>>> =A0a copy of=0A>>>>>>> =A0 > a working=0A>>>>>>> =A0 >>= =A0 >> example (tested with owb and weld).=0A>>>>>>> =A0 >>=A0 >>=0A>>>>>>>= =A0 >>=A0 >> the only use-case (we have so far) which can't=0A>>>>> be=0A>= >>>>> =A0implemented=0A>>>>>>> =A0 > with std.=0A>>>>>>> =A0 >>=A0 >> cdi= =0A>>>>>>> =A0 >>=A0 >> mechanisms (due to abstract classes) is=0A>>>>> DEL= TASPIKE-60.=0A>>>>>>> =A0 >>=A0 >>=0A>>>>>>> =A0 >>=A0 >> @ InvocationHandl= er as a separated bean (at=0A>>>>> runtime):=0A>>>>>>> =A0 >>=A0 >> current= ly i can't see a benefit for=0A>>>>> DELTASPIKE-60.=0A>>>>>>> =A0 >>=A0 >>= =0A>>>>>>> =A0 >>=A0 >> regards,=0A>>>>>>> =A0 >>=A0 >> gerhard=0A>>>>>>> = =A0 >>=A0 >>=0A>>>>>>> =A0 >>=A0 >>=0A>>>>>>> =A0 >>=A0 >>=0A>>>>>>> =A0 >>= =A0 >> 2012/12/26 John D. Ament=0A>>>>> =0A>>>>>>> = =A0 >>=A0 >>=0A>>>>>>> =A0 >>=A0 >> > but the=0A>>>>>>> =A0 >>=A0 >> > spec= ific one annotated a certain way.=A0 The=0A>>>>> cleanest=0A>>>>>> =A0way= =0A>>>>>>> =A0 > (conceptual=0A>>>>>>> =A0 >>=A0 >> >=0A>>>>>>> =A0 >>=A0 >= >=0A>>>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=A0 >=0A>>>>>>> =A0 >>=0A>>>>>>> = =A0 >=0A>>>>>>>=0A>>>>>>=0A>>>>>=0A>>>>=0A>>>=0A>>>=0A>>=0A>=0A>=0A>