From jharting at redhat.com Wed Apr 1 02:48:15 2015 From: jharting at redhat.com (Jozef Hartinger) Date: Wed, 01 Apr 2015 08:48:15 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: Message-ID: <551B94AF.4090208@redhat.com> So instead of calling observers asynchronously you suggest turning observers into producers of CompletableFuture that will then be completed asynchronously? On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: > // fire side > event.fireAsync(new LetTheWorldKnow()).thenRun(() -> > System.out.println("We did it!")); > > // observer side > CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} > > // impl behavior would be like > CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on > CompletableFuture behavior I think > > Am I clearer? > > > > Romain Manni-Bucau > @rmannibucau | Blog > | Github > | LinkedIn > | Tomitriber > > > 2015-03-31 18:15 GMT+02:00 Sven Linstaedt >: > > Hi Romain, > > I am not sure, I have fully understand how an observer with > CompletableFuture could look like. Could you give us an example? > > Afair CompletableFuture was considered to be used in the "trigger" > side in order to track async event invocation completion. > > br, Sven > > 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau > >: > > Hi guys, > > on async topic if I followed we are at the point where we are > looking for an activation on the observer side. > > Since Java 8 has now CompletableFuture it would be great to > use it. Today the spec doesnt use observer returned values so > it is mainly a bad practise to have one even if not strictly > forbidden - BTW never saw it in real applications - plus spec > is not compatible - not specified at all - > with CompletableFuture since it is a new API so we can use it > as a marker. > > This is quite interesting for few reasons: > 1- we have our double activation > 2- API is user friendly (observer is async and has an async > signature) > 3- open door for future async enhancements (hopefully not in > CDI) with composition of these observers > > > Only point I'm not sure is should these observers support sync > events. I don't see anything blocking to do it but can have > missed something. > > > wdyt? > > > Romain Manni-Bucau > @rmannibucau | Blog > | Github > | LinkedIn > | Tomitriber > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider > licenses the code under the Apache License, Version 2 > (http://www.apache.org/licenses/LICENSE-2.0.html). For all > other ideas provided on this list, the provider waives all > patent and other intellectual property rights inherent in such > information. > > > > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/75058461/attachment.html From rmannibucau at gmail.com Wed Apr 1 03:15:30 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Wed, 1 Apr 2015 09:15:30 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: <551B94AF.4090208@redhat.com> References: <551B94AF.4090208@redhat.com> Message-ID: No, fireAsync is still needed for all the reason we mzntionned - strongest one being the fact we need a return type and cant change fire - but using the return type we have the double activation without introducing a new API. Said otherwise API stays natural on both sides which was my main fear with a fireAsync and an @ObservesAsync (or any other new api we talked about). And we have the bonus to be aligned on SE async which sounds quite interesting for the future. Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit : > So instead of calling observers asynchronously you suggest turning > observers into producers of CompletableFuture that will then be completed > asynchronously? > > On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: > > // fire side > event.fireAsync(new LetTheWorldKnow()).thenRun(() -> > System.out.println("We did it!")); > > // observer side > CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} > > // impl behavior would be like > CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on > CompletableFuture behavior I think > > Am I clearer? > > > > Romain Manni-Bucau > @rmannibucau | Blog > | Github > | LinkedIn > | Tomitriber > > > 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : > >> Hi Romain, >> >> I am not sure, I have fully understand how an observer with CompletableFuture could >> look like. Could you give us an example? >> >> Afair CompletableFuture was considered to be used in the "trigger" side >> in order to track async event invocation completion. >> >> br, Sven >> >> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau : >> >>> Hi guys, >>> >>> on async topic if I followed we are at the point where we are looking >>> for an activation on the observer side. >>> >>> Since Java 8 has now CompletableFuture it would be great to use it. >>> Today the spec doesnt use observer returned values so it is mainly a bad >>> practise to have one even if not strictly forbidden - BTW never saw it in >>> real applications - plus spec is not compatible - not specified at all - >>> with CompletableFuture since it is a new API so we can use it as a marker. >>> >>> This is quite interesting for few reasons: >>> 1- we have our double activation >>> 2- API is user friendly (observer is async and has an async signature) >>> 3- open door for future async enhancements (hopefully not in CDI) with >>> composition of these observers >>> >>> >>> Only point I'm not sure is should these observers support sync events. >>> I don't see anything blocking to do it but can have missed something. >>> >>> >>> wdyt? >>> >>> >>> Romain Manni-Bucau >>> @rmannibucau | Blog >>> | Github >>> | LinkedIn >>> | Tomitriber >>> >>> >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >> >> > > > _______________________________________________ > cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/20d2643e/attachment-0001.html From antoine at sabot-durand.net Wed Apr 1 03:55:28 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Wed, 1 Apr 2015 09:55:28 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> Message-ID: <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Hi Romain, Intersting proposal. As I felt reading you that we misse the CompletableFuture stuff in Java 8, I just repeat here that the agreed on fireAsync signatures CompletionStage fireAsync(U event); and CompletionStage fireAsync(U event, Executor executor); Yeah it?s CompletionStage because Jozef preferred using interfaces in our API, but I guess implementation will use CompletableFuture under the hood to avoid reinventing the wheel. With this approach your example: event.fireAsync(new LetTheWorldKnow()).thenRun(() -> System.out.println("We did it!")); will work without adding constraint on observer signature. Regarding the observer part, we already discuss similar approach. In a former version of my async event doc I proposed using return type on observer to do discrimination between async and sync and Mark made a suggestion near yours during this meeting: http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html (search for the first ?signature? in text) The main drawback of this approach is to let end user generate the returned CompletableFuture. So each async observer should provide a way to construct this completableFuture. The second question is the type param of the returned CompletableFuture. Should we use raw type? Now we could imagine helped to do that but... Don?t get me wrong, I?d love to find a solution based on this kind of idea, but I fear it will add more complexity than double activation. Antoine > Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a ?crit : > > No, fireAsync is still needed for all the reason we mzntionned - strongest one being the fact we need a return type and cant change fire - but using the return type we have the double activation without introducing a new API. Said otherwise API stays natural on both sides which was my main fear with a fireAsync and an @ObservesAsync (or any other new api we talked about). And we have the bonus to be aligned on SE async which sounds quite interesting for the future. > > Le 1 avr. 2015 08:48, "Jozef Hartinger" > a ?crit : > So instead of calling observers asynchronously you suggest turning observers into producers of CompletableFuture that will then be completed asynchronously? > > On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >> // fire side >> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> System.out.println("We did it!")); >> >> // observer side >> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >> >> // impl behavior would be like CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on CompletableFuture behavior I think >> >> Am I clearer? >> >> >> >> Romain Manni-Bucau >> @rmannibucau | Blog | Github | LinkedIn | Tomitriber >> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt >: >> Hi Romain, >> >> I am not sure, I have fully understand how an observer with CompletableFuture could look like. Could you give us an example? >> >> Afair CompletableFuture was considered to be used in the "trigger" side in order to track async event invocation completion. >> >> br, Sven >> >> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau >: >> Hi guys, >> >> on async topic if I followed we are at the point where we are looking for an activation on the observer side. >> >> Since Java 8 has now CompletableFuture it would be great to use it. Today the spec doesnt use observer returned values so it is mainly a bad practise to have one even if not strictly forbidden - BTW never saw it in real applications - plus spec is not compatible - not specified at all - with CompletableFuture since it is a new API so we can use it as a marker. >> >> This is quite interesting for few reasons: >> 1- we have our double activation >> 2- API is user friendly (observer is async and has an async signature) >> 3- open door for future async enhancements (hopefully not in CDI) with composition of these observers >> >> >> Only point I'm not sure is should these observers support sync events. I don't see anything blocking to do it but can have missed something. >> >> >> wdyt? >> >> >> Romain Manni-Bucau >> @rmannibucau | Blog | Github | LinkedIn | Tomitriber >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >> >> >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/e8b51dc1/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/e8b51dc1/attachment.bin From rmannibucau at gmail.com Wed Apr 1 04:08:35 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Wed, 1 Apr 2015 10:08:35 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: Hello Antoine, Romain Manni-Bucau @rmannibucau | Blog | Github | LinkedIn | Tomitriber 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand : > Hi Romain, > > Intersting proposal. As I felt reading you that we misse the > CompletableFuture stuff in Java 8, I just repeat here that the agreed on > fireAsync signatures > > CompletionStage fireAsync(U event); > and > CompletionStage fireAsync(U event, Executor executor); > > Yeah it?s CompletionStage because Jozef preferred using interfaces in our > API, but I guess implementation will use CompletableFuture under the hood > to avoid reinventing the wheel. > > This sounds "normal" but JVM doesn't follow it with its utility methods so basically today CompletionStage is super poor compared to CompletionFuture so I'm tempted to say the impl is preferred here. I didn't check what is the adoption of both in other framework, can validate or not my thought maybe. > With this approach your example: > > event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >> System.out.println("We did it!")); >> > > will work without adding constraint on observer signature. > > Regarding the observer part, we already discuss similar approach. In a > former version of my async event doc I proposed using return type on > observer to do discrimination between async and sync and Mark made a > suggestion near yours during this meeting: > > > http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html > > (search for the first ?signature? in text) > > The main drawback of this approach is to let end user generate the > returned CompletableFuture. So each async observer should provide a way to > construct this completableFuture. The second question is the type param of > the returned CompletableFuture. Should we use raw type? Now we could > imagine helped to do that but... > > Exactly why I think this is a better solution. Cause it opens the door to asynchronism in a more elegant manner handling completion properly. I guess first impl will use allOf() combination but I see anyOf() - i fire to "notifiers" and I care only of 1 at least being called as a caller - and potentially other combinations other potentials needs we could cover in another spec (hopefully). If async is just fire and forget we don't need fireAsync() but only fire() (void) and then observers are async or not which ensures compat at all levels since observers decide to be in the same context or not but I guess we don't want only fire and forget. About creating a CompletableFuture we can do as in EJB spec and provide version to use by observer impl (javax.ejb.AsyncResult). > Don?t get me wrong, I?d love to find a solution based on this kind of > idea, but I fear it will add more complexity than double activation. > > Antoine > > > Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a > ?crit : > > No, fireAsync is still needed for all the reason we mzntionned - strongest > one being the fact we need a return type and cant change fire - but using > the return type we have the double activation without introducing a new > API. Said otherwise API stays natural on both sides which was my main fear > with a fireAsync and an @ObservesAsync (or any other new api we talked > about). And we have the bonus to be aligned on SE async which sounds quite > interesting for the future. > Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit : > >> So instead of calling observers asynchronously you suggest turning >> observers into producers of CompletableFuture that will then be completed >> asynchronously? >> >> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >> >> // fire side >> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >> System.out.println("We did it!")); >> >> // observer side >> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >> >> // impl behavior would be like >> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >> CompletableFuture behavior I think >> >> Am I clearer? >> >> >> >> Romain Manni-Bucau >> @rmannibucau | Blog >> | Github >> | LinkedIn >> | Tomitriber >> >> >> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : >> >>> Hi Romain, >>> >>> I am not sure, I have fully understand how an observer with CompletableFuture could >>> look like. Could you give us an example? >>> >>> Afair CompletableFuture was considered to be used in the "trigger" >>> side in order to track async event invocation completion. >>> >>> br, Sven >>> >>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau : >>> >>>> Hi guys, >>>> >>>> on async topic if I followed we are at the point where we are looking >>>> for an activation on the observer side. >>>> >>>> Since Java 8 has now CompletableFuture it would be great to use it. >>>> Today the spec doesnt use observer returned values so it is mainly a bad >>>> practise to have one even if not strictly forbidden - BTW never saw it in >>>> real applications - plus spec is not compatible - not specified at all - >>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>> >>>> This is quite interesting for few reasons: >>>> 1- we have our double activation >>>> 2- API is user friendly (observer is async and has an async signature) >>>> 3- open door for future async enhancements (hopefully not in CDI) with >>>> composition of these observers >>>> >>>> >>>> Only point I'm not sure is should these observers support sync >>>> events. I don't see anything blocking to do it but can have missed >>>> something. >>>> >>>> >>>> wdyt? >>>> >>>> >>>> Romain Manni-Bucau >>>> @rmannibucau | Blog >>>> | Github >>>> | LinkedIn >>>> | Tomitriber >>>> >>>> >>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>> >>> >> >> >> _______________________________________________ >> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >> >> >> _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/7132ef4e/attachment-0001.html From jose.paumard at gmail.com Wed Apr 1 13:43:52 2015 From: jose.paumard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Paumard?=) Date: Wed, 1 Apr 2015 19:43:52 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: CompletionStage has a toCompletableFuture() method, that returns a CompletableFuture. So there is no limitation in returning CompletionStage. It could allow different implementation in the future than the only one we have so far : CompletableFuture, since one can build a CompletableFuture that wraps another implementation. Problem with CF.allOf() and anyOf() is that they return resp. CF and CF, which is not very API friendly. Having the observers writers to provide his own implementation of CompletableFuture is not that great imho. For the async EJB, all you can do is return executorService.submit(myTask). I understand why the API designers have chosen that, but I dont think it's that great. Correct me if I'm wrong, but I think that we have the opportunity to move that burden from the observers writers to the framework. And I think it would make the API easier to use. Jos? 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : > Hello Antoine, > > > Romain Manni-Bucau > @rmannibucau | Blog > | Github > | LinkedIn > | Tomitriber > > > 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand : > >> Hi Romain, >> >> Intersting proposal. As I felt reading you that we misse the >> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >> fireAsync signatures >> >> CompletionStage fireAsync(U event); >> and >> CompletionStage fireAsync(U event, Executor executor); >> >> Yeah it?s CompletionStage because Jozef preferred using interfaces in our >> API, but I guess implementation will use CompletableFuture under the hood >> to avoid reinventing the wheel. >> >> > This sounds "normal" but JVM doesn't follow it with its utility methods so > basically today CompletionStage is super poor compared to CompletionFuture > so I'm tempted to say the impl is preferred here. I didn't check what is > the adoption of both in other framework, can validate or not my thought > maybe. > > >> With this approach your example: >> >> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>> System.out.println("We did it!")); >>> >> >> will work without adding constraint on observer signature. >> >> Regarding the observer part, we already discuss similar approach. In a >> former version of my async event doc I proposed using return type on >> observer to do discrimination between async and sync and Mark made a >> suggestion near yours during this meeting: >> >> >> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >> >> (search for the first ?signature? in text) >> >> The main drawback of this approach is to let end user generate the >> returned CompletableFuture. So each async observer should provide a way to >> construct this completableFuture. The second question is the type param of >> the returned CompletableFuture. Should we use raw type? Now we could >> imagine helped to do that but... >> >> > Exactly why I think this is a better solution. Cause it opens the door to > asynchronism in a more elegant manner handling completion properly. I guess > first impl will use allOf() combination but I see anyOf() - i fire to > "notifiers" and I care only of 1 at least being called as a caller - and > potentially other combinations other potentials needs we could cover in > another spec (hopefully). > > If async is just fire and forget we don't need fireAsync() but only fire() > (void) and then observers are async or not which ensures compat at all > levels since observers decide to be in the same context or not but I guess > we don't want only fire and forget. > > About creating a CompletableFuture we can do as in EJB spec and provide > version to use by observer impl (javax.ejb.AsyncResult). > > >> Don?t get me wrong, I?d love to find a solution based on this kind of >> idea, but I fear it will add more complexity than double activation. >> >> Antoine >> >> >> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a >> ?crit : >> >> No, fireAsync is still needed for all the reason we mzntionned - >> strongest one being the fact we need a return type and cant change fire - >> but using the return type we have the double activation without introducing >> a new API. Said otherwise API stays natural on both sides which was my main >> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >> about). And we have the bonus to be aligned on SE async which sounds quite >> interesting for the future. >> Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit : >> >>> So instead of calling observers asynchronously you suggest turning >>> observers into producers of CompletableFuture that will then be completed >>> asynchronously? >>> >>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>> >>> // fire side >>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>> System.out.println("We did it!")); >>> >>> // observer side >>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>> >>> // impl behavior would be like >>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>> CompletableFuture behavior I think >>> >>> Am I clearer? >>> >>> >>> >>> Romain Manni-Bucau >>> @rmannibucau | Blog >>> | Github >>> | LinkedIn >>> | Tomitriber >>> >>> >>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : >>> >>>> Hi Romain, >>>> >>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>> look like. Could you give us an example? >>>> >>>> Afair CompletableFuture was considered to be used in the "trigger" >>>> side in order to track async event invocation completion. >>>> >>>> br, Sven >>>> >>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau : >>>> >>>>> Hi guys, >>>>> >>>>> on async topic if I followed we are at the point where we are >>>>> looking for an activation on the observer side. >>>>> >>>>> Since Java 8 has now CompletableFuture it would be great to use it. >>>>> Today the spec doesnt use observer returned values so it is mainly a bad >>>>> practise to have one even if not strictly forbidden - BTW never saw it in >>>>> real applications - plus spec is not compatible - not specified at all - >>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>> >>>>> This is quite interesting for few reasons: >>>>> 1- we have our double activation >>>>> 2- API is user friendly (observer is async and has an async signature) >>>>> 3- open door for future async enhancements (hopefully not in CDI) with >>>>> composition of these observers >>>>> >>>>> >>>>> Only point I'm not sure is should these observers support sync >>>>> events. I don't see anything blocking to do it but can have missed >>>>> something. >>>>> >>>>> >>>>> wdyt? >>>>> >>>>> >>>>> Romain Manni-Bucau >>>>> @rmannibucau | Blog >>>>> | Github >>>>> | LinkedIn >>>>> | Tomitriber >>>>> >>>>> >>>>> _______________________________________________ >>>>> cdi-dev mailing list >>>>> cdi-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> >>>>> Note that for all code provided on this list, the provider licenses >>>>> the code under the Apache License, Version 2 ( >>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>>> provided on this list, the provider waives all patent and other >>>>> intellectual property rights inherent in such information. >>>>> >>>> >>>> >>> >>> >>> _______________________________________________ >>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>> >>> >>> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> >> >> > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Java le soir Cours Java en ligne Twitter Paris JUG Devoxx France M : +33 6 76 82 91 47 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/4681ecc7/attachment-0001.html From rmannibucau at gmail.com Wed Apr 1 13:54:10 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Wed, 1 Apr 2015 19:54:10 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: 2015-04-01 19:43 GMT+02:00 Jos? Paumard : > CompletionStage has a toCompletableFuture() method, that returns a > CompletableFuture. So there is no limitation in returning CompletionStage. > It could allow different implementation in the future than the only one we > have so far : CompletableFuture, since one can build a CompletableFuture > that wraps another implementation. > > +1, missed it > Problem with CF.allOf() and anyOf() is that they return resp. CF and > CF, which is not very API friendly. > > it is enough in enough cases IMO > Having the observers writers to provide his own implementation of > CompletableFuture is not that great imho. For the async EJB, all you can do > is return executorService.submit(myTask). I understand why the API > designers have chosen that, but I dont think it's that great. Correct me if > I'm wrong, but I think that we have the opportunity to move that burden > from the observers writers to the framework. And I think it would make the > API easier to use. > > What's your proposal? EJB API is quite nice to use and it integrates smoothly with Future<>, not sure I get what's your issue is here. > Jos? > > > 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : > >> Hello Antoine, >> >> >> Romain Manni-Bucau >> @rmannibucau | Blog >> | Github >> | LinkedIn >> | Tomitriber >> >> >> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand >> : >> >>> Hi Romain, >>> >>> Intersting proposal. As I felt reading you that we misse the >>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>> fireAsync signatures >>> >>> CompletionStage fireAsync(U event); >>> and >>> CompletionStage fireAsync(U event, Executor executor); >>> >>> Yeah it?s CompletionStage because Jozef preferred using interfaces in >>> our API, but I guess implementation will use CompletableFuture under the >>> hood to avoid reinventing the wheel. >>> >>> >> This sounds "normal" but JVM doesn't follow it with its utility methods >> so basically today CompletionStage is super poor compared to >> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >> check what is the adoption of both in other framework, can validate or not >> my thought maybe. >> >> >>> With this approach your example: >>> >>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>> System.out.println("We did it!")); >>>> >>> >>> will work without adding constraint on observer signature. >>> >>> Regarding the observer part, we already discuss similar approach. In a >>> former version of my async event doc I proposed using return type on >>> observer to do discrimination between async and sync and Mark made a >>> suggestion near yours during this meeting: >>> >>> >>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>> >>> (search for the first ?signature? in text) >>> >>> The main drawback of this approach is to let end user generate the >>> returned CompletableFuture. So each async observer should provide a way to >>> construct this completableFuture. The second question is the type param of >>> the returned CompletableFuture. Should we use raw type? Now we could >>> imagine helped to do that but... >>> >>> >> Exactly why I think this is a better solution. Cause it opens the door to >> asynchronism in a more elegant manner handling completion properly. I guess >> first impl will use allOf() combination but I see anyOf() - i fire to >> "notifiers" and I care only of 1 at least being called as a caller - and >> potentially other combinations other potentials needs we could cover in >> another spec (hopefully). >> >> If async is just fire and forget we don't need fireAsync() but only >> fire() (void) and then observers are async or not which ensures compat at >> all levels since observers decide to be in the same context or not but I >> guess we don't want only fire and forget. >> >> About creating a CompletableFuture we can do as in EJB spec and provide >> version to use by observer impl (javax.ejb.AsyncResult). >> >> >>> Don?t get me wrong, I?d love to find a solution based on this kind of >>> idea, but I fear it will add more complexity than double activation. >>> >>> Antoine >>> >>> >>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a >>> ?crit : >>> >>> No, fireAsync is still needed for all the reason we mzntionned - >>> strongest one being the fact we need a return type and cant change fire - >>> but using the return type we have the double activation without introducing >>> a new API. Said otherwise API stays natural on both sides which was my main >>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>> about). And we have the bonus to be aligned on SE async which sounds quite >>> interesting for the future. >>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit : >>> >>>> So instead of calling observers asynchronously you suggest turning >>>> observers into producers of CompletableFuture that will then be completed >>>> asynchronously? >>>> >>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>> >>>> // fire side >>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>> System.out.println("We did it!")); >>>> >>>> // observer side >>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>> >>>> // impl behavior would be like >>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>> CompletableFuture behavior I think >>>> >>>> Am I clearer? >>>> >>>> >>>> >>>> Romain Manni-Bucau >>>> @rmannibucau | Blog >>>> | Github >>>> | LinkedIn >>>> | Tomitriber >>>> >>>> >>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : >>>> >>>>> Hi Romain, >>>>> >>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>> look like. Could you give us an example? >>>>> >>>>> Afair CompletableFuture was considered to be used in the "trigger" >>>>> side in order to track async event invocation completion. >>>>> >>>>> br, Sven >>>>> >>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau >>>>> : >>>>> >>>>>> Hi guys, >>>>>> >>>>>> on async topic if I followed we are at the point where we are >>>>>> looking for an activation on the observer side. >>>>>> >>>>>> Since Java 8 has now CompletableFuture it would be great to use it. >>>>>> Today the spec doesnt use observer returned values so it is mainly a bad >>>>>> practise to have one even if not strictly forbidden - BTW never saw it in >>>>>> real applications - plus spec is not compatible - not specified at all - >>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>> >>>>>> This is quite interesting for few reasons: >>>>>> 1- we have our double activation >>>>>> 2- API is user friendly (observer is async and has an async signature) >>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>> with composition of these observers >>>>>> >>>>>> >>>>>> Only point I'm not sure is should these observers support sync >>>>>> events. I don't see anything blocking to do it but can have missed >>>>>> something. >>>>>> >>>>>> >>>>>> wdyt? >>>>>> >>>>>> >>>>>> Romain Manni-Bucau >>>>>> @rmannibucau | Blog >>>>>> | Github >>>>>> | LinkedIn >>>>>> | Tomitriber >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> cdi-dev mailing list >>>>>> cdi-dev at lists.jboss.org >>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>> >>>>>> Note that for all code provided on this list, the provider licenses >>>>>> the code under the Apache License, Version 2 ( >>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>> ideas provided on this list, the provider waives all patent and other >>>>>> intellectual property rights inherent in such information. >>>>>> >>>>> >>>>> >>>> >>>> >>>> _______________________________________________ >>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>> >>>> >>>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >>> >>> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > > > -- > Java le soir Cours Java en ligne > > Twitter Paris JUG > Devoxx France > M : +33 6 76 82 91 47 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/fded9bf6/attachment-0001.html From jose.paumard at gmail.com Wed Apr 1 15:46:38 2015 From: jose.paumard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Paumard?=) Date: Wed, 1 Apr 2015 21:46:38 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: > What's your proposal? EJB API is quite nice to use and it integrates smoothly with Future<>, not sure I get what's your issue is here. EJB has me to write this kind of code : return es.submit(myTask) ; Because this is a synchronous call, that has to return a Future. But on the other hand this is purely tehcnical code, that cant be put in the framework, since one can call directly an EJB method. So the return type has to be the one of the EJB method. With events the situation is different. On the calling side, I write completableFuture = event.fireAsync(payload) ; // type is CompletionStage On the observing side I can write : public T observes(@Observes payload) { return t ; } And the framework will take care of wrapping this t in a CompletableFuture.allOf(...) with all the other observers to return it. So I dont have to deal myself with the technical aspects of calling ES myself. IMHO it leads to easier to write patterns. Jos? 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : > > > 2015-04-01 19:43 GMT+02:00 Jos? Paumard : > >> CompletionStage has a toCompletableFuture() method, that returns a >> CompletableFuture. So there is no limitation in returning CompletionStage. >> It could allow different implementation in the future than the only one we >> have so far : CompletableFuture, since one can build a CompletableFuture >> that wraps another implementation. >> >> > +1, missed it > > >> Problem with CF.allOf() and anyOf() is that they return resp. CF >> and CF, which is not very API friendly. >> >> > it is enough in enough cases IMO > > >> Having the observers writers to provide his own implementation of >> CompletableFuture is not that great imho. For the async EJB, all you can do >> is return executorService.submit(myTask). I understand why the API >> designers have chosen that, but I dont think it's that great. Correct me if >> I'm wrong, but I think that we have the opportunity to move that burden >> from the observers writers to the framework. And I think it would make the >> API easier to use. >> >> > What's your proposal? EJB API is quite nice to use and it integrates > smoothly with Future<>, not sure I get what's your issue is here. > > >> Jos? >> >> >> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : >> >>> Hello Antoine, >>> >>> >>> Romain Manni-Bucau >>> @rmannibucau | Blog >>> | Github >>> | LinkedIn >>> | Tomitriber >>> >>> >>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand >> >: >>> >>>> Hi Romain, >>>> >>>> Intersting proposal. As I felt reading you that we misse the >>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>> fireAsync signatures >>>> >>>> CompletionStage fireAsync(U event); >>>> and >>>> CompletionStage fireAsync(U event, Executor executor); >>>> >>>> Yeah it?s CompletionStage because Jozef preferred using interfaces in >>>> our API, but I guess implementation will use CompletableFuture under the >>>> hood to avoid reinventing the wheel. >>>> >>>> >>> This sounds "normal" but JVM doesn't follow it with its utility methods >>> so basically today CompletionStage is super poor compared to >>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>> check what is the adoption of both in other framework, can validate or not >>> my thought maybe. >>> >>> >>>> With this approach your example: >>>> >>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>> System.out.println("We did it!")); >>>>> >>>> >>>> will work without adding constraint on observer signature. >>>> >>>> Regarding the observer part, we already discuss similar approach. In a >>>> former version of my async event doc I proposed using return type on >>>> observer to do discrimination between async and sync and Mark made a >>>> suggestion near yours during this meeting: >>>> >>>> >>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>> >>>> (search for the first ?signature? in text) >>>> >>>> The main drawback of this approach is to let end user generate the >>>> returned CompletableFuture. So each async observer should provide a way to >>>> construct this completableFuture. The second question is the type param of >>>> the returned CompletableFuture. Should we use raw type? Now we could >>>> imagine helped to do that but... >>>> >>>> >>> Exactly why I think this is a better solution. Cause it opens the door >>> to asynchronism in a more elegant manner handling completion properly. I >>> guess first impl will use allOf() combination but I see anyOf() - i fire to >>> "notifiers" and I care only of 1 at least being called as a caller - and >>> potentially other combinations other potentials needs we could cover in >>> another spec (hopefully). >>> >>> If async is just fire and forget we don't need fireAsync() but only >>> fire() (void) and then observers are async or not which ensures compat at >>> all levels since observers decide to be in the same context or not but I >>> guess we don't want only fire and forget. >>> >>> About creating a CompletableFuture we can do as in EJB spec and provide >>> version to use by observer impl (javax.ejb.AsyncResult). >>> >>> >>>> Don?t get me wrong, I?d love to find a solution based on this kind of >>>> idea, but I fear it will add more complexity than double activation. >>>> >>>> Antoine >>>> >>>> >>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a >>>> ?crit : >>>> >>>> No, fireAsync is still needed for all the reason we mzntionned - >>>> strongest one being the fact we need a return type and cant change fire - >>>> but using the return type we have the double activation without introducing >>>> a new API. Said otherwise API stays natural on both sides which was my main >>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>> interesting for the future. >>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit : >>>> >>>>> So instead of calling observers asynchronously you suggest turning >>>>> observers into producers of CompletableFuture that will then be completed >>>>> asynchronously? >>>>> >>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>> >>>>> // fire side >>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>> System.out.println("We did it!")); >>>>> >>>>> // observer side >>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>> >>>>> // impl behavior would be like >>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>> CompletableFuture behavior I think >>>>> >>>>> Am I clearer? >>>>> >>>>> >>>>> >>>>> Romain Manni-Bucau >>>>> @rmannibucau | Blog >>>>> | Github >>>>> | LinkedIn >>>>> | Tomitriber >>>>> >>>>> >>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : >>>>> >>>>>> Hi Romain, >>>>>> >>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>> look like. Could you give us an example? >>>>>> >>>>>> Afair CompletableFuture was considered to be used in the "trigger" >>>>>> side in order to track async event invocation completion. >>>>>> >>>>>> br, Sven >>>>>> >>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau >>>>> >: >>>>>> >>>>>>> Hi guys, >>>>>>> >>>>>>> on async topic if I followed we are at the point where we are >>>>>>> looking for an activation on the observer side. >>>>>>> >>>>>>> Since Java 8 has now CompletableFuture it would be great to use >>>>>>> it. Today the spec doesnt use observer returned values so it is mainly a >>>>>>> bad practise to have one even if not strictly forbidden - BTW never saw it >>>>>>> in real applications - plus spec is not compatible - not specified at all - >>>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>>> >>>>>>> This is quite interesting for few reasons: >>>>>>> 1- we have our double activation >>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>> signature) >>>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>>> with composition of these observers >>>>>>> >>>>>>> >>>>>>> Only point I'm not sure is should these observers support sync >>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>> something. >>>>>>> >>>>>>> >>>>>>> wdyt? >>>>>>> >>>>>>> >>>>>>> Romain Manni-Bucau >>>>>>> @rmannibucau | Blog >>>>>>> | Github >>>>>>> | LinkedIn >>>>>>> | Tomitriber >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> cdi-dev mailing list >>>>>>> cdi-dev at lists.jboss.org >>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>> >>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>> the code under the Apache License, Version 2 ( >>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>> intellectual property rights inherent in such information. >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> >>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>> >>>>> >>>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>>> >>>> >>> >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >> >> >> >> -- >> Java le soir Cours Java en ligne >> >> Twitter Paris JUG >> Devoxx France >> M : +33 6 76 82 91 47 >> > > -- Java le soir Cours Java en ligne Twitter Paris JUG Devoxx France M : +33 6 76 82 91 47 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/737807ad/attachment-0001.html From rmannibucau at gmail.com Wed Apr 1 16:04:50 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Wed, 1 Apr 2015 22:04:50 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: 2015-04-01 21:46 GMT+02:00 Jos? Paumard : > > What's your proposal? EJB API is quite nice to use and it integrates > smoothly with Future<>, not sure I get what's your issue is here. > EJB has me to write this kind of code : > > return es.submit(myTask) ; > > this looks wrong, return new AsyncFuture("i did it"); is what you should have written otherwise you just didnt use EJB async feature. > Because this is a synchronous call, that has to return a Future. But on > the other hand this is purely tehcnical code, that cant be put in the > framework, since one can call directly an EJB method. So the return type > has to be the one of the EJB method. > > With events the situation is different. On the calling side, I write > > completableFuture = event.fireAsync(payload) ; // type is > CompletionStage call> > > On the observing side I can write : > > public T observes(@Observes payload) { return t ; } > > And the framework will take care of wrapping this t in a > CompletableFuture.allOf(...) with all the other observers to return it. So > I dont have to deal myself with the technical aspects of calling ES myself. > IMHO it leads to easier to write patterns. > Why T then? And actually your explanation is my proposal but a on purpose typing. > > Jos? > > > > 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : > >> >> >> 2015-04-01 19:43 GMT+02:00 Jos? Paumard : >> >>> CompletionStage has a toCompletableFuture() method, that returns a >>> CompletableFuture. So there is no limitation in returning CompletionStage. >>> It could allow different implementation in the future than the only one we >>> have so far : CompletableFuture, since one can build a CompletableFuture >>> that wraps another implementation. >>> >>> >> +1, missed it >> >> >>> Problem with CF.allOf() and anyOf() is that they return resp. CF >>> and CF, which is not very API friendly. >>> >>> >> it is enough in enough cases IMO >> >> >>> Having the observers writers to provide his own implementation of >>> CompletableFuture is not that great imho. For the async EJB, all you can do >>> is return executorService.submit(myTask). I understand why the API >>> designers have chosen that, but I dont think it's that great. Correct me if >>> I'm wrong, but I think that we have the opportunity to move that burden >>> from the observers writers to the framework. And I think it would make the >>> API easier to use. >>> >>> >> What's your proposal? EJB API is quite nice to use and it integrates >> smoothly with Future<>, not sure I get what's your issue is here. >> >> >>> Jos? >>> >>> >>> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : >>> >>>> Hello Antoine, >>>> >>>> >>>> Romain Manni-Bucau >>>> @rmannibucau | Blog >>>> | Github >>>> | LinkedIn >>>> | Tomitriber >>>> >>>> >>>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand < >>>> antoine at sabot-durand.net>: >>>> >>>>> Hi Romain, >>>>> >>>>> Intersting proposal. As I felt reading you that we misse the >>>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>>> fireAsync signatures >>>>> >>>>> CompletionStage fireAsync(U event); >>>>> and >>>>> CompletionStage fireAsync(U event, Executor executor); >>>>> >>>>> Yeah it?s CompletionStage because Jozef preferred using interfaces in >>>>> our API, but I guess implementation will use CompletableFuture under the >>>>> hood to avoid reinventing the wheel. >>>>> >>>>> >>>> This sounds "normal" but JVM doesn't follow it with its utility methods >>>> so basically today CompletionStage is super poor compared to >>>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>>> check what is the adoption of both in other framework, can validate or not >>>> my thought maybe. >>>> >>>> >>>>> With this approach your example: >>>>> >>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>> System.out.println("We did it!")); >>>>>> >>>>> >>>>> will work without adding constraint on observer signature. >>>>> >>>>> Regarding the observer part, we already discuss similar approach. In a >>>>> former version of my async event doc I proposed using return type on >>>>> observer to do discrimination between async and sync and Mark made a >>>>> suggestion near yours during this meeting: >>>>> >>>>> >>>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>>> >>>>> (search for the first ?signature? in text) >>>>> >>>>> The main drawback of this approach is to let end user generate the >>>>> returned CompletableFuture. So each async observer should provide a way to >>>>> construct this completableFuture. The second question is the type param of >>>>> the returned CompletableFuture. Should we use raw type? Now we could >>>>> imagine helped to do that but... >>>>> >>>>> >>>> Exactly why I think this is a better solution. Cause it opens the door >>>> to asynchronism in a more elegant manner handling completion properly. I >>>> guess first impl will use allOf() combination but I see anyOf() - i fire to >>>> "notifiers" and I care only of 1 at least being called as a caller - and >>>> potentially other combinations other potentials needs we could cover in >>>> another spec (hopefully). >>>> >>>> If async is just fire and forget we don't need fireAsync() but only >>>> fire() (void) and then observers are async or not which ensures compat at >>>> all levels since observers decide to be in the same context or not but I >>>> guess we don't want only fire and forget. >>>> >>>> About creating a CompletableFuture we can do as in EJB spec and provide >>>> version to use by observer impl (javax.ejb.AsyncResult). >>>> >>>> >>>>> Don?t get me wrong, I?d love to find a solution based on this kind of >>>>> idea, but I fear it will add more complexity than double activation. >>>>> >>>>> Antoine >>>>> >>>>> >>>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a >>>>> ?crit : >>>>> >>>>> No, fireAsync is still needed for all the reason we mzntionned - >>>>> strongest one being the fact we need a return type and cant change fire - >>>>> but using the return type we have the double activation without introducing >>>>> a new API. Said otherwise API stays natural on both sides which was my main >>>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>>> interesting for the future. >>>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a ?crit >>>>> : >>>>> >>>>>> So instead of calling observers asynchronously you suggest turning >>>>>> observers into producers of CompletableFuture that will then be completed >>>>>> asynchronously? >>>>>> >>>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>>> >>>>>> // fire side >>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>> System.out.println("We did it!")); >>>>>> >>>>>> // observer side >>>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>>> >>>>>> // impl behavior would be like >>>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>>> CompletableFuture behavior I think >>>>>> >>>>>> Am I clearer? >>>>>> >>>>>> >>>>>> >>>>>> Romain Manni-Bucau >>>>>> @rmannibucau | Blog >>>>>> | Github >>>>>> | LinkedIn >>>>>> | Tomitriber >>>>>> >>>>>> >>>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt : >>>>>> >>>>>>> Hi Romain, >>>>>>> >>>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>>> look like. Could you give us an example? >>>>>>> >>>>>>> Afair CompletableFuture was considered to be used in the "trigger" >>>>>>> side in order to track async event invocation completion. >>>>>>> >>>>>>> br, Sven >>>>>>> >>>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau < >>>>>>> rmannibucau at gmail.com>: >>>>>>> >>>>>>>> Hi guys, >>>>>>>> >>>>>>>> on async topic if I followed we are at the point where we are >>>>>>>> looking for an activation on the observer side. >>>>>>>> >>>>>>>> Since Java 8 has now CompletableFuture it would be great to use >>>>>>>> it. Today the spec doesnt use observer returned values so it is mainly a >>>>>>>> bad practise to have one even if not strictly forbidden - BTW never saw it >>>>>>>> in real applications - plus spec is not compatible - not specified at all - >>>>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>>>> >>>>>>>> This is quite interesting for few reasons: >>>>>>>> 1- we have our double activation >>>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>>> signature) >>>>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>>>> with composition of these observers >>>>>>>> >>>>>>>> >>>>>>>> Only point I'm not sure is should these observers support sync >>>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>>> something. >>>>>>>> >>>>>>>> >>>>>>>> wdyt? >>>>>>>> >>>>>>>> >>>>>>>> Romain Manni-Bucau >>>>>>>> @rmannibucau | Blog >>>>>>>> | Github >>>>>>>> | LinkedIn >>>>>>>> | Tomitriber >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> cdi-dev mailing list >>>>>>>> cdi-dev at lists.jboss.org >>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>> >>>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>>> the code under the Apache License, Version 2 ( >>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>> intellectual property rights inherent in such information. >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>> >>>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>> cdi-dev mailing list >>>>> cdi-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> >>>>> Note that for all code provided on this list, the provider licenses >>>>> the code under the Apache License, Version 2 ( >>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>>> provided on this list, the provider waives all patent and other >>>>> intellectual property rights inherent in such information. >>>>> >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>> >>> >>> >>> -- >>> Java le soir Cours Java en ligne >>> >>> Twitter Paris JUG >>> Devoxx France >>> M : +33 6 76 82 91 47 >>> >> >> > > > -- > Java le soir Cours Java en ligne > > Twitter Paris JUG > Devoxx France > M : +33 6 76 82 91 47 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/efbd8a3e/attachment-0001.html From jose.paumard at gmail.com Wed Apr 1 16:22:40 2015 From: jose.paumard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Paumard?=) Date: Wed, 1 Apr 2015 22:22:40 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: 2015-04-01 22:04 GMT+02:00 Romain Manni-Bucau : > > > 2015-04-01 21:46 GMT+02:00 Jos? Paumard : > >> > What's your proposal? EJB API is quite nice to use and it integrates >> smoothly with Future<>, not sure I get what's your issue is here. >> EJB has me to write this kind of code : >> >> return es.submit(myTask) ; >> >> > this looks wrong, return new AsyncFuture("i did it"); is what you > should have written otherwise you just didnt use EJB async feature. > Hmm I dont think so. If I write return new AsyncResult("Done in thread " + Thread.currentThread().getName()) ; // returns a Future Then my code is not async at all, the get() call will just return my parameter, and no other thread will be used in that process. If I write : return new executorService.submit(() -> "Done in thread " + Thread.currentThread().getName()}) ; Then I get an async call. BTW if you check the source code of the AsyncResult class (with a nice typo in it), its clearly written in it that it is not a real Future. > > >> Because this is a synchronous call, that has to return a Future. But on >> the other hand this is purely tehcnical code, that cant be put in the >> framework, since one can call directly an EJB method. So the return type >> has to be the one of the EJB method. >> >> With events the situation is different. On the calling side, I write >> >> completableFuture = event.fireAsync(payload) ; // type is >> CompletionStage> call> >> >> On the observing side I can write : >> >> public T observes(@Observes payload) { return t ; } >> >> And the framework will take care of wrapping this t in a >> CompletableFuture.allOf(...) with all the other observers to return it. So >> I dont have to deal myself with the technical aspects of calling ES myself. >> IMHO it leads to easier to write patterns. >> > > Why T then? And actually your explanation is my proposal but a on purpose > typing. > > >> >> Jos? >> >> >> >> 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : >> >>> >>> >>> 2015-04-01 19:43 GMT+02:00 Jos? Paumard : >>> >>>> CompletionStage has a toCompletableFuture() method, that returns a >>>> CompletableFuture. So there is no limitation in returning CompletionStage. >>>> It could allow different implementation in the future than the only one we >>>> have so far : CompletableFuture, since one can build a CompletableFuture >>>> that wraps another implementation. >>>> >>>> >>> +1, missed it >>> >>> >>>> Problem with CF.allOf() and anyOf() is that they return resp. CF >>>> and CF, which is not very API friendly. >>>> >>>> >>> it is enough in enough cases IMO >>> >>> >>>> Having the observers writers to provide his own implementation of >>>> CompletableFuture is not that great imho. For the async EJB, all you can do >>>> is return executorService.submit(myTask). I understand why the API >>>> designers have chosen that, but I dont think it's that great. Correct me if >>>> I'm wrong, but I think that we have the opportunity to move that burden >>>> from the observers writers to the framework. And I think it would make the >>>> API easier to use. >>>> >>>> >>> What's your proposal? EJB API is quite nice to use and it integrates >>> smoothly with Future<>, not sure I get what's your issue is here. >>> >>> >>>> Jos? >>>> >>>> >>>> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : >>>> >>>>> Hello Antoine, >>>>> >>>>> >>>>> Romain Manni-Bucau >>>>> @rmannibucau | Blog >>>>> | Github >>>>> | LinkedIn >>>>> | Tomitriber >>>>> >>>>> >>>>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand < >>>>> antoine at sabot-durand.net>: >>>>> >>>>>> Hi Romain, >>>>>> >>>>>> Intersting proposal. As I felt reading you that we misse the >>>>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>>>> fireAsync signatures >>>>>> >>>>>> CompletionStage fireAsync(U event); >>>>>> and >>>>>> CompletionStage fireAsync(U event, Executor >>>>>> executor); >>>>>> >>>>>> Yeah it?s CompletionStage because Jozef preferred using interfaces in >>>>>> our API, but I guess implementation will use CompletableFuture under the >>>>>> hood to avoid reinventing the wheel. >>>>>> >>>>>> >>>>> This sounds "normal" but JVM doesn't follow it with its utility >>>>> methods so basically today CompletionStage is super poor compared to >>>>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>>>> check what is the adoption of both in other framework, can validate or not >>>>> my thought maybe. >>>>> >>>>> >>>>>> With this approach your example: >>>>>> >>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>> System.out.println("We did it!")); >>>>>>> >>>>>> >>>>>> will work without adding constraint on observer signature. >>>>>> >>>>>> Regarding the observer part, we already discuss similar approach. In >>>>>> a former version of my async event doc I proposed using return type on >>>>>> observer to do discrimination between async and sync and Mark made a >>>>>> suggestion near yours during this meeting: >>>>>> >>>>>> >>>>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>>>> >>>>>> (search for the first ?signature? in text) >>>>>> >>>>>> The main drawback of this approach is to let end user generate the >>>>>> returned CompletableFuture. So each async observer should provide a way to >>>>>> construct this completableFuture. The second question is the type param of >>>>>> the returned CompletableFuture. Should we use raw type? Now we could >>>>>> imagine helped to do that but... >>>>>> >>>>>> >>>>> Exactly why I think this is a better solution. Cause it opens the door >>>>> to asynchronism in a more elegant manner handling completion properly. I >>>>> guess first impl will use allOf() combination but I see anyOf() - i fire to >>>>> "notifiers" and I care only of 1 at least being called as a caller - and >>>>> potentially other combinations other potentials needs we could cover in >>>>> another spec (hopefully). >>>>> >>>>> If async is just fire and forget we don't need fireAsync() but only >>>>> fire() (void) and then observers are async or not which ensures compat at >>>>> all levels since observers decide to be in the same context or not but I >>>>> guess we don't want only fire and forget. >>>>> >>>>> About creating a CompletableFuture we can do as in EJB spec and >>>>> provide version to use by observer impl (javax.ejb.AsyncResult). >>>>> >>>>> >>>>>> Don?t get me wrong, I?d love to find a solution based on this kind of >>>>>> idea, but I fear it will add more complexity than double activation. >>>>>> >>>>>> Antoine >>>>>> >>>>>> >>>>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau a >>>>>> ?crit : >>>>>> >>>>>> No, fireAsync is still needed for all the reason we mzntionned - >>>>>> strongest one being the fact we need a return type and cant change fire - >>>>>> but using the return type we have the double activation without introducing >>>>>> a new API. Said otherwise API stays natural on both sides which was my main >>>>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>>>> interesting for the future. >>>>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a >>>>>> ?crit : >>>>>> >>>>>>> So instead of calling observers asynchronously you suggest turning >>>>>>> observers into producers of CompletableFuture that will then be completed >>>>>>> asynchronously? >>>>>>> >>>>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>>>> >>>>>>> // fire side >>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>> System.out.println("We did it!")); >>>>>>> >>>>>>> // observer side >>>>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>>>> >>>>>>> // impl behavior would be like >>>>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>>>> CompletableFuture behavior I think >>>>>>> >>>>>>> Am I clearer? >>>>>>> >>>>>>> >>>>>>> >>>>>>> Romain Manni-Bucau >>>>>>> @rmannibucau | Blog >>>>>>> | Github >>>>>>> | LinkedIn >>>>>>> | Tomitriber >>>>>>> >>>>>>> >>>>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt >>>>>>> : >>>>>>> >>>>>>>> Hi Romain, >>>>>>>> >>>>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>>>> look like. Could you give us an example? >>>>>>>> >>>>>>>> Afair CompletableFuture was considered to be used in the >>>>>>>> "trigger" side in order to track async event invocation completion. >>>>>>>> >>>>>>>> br, Sven >>>>>>>> >>>>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau < >>>>>>>> rmannibucau at gmail.com>: >>>>>>>> >>>>>>>>> Hi guys, >>>>>>>>> >>>>>>>>> on async topic if I followed we are at the point where we are >>>>>>>>> looking for an activation on the observer side. >>>>>>>>> >>>>>>>>> Since Java 8 has now CompletableFuture it would be great to use >>>>>>>>> it. Today the spec doesnt use observer returned values so it is mainly a >>>>>>>>> bad practise to have one even if not strictly forbidden - BTW never saw it >>>>>>>>> in real applications - plus spec is not compatible - not specified at all - >>>>>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>>>>> >>>>>>>>> This is quite interesting for few reasons: >>>>>>>>> 1- we have our double activation >>>>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>>>> signature) >>>>>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>>>>> with composition of these observers >>>>>>>>> >>>>>>>>> >>>>>>>>> Only point I'm not sure is should these observers support sync >>>>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>>>> something. >>>>>>>>> >>>>>>>>> >>>>>>>>> wdyt? >>>>>>>>> >>>>>>>>> >>>>>>>>> Romain Manni-Bucau >>>>>>>>> @rmannibucau | Blog >>>>>>>>> | Github >>>>>>>>> | LinkedIn >>>>>>>>> | Tomitriber >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> cdi-dev mailing list >>>>>>>>> cdi-dev at lists.jboss.org >>>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>>> >>>>>>>>> Note that for all code provided on this list, the provider >>>>>>>>> licenses the code under the Apache License, Version 2 ( >>>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>>> intellectual property rights inherent in such information. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>> >>>>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>> cdi-dev mailing list >>>>>> cdi-dev at lists.jboss.org >>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>> >>>>>> Note that for all code provided on this list, the provider licenses >>>>>> the code under the Apache License, Version 2 ( >>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>> ideas provided on this list, the provider waives all patent and other >>>>>> intellectual property rights inherent in such information. >>>>>> >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> cdi-dev mailing list >>>>> cdi-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> >>>>> Note that for all code provided on this list, the provider licenses >>>>> the code under the Apache License, Version 2 ( >>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>>> provided on this list, the provider waives all patent and other >>>>> intellectual property rights inherent in such information. >>>>> >>>> >>>> >>>> >>>> -- >>>> Java le soir Cours Java en ligne >>>> >>>> Twitter Paris JUG >>>> Devoxx France >>>> M : +33 6 76 82 91 47 >>>> >>> >>> >> >> >> -- >> Java le soir Cours Java en ligne >> >> Twitter Paris JUG >> Devoxx France >> M : +33 6 76 82 91 47 >> > > -- Java le soir Cours Java en ligne Twitter Paris JUG Devoxx France M : +33 6 76 82 91 47 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/1a2e0cea/attachment-0001.html From rmannibucau at gmail.com Wed Apr 1 16:25:20 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Wed, 1 Apr 2015 22:25:20 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: 2015-04-01 22:22 GMT+02:00 Jos? Paumard : > > > 2015-04-01 22:04 GMT+02:00 Romain Manni-Bucau : > >> >> >> 2015-04-01 21:46 GMT+02:00 Jos? Paumard : >> >>> > What's your proposal? EJB API is quite nice to use and it integrates >>> smoothly with Future<>, not sure I get what's your issue is here. >>> EJB has me to write this kind of code : >>> >>> return es.submit(myTask) ; >>> >>> >> this looks wrong, return new AsyncFuture("i did it"); is what you >> should have written otherwise you just didnt use EJB async feature. >> > > > Hmm I dont think so. If I write > return new AsyncResult("Done in thread " + > Thread.currentThread().getName()) ; // returns a Future > > Then my code is not async at all, the get() call will just return my > parameter, and no other thread will be used in that process. > if the method has @Asynchronous it is, that is how the spec is defined. All other usages are not linked to asynchronism at all and es.submit(task) is not supposed to work before EJB 3.2. > > If I write : > return new executorService.submit(() -> "Done in thread " + > Thread.currentThread().getName()}) ; > Then I get an async call. > > BTW if you check the source code of the AsyncResult class (with a nice > typo in it), its clearly written in it that it is not a real Future. > > Sure cause the container provides the async mecanism and this class is just here to make the impl trivial to do for user. > > >> >> >>> Because this is a synchronous call, that has to return a Future. But on >>> the other hand this is purely tehcnical code, that cant be put in the >>> framework, since one can call directly an EJB method. So the return type >>> has to be the one of the EJB method. >>> >>> With events the situation is different. On the calling side, I write >>> >>> completableFuture = event.fireAsync(payload) ; // type is >>> CompletionStage>> call> >>> >>> On the observing side I can write : >>> >>> public T observes(@Observes payload) { return t ; } >>> >>> And the framework will take care of wrapping this t in a >>> CompletableFuture.allOf(...) with all the other observers to return it. So >>> I dont have to deal myself with the technical aspects of calling ES myself. >>> IMHO it leads to easier to write patterns. >>> >> >> Why T then? And actually your explanation is my proposal but a on purpose >> typing. >> >> >>> >>> Jos? >>> >>> >>> >>> 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : >>> >>>> >>>> >>>> 2015-04-01 19:43 GMT+02:00 Jos? Paumard : >>>> >>>>> CompletionStage has a toCompletableFuture() method, that returns a >>>>> CompletableFuture. So there is no limitation in returning CompletionStage. >>>>> It could allow different implementation in the future than the only one we >>>>> have so far : CompletableFuture, since one can build a CompletableFuture >>>>> that wraps another implementation. >>>>> >>>>> >>>> +1, missed it >>>> >>>> >>>>> Problem with CF.allOf() and anyOf() is that they return resp. CF >>>>> and CF, which is not very API friendly. >>>>> >>>>> >>>> it is enough in enough cases IMO >>>> >>>> >>>>> Having the observers writers to provide his own implementation of >>>>> CompletableFuture is not that great imho. For the async EJB, all you can do >>>>> is return executorService.submit(myTask). I understand why the API >>>>> designers have chosen that, but I dont think it's that great. Correct me if >>>>> I'm wrong, but I think that we have the opportunity to move that burden >>>>> from the observers writers to the framework. And I think it would make the >>>>> API easier to use. >>>>> >>>>> >>>> What's your proposal? EJB API is quite nice to use and it integrates >>>> smoothly with Future<>, not sure I get what's your issue is here. >>>> >>>> >>>>> Jos? >>>>> >>>>> >>>>> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : >>>>> >>>>>> Hello Antoine, >>>>>> >>>>>> >>>>>> Romain Manni-Bucau >>>>>> @rmannibucau | Blog >>>>>> | Github >>>>>> | LinkedIn >>>>>> | Tomitriber >>>>>> >>>>>> >>>>>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand < >>>>>> antoine at sabot-durand.net>: >>>>>> >>>>>>> Hi Romain, >>>>>>> >>>>>>> Intersting proposal. As I felt reading you that we misse the >>>>>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>>>>> fireAsync signatures >>>>>>> >>>>>>> CompletionStage fireAsync(U event); >>>>>>> and >>>>>>> CompletionStage fireAsync(U event, Executor >>>>>>> executor); >>>>>>> >>>>>>> Yeah it?s CompletionStage because Jozef preferred using interfaces >>>>>>> in our API, but I guess implementation will use CompletableFuture under the >>>>>>> hood to avoid reinventing the wheel. >>>>>>> >>>>>>> >>>>>> This sounds "normal" but JVM doesn't follow it with its utility >>>>>> methods so basically today CompletionStage is super poor compared to >>>>>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>>>>> check what is the adoption of both in other framework, can validate or not >>>>>> my thought maybe. >>>>>> >>>>>> >>>>>>> With this approach your example: >>>>>>> >>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>> System.out.println("We did it!")); >>>>>>>> >>>>>>> >>>>>>> will work without adding constraint on observer signature. >>>>>>> >>>>>>> Regarding the observer part, we already discuss similar approach. In >>>>>>> a former version of my async event doc I proposed using return type on >>>>>>> observer to do discrimination between async and sync and Mark made a >>>>>>> suggestion near yours during this meeting: >>>>>>> >>>>>>> >>>>>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>>>>> >>>>>>> (search for the first ?signature? in text) >>>>>>> >>>>>>> The main drawback of this approach is to let end user generate the >>>>>>> returned CompletableFuture. So each async observer should provide a way to >>>>>>> construct this completableFuture. The second question is the type param of >>>>>>> the returned CompletableFuture. Should we use raw type? Now we could >>>>>>> imagine helped to do that but... >>>>>>> >>>>>>> >>>>>> Exactly why I think this is a better solution. Cause it opens the >>>>>> door to asynchronism in a more elegant manner handling completion properly. >>>>>> I guess first impl will use allOf() combination but I see anyOf() - i fire >>>>>> to "notifiers" and I care only of 1 at least being called as a caller - and >>>>>> potentially other combinations other potentials needs we could cover in >>>>>> another spec (hopefully). >>>>>> >>>>>> If async is just fire and forget we don't need fireAsync() but only >>>>>> fire() (void) and then observers are async or not which ensures compat at >>>>>> all levels since observers decide to be in the same context or not but I >>>>>> guess we don't want only fire and forget. >>>>>> >>>>>> About creating a CompletableFuture we can do as in EJB spec and >>>>>> provide version to use by observer impl (javax.ejb.AsyncResult). >>>>>> >>>>>> >>>>>>> Don?t get me wrong, I?d love to find a solution based on this kind >>>>>>> of idea, but I fear it will add more complexity than double activation. >>>>>>> >>>>>>> Antoine >>>>>>> >>>>>>> >>>>>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau >>>>>>> a ?crit : >>>>>>> >>>>>>> No, fireAsync is still needed for all the reason we mzntionned - >>>>>>> strongest one being the fact we need a return type and cant change fire - >>>>>>> but using the return type we have the double activation without introducing >>>>>>> a new API. Said otherwise API stays natural on both sides which was my main >>>>>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>>>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>>>>> interesting for the future. >>>>>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a >>>>>>> ?crit : >>>>>>> >>>>>>>> So instead of calling observers asynchronously you suggest turning >>>>>>>> observers into producers of CompletableFuture that will then be completed >>>>>>>> asynchronously? >>>>>>>> >>>>>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>>>>> >>>>>>>> // fire side >>>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>> System.out.println("We did it!")); >>>>>>>> >>>>>>>> // observer side >>>>>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>>>>> >>>>>>>> // impl behavior would be like >>>>>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>>>>> CompletableFuture behavior I think >>>>>>>> >>>>>>>> Am I clearer? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Romain Manni-Bucau >>>>>>>> @rmannibucau | Blog >>>>>>>> | Github >>>>>>>> | LinkedIn >>>>>>>> | Tomitriber >>>>>>>> >>>>>>>> >>>>>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt >>>>>>> >: >>>>>>>> >>>>>>>>> Hi Romain, >>>>>>>>> >>>>>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>>>>> look like. Could you give us an example? >>>>>>>>> >>>>>>>>> Afair CompletableFuture was considered to be used in the >>>>>>>>> "trigger" side in order to track async event invocation completion. >>>>>>>>> >>>>>>>>> br, Sven >>>>>>>>> >>>>>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau < >>>>>>>>> rmannibucau at gmail.com>: >>>>>>>>> >>>>>>>>>> Hi guys, >>>>>>>>>> >>>>>>>>>> on async topic if I followed we are at the point where we are >>>>>>>>>> looking for an activation on the observer side. >>>>>>>>>> >>>>>>>>>> Since Java 8 has now CompletableFuture it would be great to use >>>>>>>>>> it. Today the spec doesnt use observer returned values so it is mainly a >>>>>>>>>> bad practise to have one even if not strictly forbidden - BTW never saw it >>>>>>>>>> in real applications - plus spec is not compatible - not specified at all - >>>>>>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>>>>>> >>>>>>>>>> This is quite interesting for few reasons: >>>>>>>>>> 1- we have our double activation >>>>>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>>>>> signature) >>>>>>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>>>>>> with composition of these observers >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Only point I'm not sure is should these observers support sync >>>>>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>>>>> something. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> wdyt? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Romain Manni-Bucau >>>>>>>>>> @rmannibucau | Blog >>>>>>>>>> | Github >>>>>>>>>> | LinkedIn >>>>>>>>>> | Tomitriber >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> cdi-dev mailing list >>>>>>>>>> cdi-dev at lists.jboss.org >>>>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>>>> >>>>>>>>>> Note that for all code provided on this list, the provider >>>>>>>>>> licenses the code under the Apache License, Version 2 ( >>>>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>>>> intellectual property rights inherent in such information. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>> >>>>>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> cdi-dev mailing list >>>>>>> cdi-dev at lists.jboss.org >>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>> >>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>> the code under the Apache License, Version 2 ( >>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>> intellectual property rights inherent in such information. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> cdi-dev mailing list >>>>>> cdi-dev at lists.jboss.org >>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>> >>>>>> Note that for all code provided on this list, the provider licenses >>>>>> the code under the Apache License, Version 2 ( >>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>> ideas provided on this list, the provider waives all patent and other >>>>>> intellectual property rights inherent in such information. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Java le soir Cours Java en ligne >>>>> >>>>> Twitter Paris JUG >>>>> Devoxx France >>>>> M : +33 6 76 82 91 47 >>>>> >>>> >>>> >>> >>> >>> -- >>> Java le soir Cours Java en ligne >>> >>> Twitter Paris JUG >>> Devoxx France >>> M : +33 6 76 82 91 47 >>> >> >> > > > -- > Java le soir Cours Java en ligne > > Twitter Paris JUG > Devoxx France > M : +33 6 76 82 91 47 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/c5586f6d/attachment-0001.html From arjan.tijms at gmail.com Wed Apr 1 16:27:46 2015 From: arjan.tijms at gmail.com (arjan tijms) Date: Wed, 1 Apr 2015 22:27:46 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: Hi, On Wed, Apr 1, 2015 at 10:22 PM, Jos? Paumard wrote: > Hmm I dont think so. If I write > return new AsyncResult("Done in thread " + > Thread.currentThread().getName()) ; // returns a Future > > Then my code is not async at all, the get() call will just return my > parameter, and no other thread will be used in that process. > The method that returns that result has already been called in another thread. The AsyncResult type is just a wrapper to satisfy the return type. It's only there because in Java a method signature can't both return a Future to the caller while simultaneously being implemented as returning a T. > > If I write : > return new executorService.submit(() -> "Done in thread " + > Thread.currentThread().getName()}) ; > Then I get an async call. > > BTW if you check the source code of the AsyncResult class (with a nice > typo in it), its clearly written in it that it is not a real Future. > > > >> >> >>> Because this is a synchronous call, that has to return a Future. But on >>> the other hand this is purely tehcnical code, that cant be put in the >>> framework, since one can call directly an EJB method. So the return type >>> has to be the one of the EJB method. >>> >>> With events the situation is different. On the calling side, I write >>> >>> completableFuture = event.fireAsync(payload) ; // type is >>> CompletionStage>> call> >>> >>> On the observing side I can write : >>> >>> public T observes(@Observes payload) { return t ; } >>> >>> And the framework will take care of wrapping this t in a >>> CompletableFuture.allOf(...) with all the other observers to return it. So >>> I dont have to deal myself with the technical aspects of calling ES myself. >>> IMHO it leads to easier to write patterns. >>> >> >> Why T then? And actually your explanation is my proposal but a on purpose >> typing. >> >> >>> >>> Jos? >>> >>> >>> >>> 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : >>> >>>> >>>> >>>> 2015-04-01 19:43 GMT+02:00 Jos? Paumard : >>>> >>>>> CompletionStage has a toCompletableFuture() method, that returns a >>>>> CompletableFuture. So there is no limitation in returning CompletionStage. >>>>> It could allow different implementation in the future than the only one we >>>>> have so far : CompletableFuture, since one can build a CompletableFuture >>>>> that wraps another implementation. >>>>> >>>>> >>>> +1, missed it >>>> >>>> >>>>> Problem with CF.allOf() and anyOf() is that they return resp. CF >>>>> and CF, which is not very API friendly. >>>>> >>>>> >>>> it is enough in enough cases IMO >>>> >>>> >>>>> Having the observers writers to provide his own implementation of >>>>> CompletableFuture is not that great imho. For the async EJB, all you can do >>>>> is return executorService.submit(myTask). I understand why the API >>>>> designers have chosen that, but I dont think it's that great. Correct me if >>>>> I'm wrong, but I think that we have the opportunity to move that burden >>>>> from the observers writers to the framework. And I think it would make the >>>>> API easier to use. >>>>> >>>>> >>>> What's your proposal? EJB API is quite nice to use and it integrates >>>> smoothly with Future<>, not sure I get what's your issue is here. >>>> >>>> >>>>> Jos? >>>>> >>>>> >>>>> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau : >>>>> >>>>>> Hello Antoine, >>>>>> >>>>>> >>>>>> Romain Manni-Bucau >>>>>> @rmannibucau | Blog >>>>>> | Github >>>>>> | LinkedIn >>>>>> | Tomitriber >>>>>> >>>>>> >>>>>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand < >>>>>> antoine at sabot-durand.net>: >>>>>> >>>>>>> Hi Romain, >>>>>>> >>>>>>> Intersting proposal. As I felt reading you that we misse the >>>>>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>>>>> fireAsync signatures >>>>>>> >>>>>>> CompletionStage fireAsync(U event); >>>>>>> and >>>>>>> CompletionStage fireAsync(U event, Executor >>>>>>> executor); >>>>>>> >>>>>>> Yeah it?s CompletionStage because Jozef preferred using interfaces >>>>>>> in our API, but I guess implementation will use CompletableFuture under the >>>>>>> hood to avoid reinventing the wheel. >>>>>>> >>>>>>> >>>>>> This sounds "normal" but JVM doesn't follow it with its utility >>>>>> methods so basically today CompletionStage is super poor compared to >>>>>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>>>>> check what is the adoption of both in other framework, can validate or not >>>>>> my thought maybe. >>>>>> >>>>>> >>>>>>> With this approach your example: >>>>>>> >>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>> System.out.println("We did it!")); >>>>>>>> >>>>>>> >>>>>>> will work without adding constraint on observer signature. >>>>>>> >>>>>>> Regarding the observer part, we already discuss similar approach. In >>>>>>> a former version of my async event doc I proposed using return type on >>>>>>> observer to do discrimination between async and sync and Mark made a >>>>>>> suggestion near yours during this meeting: >>>>>>> >>>>>>> >>>>>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>>>>> >>>>>>> (search for the first ?signature? in text) >>>>>>> >>>>>>> The main drawback of this approach is to let end user generate the >>>>>>> returned CompletableFuture. So each async observer should provide a way to >>>>>>> construct this completableFuture. The second question is the type param of >>>>>>> the returned CompletableFuture. Should we use raw type? Now we could >>>>>>> imagine helped to do that but... >>>>>>> >>>>>>> >>>>>> Exactly why I think this is a better solution. Cause it opens the >>>>>> door to asynchronism in a more elegant manner handling completion properly. >>>>>> I guess first impl will use allOf() combination but I see anyOf() - i fire >>>>>> to "notifiers" and I care only of 1 at least being called as a caller - and >>>>>> potentially other combinations other potentials needs we could cover in >>>>>> another spec (hopefully). >>>>>> >>>>>> If async is just fire and forget we don't need fireAsync() but only >>>>>> fire() (void) and then observers are async or not which ensures compat at >>>>>> all levels since observers decide to be in the same context or not but I >>>>>> guess we don't want only fire and forget. >>>>>> >>>>>> About creating a CompletableFuture we can do as in EJB spec and >>>>>> provide version to use by observer impl (javax.ejb.AsyncResult). >>>>>> >>>>>> >>>>>>> Don?t get me wrong, I?d love to find a solution based on this kind >>>>>>> of idea, but I fear it will add more complexity than double activation. >>>>>>> >>>>>>> Antoine >>>>>>> >>>>>>> >>>>>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau >>>>>>> a ?crit : >>>>>>> >>>>>>> No, fireAsync is still needed for all the reason we mzntionned - >>>>>>> strongest one being the fact we need a return type and cant change fire - >>>>>>> but using the return type we have the double activation without introducing >>>>>>> a new API. Said otherwise API stays natural on both sides which was my main >>>>>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>>>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>>>>> interesting for the future. >>>>>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a >>>>>>> ?crit : >>>>>>> >>>>>>>> So instead of calling observers asynchronously you suggest turning >>>>>>>> observers into producers of CompletableFuture that will then be completed >>>>>>>> asynchronously? >>>>>>>> >>>>>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>>>>> >>>>>>>> // fire side >>>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>> System.out.println("We did it!")); >>>>>>>> >>>>>>>> // observer side >>>>>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>>>>> >>>>>>>> // impl behavior would be like >>>>>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>>>>> CompletableFuture behavior I think >>>>>>>> >>>>>>>> Am I clearer? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Romain Manni-Bucau >>>>>>>> @rmannibucau | Blog >>>>>>>> | Github >>>>>>>> | LinkedIn >>>>>>>> | Tomitriber >>>>>>>> >>>>>>>> >>>>>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt >>>>>>> >: >>>>>>>> >>>>>>>>> Hi Romain, >>>>>>>>> >>>>>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>>>>> look like. Could you give us an example? >>>>>>>>> >>>>>>>>> Afair CompletableFuture was considered to be used in the >>>>>>>>> "trigger" side in order to track async event invocation completion. >>>>>>>>> >>>>>>>>> br, Sven >>>>>>>>> >>>>>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau < >>>>>>>>> rmannibucau at gmail.com>: >>>>>>>>> >>>>>>>>>> Hi guys, >>>>>>>>>> >>>>>>>>>> on async topic if I followed we are at the point where we are >>>>>>>>>> looking for an activation on the observer side. >>>>>>>>>> >>>>>>>>>> Since Java 8 has now CompletableFuture it would be great to use >>>>>>>>>> it. Today the spec doesnt use observer returned values so it is mainly a >>>>>>>>>> bad practise to have one even if not strictly forbidden - BTW never saw it >>>>>>>>>> in real applications - plus spec is not compatible - not specified at all - >>>>>>>>>> with CompletableFuture since it is a new API so we can use it as a marker. >>>>>>>>>> >>>>>>>>>> This is quite interesting for few reasons: >>>>>>>>>> 1- we have our double activation >>>>>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>>>>> signature) >>>>>>>>>> 3- open door for future async enhancements (hopefully not in CDI) >>>>>>>>>> with composition of these observers >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Only point I'm not sure is should these observers support sync >>>>>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>>>>> something. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> wdyt? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Romain Manni-Bucau >>>>>>>>>> @rmannibucau | Blog >>>>>>>>>> | Github >>>>>>>>>> | LinkedIn >>>>>>>>>> | Tomitriber >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> cdi-dev mailing list >>>>>>>>>> cdi-dev at lists.jboss.org >>>>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>>>> >>>>>>>>>> Note that for all code provided on this list, the provider >>>>>>>>>> licenses the code under the Apache License, Version 2 ( >>>>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>>>> intellectual property rights inherent in such information. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>> >>>>>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>> cdi-dev mailing list >>>>>>> cdi-dev at lists.jboss.org >>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>> >>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>> the code under the Apache License, Version 2 ( >>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>> intellectual property rights inherent in such information. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> cdi-dev mailing list >>>>>> cdi-dev at lists.jboss.org >>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>> >>>>>> Note that for all code provided on this list, the provider licenses >>>>>> the code under the Apache License, Version 2 ( >>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>> ideas provided on this list, the provider waives all patent and other >>>>>> intellectual property rights inherent in such information. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Java le soir Cours Java en ligne >>>>> >>>>> Twitter Paris JUG >>>>> Devoxx France >>>>> M : +33 6 76 82 91 47 >>>>> >>>> >>>> >>> >>> >>> -- >>> Java le soir Cours Java en ligne >>> >>> Twitter Paris JUG >>> Devoxx France >>> M : +33 6 76 82 91 47 >>> >> >> > > > -- > Java le soir Cours Java en ligne > > Twitter Paris JUG > Devoxx France > M : +33 6 76 82 91 47 > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/836b277b/attachment-0001.html From arjan.tijms at gmail.com Wed Apr 1 16:36:56 2015 From: arjan.tijms at gmail.com (arjan tijms) Date: Wed, 1 Apr 2015 22:36:56 +0200 Subject: [cdi-dev] async activation on observers, why not CompletableFuture In-Reply-To: References: <551B94AF.4090208@redhat.com> <1FAA4B03-6FB4-4998-9B33-958AF477E612@sabot-durand.net> Message-ID: Hi, On Wed, Apr 1, 2015 at 10:25 PM, Romain Manni-Bucau wrote: > Hmm I dont think so. If I write >> return new AsyncResult("Done in thread " + >> Thread.currentThread().getName()) ; // returns a Future >> >> Then my code is not async at all, the get() call will just return my >> parameter, and no other thread will be used in that process. >> > > if the method has @Asynchronous it is, that is how the spec is defined. > All other usages are not linked to asynchronism at all and es.submit(task) > is not supposed to work before EJB 3.2. > Indeed. If you have: @Asynchronous public Future doAsync() { return new AsyncResult("Done in thread " + Thread.currentThread().getName()) ; } And then from another location do: String callerName = Thread.currentThread().getName(); String calleeName = bean.doAsync().get(); Then callerName is unequal to calleeName. I've written an article a while back that uses AsyncResult as well in CDI code that tries to emulate how EJB works. I hope it somewhat more clearly demonstrates that AsyncResult is fully intended as a wrapper. See http://jdevelopment.nl/cdi-based-asynchronous-alternative Kind regards, Arjan Tijms > > >> BTW if you check the source code of the AsyncResult class (with a nice >> typo in it), its clearly written in it that it is not a real Future. >> >> > Sure cause the container provides the async mecanism and this class is > just here to make the impl trivial to do for user. > > >> >> >>> >>> >>>> Because this is a synchronous call, that has to return a Future. But on >>>> the other hand this is purely tehcnical code, that cant be put in the >>>> framework, since one can call directly an EJB method. So the return type >>>> has to be the one of the EJB method. >>>> >>>> With events the situation is different. On the calling side, I write >>>> >>>> completableFuture = event.fireAsync(payload) ; // type is >>>> CompletionStage>>> call> >>>> >>>> On the observing side I can write : >>>> >>>> public T observes(@Observes payload) { return t ; } >>>> >>>> And the framework will take care of wrapping this t in a >>>> CompletableFuture.allOf(...) with all the other observers to return it. So >>>> I dont have to deal myself with the technical aspects of calling ES myself. >>>> IMHO it leads to easier to write patterns. >>>> >>> >>> Why T then? And actually your explanation is my proposal but a on >>> purpose typing. >>> >>> >>>> >>>> Jos? >>>> >>>> >>>> >>>> 2015-04-01 19:54 GMT+02:00 Romain Manni-Bucau : >>>> >>>>> >>>>> >>>>> 2015-04-01 19:43 GMT+02:00 Jos? Paumard : >>>>> >>>>>> CompletionStage has a toCompletableFuture() method, that returns a >>>>>> CompletableFuture. So there is no limitation in returning CompletionStage. >>>>>> It could allow different implementation in the future than the only one we >>>>>> have so far : CompletableFuture, since one can build a CompletableFuture >>>>>> that wraps another implementation. >>>>>> >>>>>> >>>>> +1, missed it >>>>> >>>>> >>>>>> Problem with CF.allOf() and anyOf() is that they return resp. >>>>>> CF and CF, which is not very API friendly. >>>>>> >>>>>> >>>>> it is enough in enough cases IMO >>>>> >>>>> >>>>>> Having the observers writers to provide his own implementation of >>>>>> CompletableFuture is not that great imho. For the async EJB, all you can do >>>>>> is return executorService.submit(myTask). I understand why the API >>>>>> designers have chosen that, but I dont think it's that great. Correct me if >>>>>> I'm wrong, but I think that we have the opportunity to move that burden >>>>>> from the observers writers to the framework. And I think it would make the >>>>>> API easier to use. >>>>>> >>>>>> >>>>> What's your proposal? EJB API is quite nice to use and it integrates >>>>> smoothly with Future<>, not sure I get what's your issue is here. >>>>> >>>>> >>>>>> Jos? >>>>>> >>>>>> >>>>>> 2015-04-01 10:08 GMT+02:00 Romain Manni-Bucau >>>>>> : >>>>>> >>>>>>> Hello Antoine, >>>>>>> >>>>>>> >>>>>>> Romain Manni-Bucau >>>>>>> @rmannibucau | Blog >>>>>>> | Github >>>>>>> | LinkedIn >>>>>>> | Tomitriber >>>>>>> >>>>>>> >>>>>>> 2015-04-01 9:55 GMT+02:00 Antoine Sabot-Durand < >>>>>>> antoine at sabot-durand.net>: >>>>>>> >>>>>>>> Hi Romain, >>>>>>>> >>>>>>>> Intersting proposal. As I felt reading you that we misse the >>>>>>>> CompletableFuture stuff in Java 8, I just repeat here that the agreed on >>>>>>>> fireAsync signatures >>>>>>>> >>>>>>>> CompletionStage fireAsync(U event); >>>>>>>> and >>>>>>>> CompletionStage fireAsync(U event, Executor >>>>>>>> executor); >>>>>>>> >>>>>>>> Yeah it?s CompletionStage because Jozef preferred using interfaces >>>>>>>> in our API, but I guess implementation will use CompletableFuture under the >>>>>>>> hood to avoid reinventing the wheel. >>>>>>>> >>>>>>>> >>>>>>> This sounds "normal" but JVM doesn't follow it with its utility >>>>>>> methods so basically today CompletionStage is super poor compared to >>>>>>> CompletionFuture so I'm tempted to say the impl is preferred here. I didn't >>>>>>> check what is the adoption of both in other framework, can validate or not >>>>>>> my thought maybe. >>>>>>> >>>>>>> >>>>>>>> With this approach your example: >>>>>>>> >>>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>>> System.out.println("We did it!")); >>>>>>>>> >>>>>>>> >>>>>>>> will work without adding constraint on observer signature. >>>>>>>> >>>>>>>> Regarding the observer part, we already discuss similar approach. >>>>>>>> In a former version of my async event doc I proposed using return type on >>>>>>>> observer to do discrimination between async and sync and Mark made a >>>>>>>> suggestion near yours during this meeting: >>>>>>>> >>>>>>>> >>>>>>>> http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-02-25-17.06.log.html >>>>>>>> >>>>>>>> (search for the first ?signature? in text) >>>>>>>> >>>>>>>> The main drawback of this approach is to let end user generate the >>>>>>>> returned CompletableFuture. So each async observer should provide a way to >>>>>>>> construct this completableFuture. The second question is the type param of >>>>>>>> the returned CompletableFuture. Should we use raw type? Now we could >>>>>>>> imagine helped to do that but... >>>>>>>> >>>>>>>> >>>>>>> Exactly why I think this is a better solution. Cause it opens the >>>>>>> door to asynchronism in a more elegant manner handling completion properly. >>>>>>> I guess first impl will use allOf() combination but I see anyOf() - i fire >>>>>>> to "notifiers" and I care only of 1 at least being called as a caller - and >>>>>>> potentially other combinations other potentials needs we could cover in >>>>>>> another spec (hopefully). >>>>>>> >>>>>>> If async is just fire and forget we don't need fireAsync() but only >>>>>>> fire() (void) and then observers are async or not which ensures compat at >>>>>>> all levels since observers decide to be in the same context or not but I >>>>>>> guess we don't want only fire and forget. >>>>>>> >>>>>>> About creating a CompletableFuture we can do as in EJB spec and >>>>>>> provide version to use by observer impl (javax.ejb.AsyncResult). >>>>>>> >>>>>>> >>>>>>>> Don?t get me wrong, I?d love to find a solution based on this kind >>>>>>>> of idea, but I fear it will add more complexity than double activation. >>>>>>>> >>>>>>>> Antoine >>>>>>>> >>>>>>>> >>>>>>>> Le 1 avr. 2015 ? 09:15, Romain Manni-Bucau >>>>>>>> a ?crit : >>>>>>>> >>>>>>>> No, fireAsync is still needed for all the reason we mzntionned - >>>>>>>> strongest one being the fact we need a return type and cant change fire - >>>>>>>> but using the return type we have the double activation without introducing >>>>>>>> a new API. Said otherwise API stays natural on both sides which was my main >>>>>>>> fear with a fireAsync and an @ObservesAsync (or any other new api we talked >>>>>>>> about). And we have the bonus to be aligned on SE async which sounds quite >>>>>>>> interesting for the future. >>>>>>>> Le 1 avr. 2015 08:48, "Jozef Hartinger" a >>>>>>>> ?crit : >>>>>>>> >>>>>>>>> So instead of calling observers asynchronously you suggest >>>>>>>>> turning observers into producers of CompletableFuture that will then be >>>>>>>>> completed asynchronously? >>>>>>>>> >>>>>>>>> On 03/31/2015 06:21 PM, Romain Manni-Bucau wrote: >>>>>>>>> >>>>>>>>> // fire side >>>>>>>>> event.fireAsync(new LetTheWorldKnow()).thenRun(() -> >>>>>>>>> System.out.println("We did it!")); >>>>>>>>> >>>>>>>>> // observer side >>>>>>>>> CompletableFuture iWantToKnow(@Observes LetTheWorldKnow event) {} >>>>>>>>> >>>>>>>>> // impl behavior would be like >>>>>>>>> CompletableFuture.allOf(allObserverReturnedInstances) to be aligned on >>>>>>>>> CompletableFuture behavior I think >>>>>>>>> >>>>>>>>> Am I clearer? >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Romain Manni-Bucau >>>>>>>>> @rmannibucau | Blog >>>>>>>>> | Github >>>>>>>>> | LinkedIn >>>>>>>>> | Tomitriber >>>>>>>>> >>>>>>>>> >>>>>>>>> 2015-03-31 18:15 GMT+02:00 Sven Linstaedt < >>>>>>>>> sven.linstaedt at gmail.com>: >>>>>>>>> >>>>>>>>>> Hi Romain, >>>>>>>>>> >>>>>>>>>> I am not sure, I have fully understand how an observer with CompletableFuture could >>>>>>>>>> look like. Could you give us an example? >>>>>>>>>> >>>>>>>>>> Afair CompletableFuture was considered to be used in the >>>>>>>>>> "trigger" side in order to track async event invocation completion. >>>>>>>>>> >>>>>>>>>> br, Sven >>>>>>>>>> >>>>>>>>>> 2015-03-31 18:00 GMT+02:00 Romain Manni-Bucau < >>>>>>>>>> rmannibucau at gmail.com>: >>>>>>>>>> >>>>>>>>>>> Hi guys, >>>>>>>>>>> >>>>>>>>>>> on async topic if I followed we are at the point where we are >>>>>>>>>>> looking for an activation on the observer side. >>>>>>>>>>> >>>>>>>>>>> Since Java 8 has now CompletableFuture it would be great to >>>>>>>>>>> use it. Today the spec doesnt use observer returned values so it is mainly >>>>>>>>>>> a bad practise to have one even if not strictly forbidden - BTW never saw >>>>>>>>>>> it in real applications - plus spec is not compatible - not specified at >>>>>>>>>>> all - with CompletableFuture since it is a new API so we can use it as a >>>>>>>>>>> marker. >>>>>>>>>>> >>>>>>>>>>> This is quite interesting for few reasons: >>>>>>>>>>> 1- we have our double activation >>>>>>>>>>> 2- API is user friendly (observer is async and has an async >>>>>>>>>>> signature) >>>>>>>>>>> 3- open door for future async enhancements (hopefully not in >>>>>>>>>>> CDI) with composition of these observers >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Only point I'm not sure is should these observers support sync >>>>>>>>>>> events. I don't see anything blocking to do it but can have missed >>>>>>>>>>> something. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> wdyt? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Romain Manni-Bucau >>>>>>>>>>> @rmannibucau | Blog >>>>>>>>>>> | Github >>>>>>>>>>> | LinkedIn >>>>>>>>>>> | Tomitriber >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> cdi-dev mailing list >>>>>>>>>>> cdi-dev at lists.jboss.org >>>>>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>>>>> >>>>>>>>>>> Note that for all code provided on this list, the provider >>>>>>>>>>> licenses the code under the Apache License, Version 2 ( >>>>>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>>>>> intellectual property rights inherent in such information. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>>> >>>>>>>>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>> cdi-dev mailing list >>>>>>>> cdi-dev at lists.jboss.org >>>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>>> >>>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>>> the code under the Apache License, Version 2 ( >>>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>>> intellectual property rights inherent in such information. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> cdi-dev mailing list >>>>>>> cdi-dev at lists.jboss.org >>>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>>>> >>>>>>> Note that for all code provided on this list, the provider licenses >>>>>>> the code under the Apache License, Version 2 ( >>>>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>>>> ideas provided on this list, the provider waives all patent and other >>>>>>> intellectual property rights inherent in such information. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Java le soir Cours Java en ligne >>>>>> >>>>>> Twitter Paris JUG >>>>>> Devoxx France >>>>>> M : +33 6 76 82 91 47 >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Java le soir Cours Java en ligne >>>> >>>> Twitter Paris JUG >>>> Devoxx France >>>> M : +33 6 76 82 91 47 >>>> >>> >>> >> >> >> -- >> Java le soir Cours Java en ligne >> >> Twitter Paris JUG >> Devoxx France >> M : +33 6 76 82 91 47 >> > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150401/31a4d6e3/attachment-0001.html From antoine at sabot-durand.net Tue Apr 7 08:53:22 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Tue, 7 Apr 2015 14:53:22 +0200 Subject: [cdi-dev] No meeting today Message-ID: Hi all, I?ll be on Devoxx France rehearsal today (giving a 3 hrs university tomorrow) and won?t be available for the meeting. See you next week Antoine -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150407/95cc5f91/attachment.bin From issues at jboss.org Thu Apr 9 05:18:18 2015 From: issues at jboss.org (Martin Kouba (JIRA)) Date: Thu, 9 Apr 2015 05:18:18 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-519) Instance.destroy() cannot be used for dependent bean instances not created by the same Instance object In-Reply-To: References: Message-ID: Martin Kouba created CDI-519: -------------------------------- Summary: Instance.destroy() cannot be used for dependent bean instances not created by the same Instance object Key: CDI-519 URL: https://issues.jboss.org/browse/CDI-519 Project: CDI Specification Issues Issue Type: Clarification Affects Versions: 1.2.Final Reporter: Martin Kouba 5.6.1. The Instance interface: {quote} The method destroy() instructs the container to destroy the instance. The bean instance passed to destroy() should be *a dependent scoped bean instance*, or... {quote} I think this should be more obvious. E.g. this wouldn't work correctly even though it doesn't violate the spec: {code:java} @Dependent class Bar { } class Foo { @Inject Instance instance; void ping() { instance.destroy(CDI.current().select(Bar.class).get()); } } {code} -- This message was sent by Atlassian JIRA (v6.3.11#6341) From christian at kaltepoth.de Tue Apr 14 00:13:01 2015 From: christian at kaltepoth.de (Christian Kaltepoth) Date: Tue, 14 Apr 2015 06:13:01 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers Message-ID: Hey all, I've a question regarding specializing qualified producer methods. It would be great to get your opinion on this. Imaging this producer method: public class MyProducer { @Produces @MyQualifier public Something produce() { // ... } } Now imagine the producer method is specialized like this: public class MyExtendedProducer extends MyProducer { @Override @Produces @Specializes public Something produce() { // ... } } Please not that I NOT added @MyQualifier to the specializing producer method. Now for this injection point: @Inject @MyQualifier private Something something; What is expected to happen according to the spec? Will the specialized producer be used or not? Thanks Christian -- Christian Kaltepoth Blog: http://blog.kaltepoth.de/ Twitter: http://twitter.com/chkal GitHub: https://github.com/chkal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/023eaca3/attachment.html From jharting at redhat.com Tue Apr 14 02:26:11 2015 From: jharting at redhat.com (Jozef Hartinger) Date: Tue, 14 Apr 2015 08:26:11 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers In-Reply-To: References: Message-ID: <552CB303.1080904@redhat.com> Hi Christian, yes, the specializing producer inherits all the qualifiers of the specialized producer. Furthermore, if the specialized producer had defined a name, this would have been inherited as well (even without explicit declaration on MyExtendedProducer.produce()). See http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization for details. Jozef On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: > Hey all, > > I've a question regarding specializing qualified producer methods. It > would be great to get your opinion on this. > > Imaging this producer method: > > public class MyProducer { > @Produces > @MyQualifier > public Something produce() { > // ... > } > } > > Now imagine the producer method is specialized like this: > > public class MyExtendedProducer extends MyProducer { > @Override > @Produces > @Specializes > public Something produce() { > // ... > } > } > > Please not that I NOT added @MyQualifier to the specializing producer > method. > > Now for this injection point: > > @Inject > @MyQualifier > private Something something; > > What is expected to happen according to the spec? Will the specialized > producer be used or not? > > Thanks > > Christian > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/25b037a6/attachment.html From christian at kaltepoth.de Tue Apr 14 02:55:39 2015 From: christian at kaltepoth.de (Christian Kaltepoth) Date: Tue, 14 Apr 2015 08:55:39 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers In-Reply-To: <552CB303.1080904@redhat.com> References: <552CB303.1080904@redhat.com> Message-ID: Hi Jozef, thanks a lot for your response. So if I read this correctly, the qualifier doesn't need to be annotated with @Inherited for this behavior. Is that correct? Christian 2015-04-14 8:26 GMT+02:00 Jozef Hartinger : > Hi Christian, > > yes, the specializing producer inherits all the qualifiers of the > specialized producer. Furthermore, if the specialized producer had defined > a name, this would have been inherited as well (even without explicit > declaration on MyExtendedProducer.produce()). See > http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization > for details. > > Jozef > > > On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: > > Hey all, > > I've a question regarding specializing qualified producer methods. It > would be great to get your opinion on this. > > Imaging this producer method: > > public class MyProducer { > @Produces > @MyQualifier > public Something produce() { > // ... > } > } > > Now imagine the producer method is specialized like this: > > public class MyExtendedProducer extends MyProducer { > @Override > @Produces > @Specializes > public Something produce() { > // ... > } > } > > Please not that I NOT added @MyQualifier to the specializing producer > method. > > Now for this injection point: > > @Inject > @MyQualifier > private Something something; > > What is expected to happen according to the spec? Will the specialized > producer be used or not? > > Thanks > > Christian > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > > > > _______________________________________________ > cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > -- Christian Kaltepoth Blog: http://blog.kaltepoth.de/ Twitter: http://twitter.com/chkal GitHub: https://github.com/chkal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/289a422b/attachment-0001.html From jharting at redhat.com Tue Apr 14 02:57:05 2015 From: jharting at redhat.com (Jozef Hartinger) Date: Tue, 14 Apr 2015 08:57:05 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers In-Reply-To: References: <552CB303.1080904@redhat.com> Message-ID: <552CBA41.40001@redhat.com> Correct On 04/14/2015 08:55 AM, Christian Kaltepoth wrote: > Hi Jozef, > > thanks a lot for your response. So if I read this correctly, the > qualifier doesn't need to be annotated with @Inherited for this > behavior. Is that correct? > > Christian > > > 2015-04-14 8:26 GMT+02:00 Jozef Hartinger >: > > Hi Christian, > > yes, the specializing producer inherits all the qualifiers of the > specialized producer. Furthermore, if the specialized producer had > defined a name, this would have been inherited as well (even > without explicit declaration on MyExtendedProducer.produce()). See > http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization > for details. > > Jozef > > > On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: >> Hey all, >> >> I've a question regarding specializing qualified producer >> methods. It would be great to get your opinion on this. >> >> Imaging this producer method: >> >> public class MyProducer { >> @Produces >> @MyQualifier >> public Something produce() { >> // ... >> } >> } >> >> Now imagine the producer method is specialized like this: >> >> public class MyExtendedProducer extends MyProducer { >> @Override >> @Produces >> @Specializes >> public Something produce() { >> // ... >> } >> } >> >> Please not that I NOT added @MyQualifier to the specializing >> producer method. >> >> Now for this injection point: >> >> @Inject >> @MyQualifier >> private Something something; >> >> What is expected to happen according to the spec? Will the >> specialized producer be used or not? >> >> Thanks >> >> Christian >> >> >> -- >> Christian Kaltepoth >> Blog: http://blog.kaltepoth.de/ >> Twitter: http://twitter.com/chkal >> GitHub: https://github.com/chkal >> >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/1b32cdf1/attachment.html From christian at kaltepoth.de Tue Apr 14 04:24:16 2015 From: christian at kaltepoth.de (Christian Kaltepoth) Date: Tue, 14 Apr 2015 10:24:16 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers In-Reply-To: <552CBA41.40001@redhat.com> References: <552CB303.1080904@redhat.com> <552CBA41.40001@redhat.com> Message-ID: Awesome! Thanks a lot! Christian 2015-04-14 8:57 GMT+02:00 Jozef Hartinger : > Correct > > > On 04/14/2015 08:55 AM, Christian Kaltepoth wrote: > > Hi Jozef, > > thanks a lot for your response. So if I read this correctly, the qualifier > doesn't need to be annotated with @Inherited for this behavior. Is that > correct? > > Christian > > > 2015-04-14 8:26 GMT+02:00 Jozef Hartinger : > >> Hi Christian, >> >> yes, the specializing producer inherits all the qualifiers of the >> specialized producer. Furthermore, if the specialized producer had defined >> a name, this would have been inherited as well (even without explicit >> declaration on MyExtendedProducer.produce()). See >> http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization >> for details. >> >> Jozef >> >> >> On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: >> >> Hey all, >> >> I've a question regarding specializing qualified producer methods. It >> would be great to get your opinion on this. >> >> Imaging this producer method: >> >> public class MyProducer { >> @Produces >> @MyQualifier >> public Something produce() { >> // ... >> } >> } >> >> Now imagine the producer method is specialized like this: >> >> public class MyExtendedProducer extends MyProducer { >> @Override >> @Produces >> @Specializes >> public Something produce() { >> // ... >> } >> } >> >> Please not that I NOT added @MyQualifier to the specializing producer >> method. >> >> Now for this injection point: >> >> @Inject >> @MyQualifier >> private Something something; >> >> What is expected to happen according to the spec? Will the specialized >> producer be used or not? >> >> Thanks >> >> Christian >> >> >> -- >> Christian Kaltepoth >> Blog: http://blog.kaltepoth.de/ >> Twitter: http://twitter.com/chkal >> GitHub: https://github.com/chkal >> >> >> >> _______________________________________________ >> cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >> >> >> > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > > > -- Christian Kaltepoth Blog: http://blog.kaltepoth.de/ Twitter: http://twitter.com/chkal GitHub: https://github.com/chkal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/5774582a/attachment.html From werner.keil at gmail.com Tue Apr 14 04:52:20 2015 From: werner.keil at gmail.com (Werner Keil) Date: Tue, 14 Apr 2015 10:52:20 +0200 Subject: [cdi-dev] Specializing producer methods & qualifiers Message-ID: Christian, Here's a case that matches your @MyQualifier question in Agorava: https://github.com/agorava/agorava-socializer/blob/develop/src/main/java/org/agorava/socializer/LinkedInController.java uses: @Inject @LinkedInprivate NetworkUpdateService updateService; This is the @LinkedIn "MyQualifier" https://github.com/agorava/agorava-linkedin/blob/develop/agorava-linkedin-api/src/main/java/org/agorava/linkedin/LinkedIn.java It uses a Meta-annotation @ProviderRelated https://github.com/agorava/agorava-core/blob/develop/agorava-core-api/src/main/java/org/agorava/api/atinject/ProviderRelated.java to declare the service provider (like "LinkedIn" or others) but no @Inherited. @Antoine, good luck with the tutorial at DevoXX France and CU soon, Werner On Tue, Apr 14, 2015 at 8:55 AM, wrote: > Send cdi-dev mailing list submissions to > cdi-dev at lists.jboss.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.jboss.org/mailman/listinfo/cdi-dev > or, via email, send a message with subject or body 'help' to > cdi-dev-request at lists.jboss.org > > You can reach the person managing the list at > cdi-dev-owner at lists.jboss.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of cdi-dev digest..." > > > Today's Topics: > > 1. No meeting today (Antoine Sabot-Durand) > 2. [JBoss JIRA] (CDI-519) Instance.destroy() cannot be used for > dependent bean instances not created by the same Instance object > (Martin Kouba (JIRA)) > 3. Specializing producer methods & qualifiers (Christian Kaltepoth) > 4. Re: Specializing producer methods & qualifiers (Jozef Hartinger) > 5. Re: Specializing producer methods & qualifiers > (Christian Kaltepoth) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 7 Apr 2015 14:53:22 +0200 > From: Antoine Sabot-Durand > Subject: [cdi-dev] No meeting today > To: cdi-dev > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi all, > > > I?ll be on Devoxx France rehearsal today (giving a 3 hrs university > tomorrow) and won?t be available for the meeting. > > See you next week > > Antoine > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: signature.asc > Type: application/pgp-signature > Size: 495 bytes > Desc: Message signed with OpenPGP using GPGMail > Url : > http://lists.jboss.org/pipermail/cdi-dev/attachments/20150407/95cc5f91/attachment-0001.bin > > ------------------------------ > > Message: 2 > Date: Thu, 9 Apr 2015 05:18:18 -0400 (EDT) > From: "Martin Kouba (JIRA)" > Subject: [cdi-dev] [JBoss JIRA] (CDI-519) Instance.destroy() cannot be > used for dependent bean instances not created by the same Instance > object > To: cdi-dev at lists.jboss.org > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > Martin Kouba created CDI-519: > -------------------------------- > > Summary: Instance.destroy() cannot be used for dependent bean > instances not created by the same Instance object > Key: CDI-519 > URL: https://issues.jboss.org/browse/CDI-519 > Project: CDI Specification Issues > Issue Type: Clarification > Affects Versions: 1.2.Final > Reporter: Martin Kouba > > > 5.6.1. The Instance interface: > {quote} > The method destroy() instructs the container to destroy the instance. The > bean instance passed to destroy() should be *a dependent scoped bean > instance*, or... > {quote} > > I think this should be more obvious. E.g. this wouldn't work correctly > even though it doesn't violate the spec: > {code:java} > @Dependent > class Bar { > } > class Foo { > @Inject > Instance instance; > void ping() { > instance.destroy(CDI.current().select(Bar.class).get()); > } > } > {code} > > > > -- > This message was sent by Atlassian JIRA > (v6.3.11#6341) > > > ------------------------------ > > Message: 3 > Date: Tue, 14 Apr 2015 06:13:01 +0200 > From: Christian Kaltepoth > Subject: [cdi-dev] Specializing producer methods & qualifiers > To: cdi-dev at lists.jboss.org > Message-ID: > < > CAEXeC6yYV-NmJ35M0v8d8icjtM57Zw20EuF92Bq2jVc80EPpzQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hey all, > > I've a question regarding specializing qualified producer methods. It would > be great to get your opinion on this. > > Imaging this producer method: > > public class MyProducer { > @Produces > @MyQualifier > public Something produce() { > // ... > } > } > > Now imagine the producer method is specialized like this: > > public class MyExtendedProducer extends MyProducer { > @Override > @Produces > @Specializes > public Something produce() { > // ... > } > } > > Please not that I NOT added @MyQualifier to the specializing producer > method. > > Now for this injection point: > > @Inject > @MyQualifier > private Something something; > > What is expected to happen according to the spec? Will the specialized > producer be used or not? > > Thanks > > Christian > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/023eaca3/attachment-0001.html > > ------------------------------ > > Message: 4 > Date: Tue, 14 Apr 2015 08:26:11 +0200 > From: Jozef Hartinger > Subject: Re: [cdi-dev] Specializing producer methods & qualifiers > To: Christian Kaltepoth , > cdi-dev at lists.jboss.org > Message-ID: <552CB303.1080904 at redhat.com> > Content-Type: text/plain; charset="windows-1252" > > Hi Christian, > > yes, the specializing producer inherits all the qualifiers of the > specialized producer. Furthermore, if the specialized producer had > defined a name, this would have been inherited as well (even without > explicit declaration on MyExtendedProducer.produce()). See > > http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization > for details. > > Jozef > > On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: > > Hey all, > > > > I've a question regarding specializing qualified producer methods. It > > would be great to get your opinion on this. > > > > Imaging this producer method: > > > > public class MyProducer { > > @Produces > > @MyQualifier > > public Something produce() { > > // ... > > } > > } > > > > Now imagine the producer method is specialized like this: > > > > public class MyExtendedProducer extends MyProducer { > > @Override > > @Produces > > @Specializes > > public Something produce() { > > // ... > > } > > } > > > > Please not that I NOT added @MyQualifier to the specializing producer > > method. > > > > Now for this injection point: > > > > @Inject > > @MyQualifier > > private Something something; > > > > What is expected to happen according to the spec? Will the specialized > > producer be used or not? > > > > Thanks > > > > Christian > > > > > > -- > > Christian Kaltepoth > > Blog: http://blog.kaltepoth.de/ > > Twitter: http://twitter.com/chkal > > GitHub: https://github.com/chkal > > > > > > > > _______________________________________________ > > cdi-dev mailing list > > cdi-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/cdi-dev > > > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/25b037a6/attachment-0001.html > > ------------------------------ > > Message: 5 > Date: Tue, 14 Apr 2015 08:55:39 +0200 > From: Christian Kaltepoth > Subject: Re: [cdi-dev] Specializing producer methods & qualifiers > To: Jozef Hartinger > Cc: cdi-dev at lists.jboss.org > Message-ID: > rm2rfg5HDap8Aw7anV9jfatSioEhbckpabuGA at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Jozef, > > thanks a lot for your response. So if I read this correctly, the qualifier > doesn't need to be annotated with @Inherited for this behavior. Is that > correct? > > Christian > > > 2015-04-14 8:26 GMT+02:00 Jozef Hartinger : > > > Hi Christian, > > > > yes, the specializing producer inherits all the qualifiers of the > > specialized producer. Furthermore, if the specialized producer had > defined > > a name, this would have been inherited as well (even without explicit > > declaration on MyExtendedProducer.produce()). See > > > http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#direct_and_indirect_specialization > > for details. > > > > Jozef > > > > > > On 04/14/2015 06:13 AM, Christian Kaltepoth wrote: > > > > Hey all, > > > > I've a question regarding specializing qualified producer methods. It > > would be great to get your opinion on this. > > > > Imaging this producer method: > > > > public class MyProducer { > > @Produces > > @MyQualifier > > public Something produce() { > > // ... > > } > > } > > > > Now imagine the producer method is specialized like this: > > > > public class MyExtendedProducer extends MyProducer { > > @Override > > @Produces > > @Specializes > > public Something produce() { > > // ... > > } > > } > > > > Please not that I NOT added @MyQualifier to the specializing producer > > method. > > > > Now for this injection point: > > > > @Inject > > @MyQualifier > > private Something something; > > > > What is expected to happen according to the spec? Will the specialized > > producer be used or not? > > > > Thanks > > > > Christian > > > > > > -- > > Christian Kaltepoth > > Blog: http://blog.kaltepoth.de/ > > Twitter: http://twitter.com/chkal > > GitHub: https://github.com/chkal > > > > > > > > _______________________________________________ > > cdi-dev mailing listcdi-dev at lists.jboss.orghttps:// > lists.jboss.org/mailman/listinfo/cdi-dev > > > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > > > > > > > > -- > Christian Kaltepoth > Blog: http://blog.kaltepoth.de/ > Twitter: http://twitter.com/chkal > GitHub: https://github.com/chkal > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/289a422b/attachment.html > > ------------------------------ > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > End of cdi-dev Digest, Vol 53, Issue 11 > *************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/b31a3d28/attachment-0001.html From issues at jboss.org Tue Apr 14 07:24:19 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Tue, 14 Apr 2015 07:24:19 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-160) Split specification into "core" and "Java EE integration" In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on CDI-160 started by Antoine Sabot-Durand. ------------------------------------------------ > Split specification into "core" and "Java EE integration" > --------------------------------------------------------- > > Key: CDI-160 > URL: https://issues.jboss.org/browse/CDI-160 > Project: CDI Specification Issues > Issue Type: Feature Request > Affects Versions: 1.0 > Reporter: Pete Muir > Assignee: Antoine Sabot-Durand > Priority: Critical > Fix For: 2.0 (proposed) > > > In order to better support implementations of CDI such as Weld SE, Errai, and OpenWebBeans which are currently not certifiable by JSR-299 (as they don't implement any of the Java EE integrations) we should split the spec into core and Java EE integrations, and offer two modes within the TCK as well. -- This message was sent by Atlassian JIRA (v6.3.11#6341) From antoine at sabot-durand.net Tue Apr 14 08:24:01 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Tue, 14 Apr 2015 14:24:01 +0200 Subject: [cdi-dev] Java SE / EE split, link to the generated spec Message-ID: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> Hi all, After a lot of do, undo, redo, I sent, this morning, a PR containing a first draft of this split. To give an idea of the final result, the generated spec doc is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html The goal of this splitting is to have an EJB free version of the spec to provide an official Java SE support for CDI. It?s also the 1st step to introduce parts in the spec, should we decide to do it. Thanks for your feedback, here, in the pull request or in the corresponding Jira ticket : https://issues.jboss.org/browse/CDI-160 Antoine -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/22a28983/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150414/22a28983/attachment.bin From issues at jboss.org Tue Apr 14 09:58:23 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Tue, 14 Apr 2015 09:58:23 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-4) Need a way to provide ordering for Event observers In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-4?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand reassigned CDI-4: -------------------------------------- Assignee: Antoine Sabot-Durand (was: Pete Muir) > Need a way to provide ordering for Event observers > -------------------------------------------------- > > Key: CDI-4 > URL: https://issues.jboss.org/browse/CDI-4 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Events, Portable Extensions > Affects Versions: 1.0 > Environment: All > Reporter: Lincoln Baxter III > Assignee: Antoine Sabot-Durand > Fix For: 2.0 (discussion) > > > There needs to be a way to specify some kind of ordering for Event observers. > Understandably, this is somewhat counter-intuitive to the general concept of observing an event, but there is going to be need for this in an upcoming JBoss project. While it can be done manually, it might be nice to have a built-in API. -- This message was sent by Atlassian JIRA (v6.3.11#6341) From tremes at redhat.com Wed Apr 15 05:41:48 2015 From: tremes at redhat.com (Tomas Remes) Date: Wed, 15 Apr 2015 05:41:48 -0400 (EDT) Subject: [cdi-dev] Java SE / EE split, link to the generated spec In-Reply-To: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> References: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> Message-ID: <473949953.36952.1429090908470.JavaMail.zimbra@redhat.com> Hi Antoine, I quickly went through the new spec html and here follows my questions/suggestions/clarifications which I have discovered so far: - chapter 1.4 and 1.4.1 - do we want to describe servlets, EJBs here? And in general do we want to mention @SessionScoped and @RequestScoped in SE? - chapter 1.8.3 - briefly mention MVC and JSF (not a big issue) - chapter 1.9 - does it make sense in SE to talk about DeploymentProblems? - chapter 5.7 and all its subchapters - this needs revision IMHO (probably next step?) T. ----- Original Message ----- From: "Antoine Sabot-Durand" To: "cdi-dev" Sent: Tuesday, April 14, 2015 2:24:01 PM Subject: [cdi-dev] Java SE / EE split, link to the generated spec Hi all, After a lot of do, undo, redo, I sent, this morning, a PR containing a first draft of this split. To give an idea of the final result, the generated spec doc is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html The goal of this splitting is to have an EJB free version of the spec to provide an official Java SE support for CDI. It?s also the 1st step to introduce parts in the spec, should we decide to do it. Thanks for your feedback, here, in the pull request or in the corresponding Jira ticket : https://issues.jboss.org/browse/CDI-160 Antoine _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From antoine at sabot-durand.net Wed Apr 15 08:31:40 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Wed, 15 Apr 2015 14:31:40 +0200 Subject: [cdi-dev] More about SE/EE splitting Message-ID: Hi all, Rethinking of this task and reading the feedback on this, I really think we should go step by step on this splitting. What I have produced here is a full extraction of EJB in the spec to put it in EE part. There are still Java EE references in core with EL, JSF, Servlet. The more problematic part is the Contexts chapter: hard to remove servlet ref without rewriting all... And yes, I did some rewording that could be no very nice. In some places I replaces "Managed Beans or Session Beans" by the generic term "bean". Java EE component was replaced by component (yes, I'm not sure it is very meaningful) In the EE part, I added changed all "session bean" occurrences by "EJB session bean". The step I see are: 0) Validate that we're all ok with the principle of splitting 1) validate that all EJB references are removed from core 2) Correct bad terminology that I introduced And then we should continue the splitting by rewriting the contexts chapter and EL references in Core. Antoine -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150415/5a44ec56/attachment.html From pmuir at redhat.com Wed Apr 15 11:06:12 2015 From: pmuir at redhat.com (Pete Muir) Date: Wed, 15 Apr 2015 16:06:12 +0100 Subject: [cdi-dev] Java SE / EE split, link to the generated spec In-Reply-To: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> References: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> Message-ID: <43F282E2-7FBA-465F-A939-A2A632C61F14@redhat.com> I think this is a good start. I agree with Tomas? points, and additionally I think we need to normalise the language used to describe the ?additions?. I number of phrases are used, and it really should be just one (so that people don?t argue in the future about whether different phrasings have different implications). I like ?When running in Java EE [?] the container must additionaly [?]? the most. For example I would change In Java EE, in addition to the kinds of bean listed in Programming model, the container must provide built-in support for injection and contextual lifecycle management of the following kinds of bean: to When running in Java EE, the container must additionally provide built-in support for injection and contextual lifecycle management of the following kinds of bean: This should replace everything like ?with the following addition?, ?in Java EE, the container is also required? etc. You?ve raised contexts elsewhere so let me discus that there. Pete > On 14 Apr 2015, at 13:24, Antoine Sabot-Durand wrote: > > Hi all, > > > After a lot of do, undo, redo, I sent, this morning, a PR containing a first draft of this split. > > To give an idea of the final result, the generated spec doc is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html > > The goal of this splitting is to have an EJB free version of the spec to provide an official Java SE support for CDI. It?s also the 1st step to introduce parts in the spec, should we decide to do it. > > Thanks for your feedback, here, in the pull request or in the corresponding Jira ticket : https://issues.jboss.org/browse/CDI-160 > > Antoine > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From pmuir at redhat.com Wed Apr 15 11:08:36 2015 From: pmuir at redhat.com (Pete Muir) Date: Wed, 15 Apr 2015 16:08:36 +0100 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: References: Message-ID: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand wrote: > > Hi all, > > Rethinking of this task and reading the feedback on this, I really think we should go step by step on this splitting. > > What I have produced here is a full extraction of EJB in the spec to put it in EE part. Yes, this is a great start. > There are still Java EE references in core with EL, JSF, Servlet. I?m least worried about EL, most about JSF and Serlet. > > The more problematic part is the Contexts chapter: hard to remove servlet ref without rewriting all... > > And yes, I did some rewording that could be no very nice. > > In some places I replaces "Managed Beans or Session Beans" by the generic term "bean?. This is definitely not ok, as you expanded the scope of the sentence to include built-in beans, producer methods, producer fields, and custom beans. I would suggest providing list of these changes, so we can review each one. > Java EE component was replaced by component (yes, I'm not sure it is very meaningful) I also think this is problematic. A Java EE component is a specific thing. I would suggest providing list of these changes, so we can review each one. > > In the EE part, I added changed all "session bean" occurrences by "EJB session bean?. Ok, I don?t think this is a problem. > > The step I see are: > > 0) Validate that we're all ok with the principle of splitting > 1) validate that all EJB references are removed from core > 2) Correct bad terminology that I introduced > > And then we should continue the splitting by rewriting the contexts chapter and EL references in Core. +1 > > Antoine > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From antonio.goncalves at gmail.com Thu Apr 16 03:25:35 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 09:25:35 +0200 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> References: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> Message-ID: Antoine, I've lost track of this topic. Is the document somewhere ? Can we easily see the diffs ? Managed Beans are already confusing.... turning it to "bean" can be even more confusing. Antonio On Wed, Apr 15, 2015 at 5:08 PM, Pete Muir wrote: > > > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand > wrote: > > > > Hi all, > > > > Rethinking of this task and reading the feedback on this, I really think > we should go step by step on this splitting. > > > > What I have produced here is a full extraction of EJB in the spec to put > it in EE part. > > Yes, this is a great start. > > > There are still Java EE references in core with EL, JSF, Servlet. > > I?m least worried about EL, most about JSF and Serlet. > > > > > The more problematic part is the Contexts chapter: hard to remove > servlet ref without rewriting all... > > > > And yes, I did some rewording that could be no very nice. > > > > In some places I replaces "Managed Beans or Session Beans" by the > generic term "bean?. > > This is definitely not ok, as you expanded the scope of the sentence to > include built-in beans, producer methods, producer fields, and custom > beans. I would suggest providing list of these changes, so we can review > each one. > > > Java EE component was replaced by component (yes, I'm not sure it is > very meaningful) > > I also think this is problematic. A Java EE component is a specific thing. > I would suggest providing list of these changes, so we can review each one. > > > > > In the EE part, I added changed all "session bean" occurrences by "EJB > session bean?. > > Ok, I don?t think this is a problem. > > > > > The step I see are: > > > > 0) Validate that we're all ok with the principle of splitting > > 1) validate that all EJB references are removed from core > > 2) Correct bad terminology that I introduced > > > > And then we should continue the splitting by rewriting the contexts > chapter and EL references in Core. > > +1 > > > > > Antoine > > _______________________________________________ > > cdi-dev mailing list > > cdi-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/cdi-dev > > > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/ca9496e5/attachment-0001.html From antonio.goncalves at gmail.com Thu Apr 16 03:27:39 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 09:27:39 +0200 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: References: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> Message-ID: Reading my emails upside down, just found the link : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html Antonio On Thu, Apr 16, 2015 at 9:25 AM, Antonio Goncalves < antonio.goncalves at gmail.com> wrote: > Antoine, I've lost track of this topic. Is the document somewhere ? Can we > easily see the diffs ? > > Managed Beans are already confusing.... turning it to "bean" can be even > more confusing. > > Antonio > > On Wed, Apr 15, 2015 at 5:08 PM, Pete Muir wrote: > >> >> > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand < >> antoine at sabot-durand.net> wrote: >> > >> > Hi all, >> > >> > Rethinking of this task and reading the feedback on this, I really >> think we should go step by step on this splitting. >> > >> > What I have produced here is a full extraction of EJB in the spec to >> put it in EE part. >> >> Yes, this is a great start. >> >> > There are still Java EE references in core with EL, JSF, Servlet. >> >> I?m least worried about EL, most about JSF and Serlet. >> >> > >> > The more problematic part is the Contexts chapter: hard to remove >> servlet ref without rewriting all... >> > >> > And yes, I did some rewording that could be no very nice. >> > >> > In some places I replaces "Managed Beans or Session Beans" by the >> generic term "bean?. >> >> This is definitely not ok, as you expanded the scope of the sentence to >> include built-in beans, producer methods, producer fields, and custom >> beans. I would suggest providing list of these changes, so we can review >> each one. >> >> > Java EE component was replaced by component (yes, I'm not sure it is >> very meaningful) >> >> I also think this is problematic. A Java EE component is a specific >> thing. I would suggest providing list of these changes, so we can review >> each one. >> >> > >> > In the EE part, I added changed all "session bean" occurrences by "EJB >> session bean?. >> >> Ok, I don?t think this is a problem. >> >> > >> > The step I see are: >> > >> > 0) Validate that we're all ok with the principle of splitting >> > 1) validate that all EJB references are removed from core >> > 2) Correct bad terminology that I introduced >> > >> > And then we should continue the splitting by rewriting the contexts >> chapter and EL references in Core. >> >> +1 >> >> > >> > Antoine >> > _______________________________________________ >> > cdi-dev mailing list >> > cdi-dev at lists.jboss.org >> > https://lists.jboss.org/mailman/listinfo/cdi-dev >> > >> > Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. > > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/b8bef64e/attachment.html From antoine at sabot-durand.net Thu Apr 16 03:45:40 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Thu, 16 Apr 2015 09:45:40 +0200 Subject: [cdi-dev] Fwd: More about SE/EE splitting References: Message-ID: You can also check the diff in the pull request : https://github.com/cdi-spec/cdi/pull/241/files > Le 16 avr. 2015 ? 09:27, Antonio Goncalves > a ?crit : > > Reading my emails upside down, just found the link : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html > > Antonio > > On Thu, Apr 16, 2015 at 9:25 AM, Antonio Goncalves > wrote: > Antoine, I've lost track of this topic. Is the document somewhere ? Can we easily see the diffs ? > > Managed Beans are already confusing.... turning it to "bean" can be even more confusing. > > Antonio > > On Wed, Apr 15, 2015 at 5:08 PM, Pete Muir > wrote: > > > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand > wrote: > > > > Hi all, > > > > Rethinking of this task and reading the feedback on this, I really think we should go step by step on this splitting. > > > > What I have produced here is a full extraction of EJB in the spec to put it in EE part. > > Yes, this is a great start. > > > There are still Java EE references in core with EL, JSF, Servlet. > > I?m least worried about EL, most about JSF and Serlet. > > > > > The more problematic part is the Contexts chapter: hard to remove servlet ref without rewriting all... > > > > And yes, I did some rewording that could be no very nice. > > > > In some places I replaces "Managed Beans or Session Beans" by the generic term "bean?. > > This is definitely not ok, as you expanded the scope of the sentence to include built-in beans, producer methods, producer fields, and custom beans. I would suggest providing list of these changes, so we can review each one. > > > Java EE component was replaced by component (yes, I'm not sure it is very meaningful) > > I also think this is problematic. A Java EE component is a specific thing. I would suggest providing list of these changes, so we can review each one. > > > > > In the EE part, I added changed all "session bean" occurrences by "EJB session bean?. > > Ok, I don?t think this is a problem. > > > > > The step I see are: > > > > 0) Validate that we're all ok with the principle of splitting > > 1) validate that all EJB references are removed from core > > 2) Correct bad terminology that I introduced > > > > And then we should continue the splitting by rewriting the contexts chapter and EL references in Core. > > +1 > > > > > Antoine > > _______________________________________________ > > cdi-dev mailing list > > cdi-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/cdi-dev > > > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/f9d295b2/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/f9d295b2/attachment.bin From antoine at sabot-durand.net Thu Apr 16 03:59:52 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Thu, 16 Apr 2015 09:59:52 +0200 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> References: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> Message-ID: <5FF666C7-C990-4B8A-B18E-C37B9718D3C5@sabot-durand.net> > Le 15 avr. 2015 ? 17:08, Pete Muir a ?crit : > > >> On 15 Apr 2015, at 13:31, Antoine Sabot-Durand wrote: >> >> Hi all, >> >> Rethinking of this task and reading the feedback on this, I really think we should go step by step on this splitting. >> >> What I have produced here is a full extraction of EJB in the spec to put it in EE part. > > Yes, this is a great start. > >> There are still Java EE references in core with EL, JSF, Servlet. > > I?m least worried about EL, most about JSF and Serlet. I?m not sure about JSF. Servlet is still here mainly because of contexts. As we'll probably change a few things in context (if we add context control for instance) perhaps and complete review of chapter 6 (scopes and context) will be necessary... > >> >> The more problematic part is the Contexts chapter: hard to remove servlet ref without rewriting all... >> >> And yes, I did some rewording that could be no very nice. >> >> In some places I replaces "Managed Beans or Session Beans" by the generic term "bean?. > > This is definitely not ok, as you expanded the scope of the sentence to include built-in beans, producer methods, producer fields, and custom beans. I would suggest providing list of these changes, so we can review each one. Agree, on the paper that looks messy. I did it when I thought that the rules applied to all kind of beans, for others places I had to remove "session bean? mention (letting only managed bean) and recreate a similar section in EE part stating that rules in section foo of core was also valid for session beans. I?ll create a list of these generic change since it?ll be easier to check if I didn?t made a mistake. > >> Java EE component was replaced by component (yes, I'm not sure it is very meaningful) > > I also think this is problematic. A Java EE component is a specific thing. I would suggest providing list of these changes, so we can review each one. We have to find a new terminology. I?m a bit clueless her. Will list the places as well. > >> >> In the EE part, I added changed all "session bean" occurrences by "EJB session bean?. > > Ok, I don?t think this is a problem. We have a ticket staying that we should clarify the term beans in the spec. > >> >> The step I see are: >> >> 0) Validate that we're all ok with the principle of splitting >> 1) validate that all EJB references are removed from core >> 2) Correct bad terminology that I introduced >> >> And then we should continue the splitting by rewriting the contexts chapter and EL references in Core. > > +1 I guess that everybody is ok with 0 by now. 1 is in process and shouldn?t be too hard, 2 is the trickiest one. I?ll produce this list by the end of the week so we can discuss of each occurrences. > >> >> Antoine >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/f7986306/attachment-0001.bin From antoine at sabot-durand.net Thu Apr 16 04:09:10 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Thu, 16 Apr 2015 10:09:10 +0200 Subject: [cdi-dev] Java SE / EE split, link to the generated spec In-Reply-To: <473949953.36952.1429090908470.JavaMail.zimbra@redhat.com> References: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> <473949953.36952.1429090908470.JavaMail.zimbra@redhat.com> Message-ID: Hi Tomas, thanks for your feedback. Reading your mail I realized that I have a numbering issue in my new html spec doc. I have 2 chapter One :-(. I?m going to fix it > Le 15 avr. 2015 ? 11:41, Tomas Remes a ?crit : > > > Hi Antoine, > > I quickly went through the new spec html and here follows my questions/suggestions/clarifications which I have discovered so far: > > - chapter 1.4 and 1.4.1 - do we want to describe servlets, EJBs here? And in general do we want to mention @SessionScoped and @RequestScoped in SE? Yes, the last references are still tied to scope :-(? > - chapter 1.8.3 - briefly mention MVC and JSF (not a big issue) me too ;) > - chapter 1.9 - does it make sense in SE to talk about DeploymentProblems? I guess ambiguous or unsatisfied dependencies can still occurs in SE. > > - chapter 5.7 and all its subchapters - this needs revision IMHO (probably next step?) Yes. I?m not sure but I think we should start by making my &st cut cleaner before adding more content to it. > > T. > > ----- Original Message ----- > From: "Antoine Sabot-Durand" > To: "cdi-dev" > Sent: Tuesday, April 14, 2015 2:24:01 PM > Subject: [cdi-dev] Java SE / EE split, link to the generated spec > > Hi all, > > > After a lot of do, undo, redo, I sent, this morning, a PR containing a first draft of this split. > > To give an idea of the final result, the generated spec doc is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html > > The goal of this splitting is to have an EJB free version of the spec to provide an official Java SE support for CDI. It?s also the 1st step to introduce parts in the spec, should we decide to do it. > > Thanks for your feedback, here, in the pull request or in the corresponding Jira ticket : https://issues.jboss.org/browse/CDI-160 > > Antoine > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/69bf2d50/attachment.bin From antoine at sabot-durand.net Thu Apr 16 04:11:01 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Thu, 16 Apr 2015 10:11:01 +0200 Subject: [cdi-dev] Java SE / EE split, link to the generated spec In-Reply-To: <43F282E2-7FBA-465F-A939-A2A632C61F14@redhat.com> References: <9B0861A8-5950-4F74-869B-797730F62BBC@sabot-durand.net> <43F282E2-7FBA-465F-A939-A2A632C61F14@redhat.com> Message-ID: Thanks Pete. The normalisation (proposed by an english native speaker ;) ) is one of the point I had in mind. I will integrate your suggestion Antoine > Le 15 avr. 2015 ? 17:06, Pete Muir a ?crit : > > I think this is a good start. I agree with Tomas? points, and additionally I think we need to normalise the language used to describe the ?additions?. I number of phrases are used, and it really should be just one (so that people don?t argue in the future about whether different phrasings have different implications). > > I like ?When running in Java EE [?] the container must additionaly [?]? the most. For example I would change > > In Java EE, in addition to the kinds of bean listed in Programming model, the container must provide built-in support for injection and contextual lifecycle management of the following kinds of bean: > > to > > When running in Java EE, the container must additionally provide built-in support for injection and contextual lifecycle management of the following kinds of bean: > > This should replace everything like ?with the following addition?, ?in Java EE, the container is also required? etc. > > You?ve raised contexts elsewhere so let me discus that there. > > Pete > >> On 14 Apr 2015, at 13:24, Antoine Sabot-Durand wrote: >> >> Hi all, >> >> >> After a lot of do, undo, redo, I sent, this morning, a PR containing a first draft of this split. >> >> To give an idea of the final result, the generated spec doc is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html >> >> The goal of this splitting is to have an EJB free version of the spec to provide an official Java SE support for CDI. It?s also the 1st step to introduce parts in the spec, should we decide to do it. >> >> Thanks for your feedback, here, in the pull request or in the corresponding Jira ticket : https://issues.jboss.org/browse/CDI-160 >> >> Antoine >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/70335b1b/attachment.bin From pmuir at redhat.com Thu Apr 16 04:50:19 2015 From: pmuir at redhat.com (Pete Muir) Date: Thu, 16 Apr 2015 09:50:19 +0100 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: <5FF666C7-C990-4B8A-B18E-C37B9718D3C5@sabot-durand.net> References: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> <5FF666C7-C990-4B8A-B18E-C37B9718D3C5@sabot-durand.net> Message-ID: <2E88175C-3B47-467F-A897-83A21A118FD6@redhat.com> > On 16 Apr 2015, at 08:59, Antoine Sabot-Durand wrote: > >> >> Le 15 avr. 2015 ? 17:08, Pete Muir a ?crit : >> >> >>> On 15 Apr 2015, at 13:31, Antoine Sabot-Durand wrote: >>> >>> Hi all, >>> >>> Rethinking of this task and reading the feedback on this, I really think we should go step by step on this splitting. >>> >>> What I have produced here is a full extraction of EJB in the spec to put it in EE part. >> >> Yes, this is a great start. >> >>> There are still Java EE references in core with EL, JSF, Servlet. >> >> I?m least worried about EL, most about JSF and Serlet. > > I?m not sure about JSF. Servlet is still here mainly because of contexts. As we'll probably change a few things in context (if we add context control for instance) perhaps and complete review of chapter 6 (scopes and context) will be necessary? I think before we change the context chapter we need to unwrap the generic functionality (minimal) from the implementation details). > >> >>> >>> The more problematic part is the Contexts chapter: hard to remove servlet ref without rewriting all... >>> >>> And yes, I did some rewording that could be no very nice. >>> >>> In some places I replaces "Managed Beans or Session Beans" by the generic term "bean?. >> >> This is definitely not ok, as you expanded the scope of the sentence to include built-in beans, producer methods, producer fields, and custom beans. I would suggest providing list of these changes, so we can review each one. > > Agree, on the paper that looks messy. I did it when I thought that the rules applied to all kind of beans, When the rules apply to all kinds of beans, the spec says ?beans?. When they only apply to managed beans and session beans it says ?managed beans and session beans? ;-) BTW I realise the above sounds obvious, but I am not aware of any loose language around this at all. > for others places I had to remove "session bean? mention (letting only managed bean) and recreate a similar section in EE part stating that rules in section foo of core was also valid for session beans. Right, this is the correct way to do it. > > I?ll create a list of these generic change since it?ll be easier to check if I didn?t made a mistake. > > >> >>> Java EE component was replaced by component (yes, I'm not sure it is very meaningful) >> >> I also think this is problematic. A Java EE component is a specific thing. I would suggest providing list of these changes, so we can review each one. > > > We have to find a new terminology. I?m a bit clueless her. Will list the places as well. I don?t think the core spec needs to refer to components at all? Where was this a problem? > >> >>> >>> In the EE part, I added changed all "session bean" occurrences by "EJB session bean?. >> >> Ok, I don?t think this is a problem. > > > We have a ticket staying that we should clarify the term beans in the spec. > >> >>> >>> The step I see are: >>> >>> 0) Validate that we're all ok with the principle of splitting >>> 1) validate that all EJB references are removed from core >>> 2) Correct bad terminology that I introduced >>> >>> And then we should continue the splitting by rewriting the contexts chapter and EL references in Core. >> >> +1 > > I guess that everybody is ok with 0 by now. 1 is in process and shouldn?t be too hard, 2 is the trickiest one. > > I?ll produce this list by the end of the week so we can discuss of each occurrences. > >> >>> >>> Antoine >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/88b9125e/attachment-0001.html From antonio.goncalves at gmail.com Thu Apr 16 05:02:17 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 11:02:17 +0200 Subject: [cdi-dev] Shutting down CDI Instances In-Reply-To: <551ABB1B.7060908@oracle.com> References: <551ABB1B.7060908@oracle.com> Message-ID: *Option 2*. I can't think of the option 1 pattern in Java EE. If you look at JPA for example, you can see sentences such as : *"The Persistence class is available in a Java EE container environment as well; however, support for the Java SE bootstrapping APIs is not required in container environments."* *"Both JTA entity managers and resource-local entity managers are required to be supported in Java EE web containers and EJB containers. (...) In general, in Java SE environments only resource-local entity managers are supported."* So I think Java EE developers are more confortable on using a same API, and depending on the environment (EE or SE) things might happen this way, or that way (ex. throwing an exception). Antonio On Tue, Mar 31, 2015 at 5:19 PM, JJ Snyder wrote: > Option 2 > On 03/24/2015 02:00 PM, John D. Ament wrote: > > All, > > In discussion today w/ Jozef, we found that the way of shutting down a > container in the proposed SE API precluded the notion that multiple > containers could be running. While we're not necessarily going to handle > multiple containers right now, we don't want to preclude the idea either. > With that said, there were three different approaches though up to handle > how to shutdown a launched container. it obivously would only work with an > SE booted container, but part of this does give a pointer in how we may > implement initialize. > > Option 1 - Subclass CDI. The returned CDI instance when bootstrapped > would return this subclass of CDI that has shutdown capability. > > Option 2 - Add method to CDI. Add the shutdown method to CDI directly, > and throw an exception if called in an EE environment. > > Option 3 - Return a different object all together when initializing. > Return something else from initialize, e.g. CDIContext, which has a > shutdown method when you initialize. That class would also have a getter > for the CDI instance backing it. > > Let us know your thoughts. > > Thanks, > > John > > > _______________________________________________ > cdi-dev mailing listcdi-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/fbdda04a/attachment.html From antonio.goncalves at gmail.com Thu Apr 16 05:12:35 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 11:12:35 +0200 Subject: [cdi-dev] Best way to specify for spec that CDI contexts should be available? In-Reply-To: References: Message-ID: Hi Arjan, Are you just wondering on how this should be expressed in the specification ? If you look at most of the Java EE specs, there's often a "relationship to other specs" section (example Interceptor 1.2 "Relationship to Other Specifications"). EJB has two sections (2.8 - Relationship to Managed Bean Specification and 2.9 - Relationship to Contexts and Dependency Injection (CDI). If you read the relation to CDI section, you see things like "An EJB packaged into a CDI bean archive and not annotated with javax.enterprise.inject.Vetoed annotation, is considered a CDI-enabled bean" And, of course, most of the specs have a "Related Documents" section at the end that points to all the related specs. Antonio On Wed, Mar 25, 2015 at 3:54 PM, arjan tijms wrote: > Hi, > > In the Security EG many proposals that are currently being discussed > depend on CDI being available in authentication modules. > > Low level authentication modules do not necessarily have to be beans > themselves, but they have to be able to programmatically pull beans from > the bean manager, in order to be able to delegate certain authentication > decisions to those. > > Now if I'm not mistaken, CDI is most often initialized per request via a > ServletRequestListener (in a vendor specific way), so those obviously have > to be invoked before an authentication module is invoked (which is a > Servlet concern). > > On the other hand, the CDI spec defines when the request scope, session > scope and application scope should be active, referencing other spec > artifacts there. > > Furthermore, it seems the CDI 2.0 spec is also working on providing APIs > for initializing CDI, but does that also take into account the per request > initialization that CDI implementations currently do? Would this be > powerful enough for code in an authentication module to initialize CDI > itself, such that request- session- and application scoped beans can be > pulled from the bean manager? > > And if the above would be possible, what would happen if an authentication > module initialized the per request bits of CDI, and then afterwards (within > the same request) the container would attempt to initialize CDI as it would > normally do for usage in Servlets and Filters? > > So, what would be spec-wise and practically speaking the best way to > specify that CDI should be available in authentication modules? > > Kind regards, > Arjan Tijms > > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/64a4afac/attachment.html From antonio.goncalves at gmail.com Thu Apr 16 05:17:10 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 11:17:10 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: <1426775904740-5711245.post@n5.nabble.com> References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Hi all, I'm catching up with emails, sorry... I have two questions : - why Brno ? It's quite a difficult place to go to (in terms of transports). If you want to stay in Central Europe, what about Vienna or Prague ? - why just one day ? If we do a face to face, why not target 2 days ? We could start work on a Friday morning, and end a Satuday evening. Again, that would be easier to do in Vienna or Prague as we could easily fly there on a Friday morning. My 2 cents Antonio On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < antoine at sabot-durand.net> wrote: > Don't be shy. If you have concern with the date or other point let me know. > > > > -- > View this message in context: > http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html > Sent from the CDI Development mailing list mailing list archive at > Nabble.com. > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/66bbed54/attachment.html From arjan.tijms at gmail.com Thu Apr 16 08:02:15 2015 From: arjan.tijms at gmail.com (arjan tijms) Date: Thu, 16 Apr 2015 14:02:15 +0200 Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: References: <1D3AAF93-2CC2-42B1-8DE0-24E14CFF508E@redhat.com> Message-ID: Hi, On Thu, Apr 16, 2015 at 9:25 AM, Antonio Goncalves wrote: > Managed Beans are already confusing.... turning it to "bean" can be even > more confusing. And what about the confusion that a "factory" for a type is also called Bean? (Bean) Kind regards, Arjan Tijms > > Antonio > > On Wed, Apr 15, 2015 at 5:08 PM, Pete Muir wrote: >> >> >> > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand >> > wrote: >> > >> > Hi all, >> > >> > Rethinking of this task and reading the feedback on this, I really think >> > we should go step by step on this splitting. >> > >> > What I have produced here is a full extraction of EJB in the spec to put >> > it in EE part. >> >> Yes, this is a great start. >> >> > There are still Java EE references in core with EL, JSF, Servlet. >> >> I?m least worried about EL, most about JSF and Serlet. >> >> > >> > The more problematic part is the Contexts chapter: hard to remove >> > servlet ref without rewriting all... >> > >> > And yes, I did some rewording that could be no very nice. >> > >> > In some places I replaces "Managed Beans or Session Beans" by the >> > generic term "bean?. >> >> This is definitely not ok, as you expanded the scope of the sentence to >> include built-in beans, producer methods, producer fields, and custom beans. >> I would suggest providing list of these changes, so we can review each one. >> >> > Java EE component was replaced by component (yes, I'm not sure it is >> > very meaningful) >> >> I also think this is problematic. A Java EE component is a specific thing. >> I would suggest providing list of these changes, so we can review each one. >> >> > >> > In the EE part, I added changed all "session bean" occurrences by "EJB >> > session bean?. >> >> Ok, I don?t think this is a problem. >> >> > >> > The step I see are: >> > >> > 0) Validate that we're all ok with the principle of splitting >> > 1) validate that all EJB references are removed from core >> > 2) Correct bad terminology that I introduced >> > >> > And then we should continue the splitting by rewriting the contexts >> > chapter and EL references in Core. >> >> +1 >> >> > >> > Antoine >> > _______________________________________________ >> > cdi-dev mailing list >> > cdi-dev at lists.jboss.org >> > https://lists.jboss.org/mailman/listinfo/cdi-dev >> > >> > Note that for all code provided on this list, the provider licenses the >> > code under the Apache License, Version 2 >> > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> > provided on this list, the provider waives all patent and other intellectual >> > property rights inherent in such information. >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 >> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other intellectual >> property rights inherent in such information. > > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code > under the Apache License, Version 2 > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other intellectual > property rights inherent in such information. From werner.keil at gmail.com Thu Apr 16 08:12:59 2015 From: werner.keil at gmail.com (Werner Keil) Date: Thu, 16 Apr 2015 14:12:59 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting Message-ID: +1 Depending on how soon that F2F would be, Vienna sounded OK. I am in Northern Germany till late May, but then moving on to a more Central project... How many of you (I know at least Antoine will be there) come to DevoXX UK btw.? I have a speaking and Java track duty at DWX (Nuremberg also Central Europe) in the same week, so I have to commute between those places after the JCP EC F2F, but depending on who came to London on Tuesday, I'd be there till that afternoon. I know at least Anatole who has a talk on the Java track will be at DWX, too. He just spoke in Vienna, so while Brno may not be too far from there, it would require everyone outside Vienna or Prague to fly to either of these airports first and take a bus or train ;-| Werner On Thu, Apr 16, 2015 at 2:02 PM, wrote: > Send cdi-dev mailing list submissions to > cdi-dev at lists.jboss.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.jboss.org/mailman/listinfo/cdi-dev > or, via email, send a message with subject or body 'help' to > cdi-dev-request at lists.jboss.org > > You can reach the person managing the list at > cdi-dev-owner at lists.jboss.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of cdi-dev digest..." > > > Today's Topics: > > 1. Re: Shutting down CDI Instances (Antonio Goncalves) > 2. Re: Best way to specify for spec that CDI contexts should be > available? (Antonio Goncalves) > 3. Re: Choosing a date for next CDI Face to Face meeting > (Antonio Goncalves) > 4. Re: More about SE/EE splitting (arjan tijms) > > > > ------------------------------ > > Message: 3 > Date: Thu, 16 Apr 2015 11:17:10 +0200 > From: Antonio Goncalves > Subject: Re: [cdi-dev] Choosing a date for next CDI Face to Face > meeting > To: Antoine Sabot-Durand > Cc: cdi-dev > Message-ID: > < > CA+ZZq9_+uHvRdJA6aNGXww5NE6PUBfWR4-NkquwAnTsUzVGKOQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi all, > > I'm catching up with emails, sorry... I have two questions : > > - why Brno ? It's quite a difficult place to go to (in terms of > transports). If you want to stay in Central Europe, what about Vienna or > Prague ? > - why just one day ? If we do a face to face, why not target 2 days ? We > could start work on a Friday morning, and end a Satuday evening. Again, > that would be easier to do in Vienna or Prague as we could easily fly > there > on a Friday morning. > > > My 2 cents > Antonio > > On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < > antoine at sabot-durand.net> wrote: > > > Don't be shy. If you have concern with the date or other point let me > know. > > > > > > > > -- > > View this message in context: > > > http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html > > Sent from the CDI Development mailing list mailing list archive at > > Nabble.com. > > _______________________________________________ > > cdi-dev mailing list > > cdi-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/cdi-dev > > > > Note that for all code provided on this list, the provider licenses the > > code under the Apache License, Version 2 ( > > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > > provided on this list, the provider waives all patent and other > > intellectual property rights inherent in such information. > > > > ------------------------------ > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > > End of cdi-dev Digest, Vol 53, Issue 16 > *************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/fe436bfa/attachment.html From antonio.goncalves at gmail.com Thu Apr 16 08:24:47 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 14:24:47 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: Message-ID: Devoxx UK could be a nice target, WDYT ? RedHat has some offices in London, no ? If some of us will be at Devoxx UK in June, why not have the face-to-face meeting there on Saturday ? On Thu, Apr 16, 2015 at 2:12 PM, Werner Keil wrote: > +1 > Depending on how soon that F2F would be, Vienna sounded OK. I am in > Northern Germany till late May, but then moving on to a more Central > project... > > How many of you (I know at least Antoine will be there) come to DevoXX UK > btw.? > I have a speaking and Java track duty at DWX (Nuremberg also Central > Europe) in the same week, so I have to commute between those places after > the JCP EC F2F, but depending on who came to London on Tuesday, I'd be > there till that afternoon. > > I know at least Anatole who has a talk on the Java track will be at DWX, > too. He just spoke in Vienna, so while Brno may not be too far from there, > it would require everyone outside Vienna or Prague to fly to either of > these airports first and take a bus or train ;-| > > Werner > > On Thu, Apr 16, 2015 at 2:02 PM, wrote: > >> Send cdi-dev mailing list submissions to >> cdi-dev at lists.jboss.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> or, via email, send a message with subject or body 'help' to >> cdi-dev-request at lists.jboss.org >> >> You can reach the person managing the list at >> cdi-dev-owner at lists.jboss.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of cdi-dev digest..." >> >> >> Today's Topics: >> >> 1. Re: Shutting down CDI Instances (Antonio Goncalves) >> 2. Re: Best way to specify for spec that CDI contexts should be >> available? (Antonio Goncalves) >> 3. Re: Choosing a date for next CDI Face to Face meeting >> (Antonio Goncalves) >> 4. Re: More about SE/EE splitting (arjan tijms) >> >> >> >> ------------------------------ >> >> Message: 3 >> Date: Thu, 16 Apr 2015 11:17:10 +0200 >> From: Antonio Goncalves >> Subject: Re: [cdi-dev] Choosing a date for next CDI Face to Face >> meeting >> To: Antoine Sabot-Durand >> Cc: cdi-dev >> Message-ID: >> < >> CA+ZZq9_+uHvRdJA6aNGXww5NE6PUBfWR4-NkquwAnTsUzVGKOQ at mail.gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> Hi all, >> >> I'm catching up with emails, sorry... I have two questions : >> >> - why Brno ? It's quite a difficult place to go to (in terms of >> transports). If you want to stay in Central Europe, what about Vienna >> or >> Prague ? >> - why just one day ? If we do a face to face, why not target 2 days ? >> We >> could start work on a Friday morning, and end a Satuday evening. Again, >> that would be easier to do in Vienna or Prague as we could easily fly >> there >> on a Friday morning. >> >> >> My 2 cents >> Antonio >> >> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >> antoine at sabot-durand.net> wrote: >> >> > Don't be shy. If you have concern with the date or other point let me >> know. >> > >> > >> > >> > -- >> > View this message in context: >> > >> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >> > Sent from the CDI Development mailing list mailing list archive at >> > Nabble.com. >> > _______________________________________________ >> > cdi-dev mailing list >> > cdi-dev at lists.jboss.org >> > https://lists.jboss.org/mailman/listinfo/cdi-dev >> > >> > Note that for all code provided on this list, the provider licenses the >> > code under the Apache License, Version 2 ( >> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> > provided on this list, the provider waives all patent and other >> > intellectual property rights inherent in such information. >> > >> >> ------------------------------ >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> >> End of cdi-dev Digest, Vol 53, Issue 16 >> *************************************** >> > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/f19bc5f5/attachment.html From arjan.tijms at gmail.com Thu Apr 16 08:29:51 2015 From: arjan.tijms at gmail.com (arjan tijms) Date: Thu, 16 Apr 2015 14:29:51 +0200 Subject: [cdi-dev] Best way to specify for spec that CDI contexts should be available? In-Reply-To: References: Message-ID: Hi, On Thu, Apr 16, 2015 at 11:12 AM, Antonio Goncalves wrote: > Are you just wondering on how this should be expressed in the specification > ? Basically, but also in what specification this should be done, and whether any support from CDI could take its place. Some options: 1. JASPIC "simply" says: "In a Java EE environment CDI should be available inside an auth module", and then whoever implements this for a server product has to make sure this happens in whatever way. 2. Servlet specifies that ServletRequestListeners are called before an auth module is called. Practically this will almost always make CDI available as a side-effect (at least, I think it will) 3. CDI in its sections about @RequestScoped, @SessionScoped and @ApplicationScoped says that these scopes should be active during a call to an auth module. 4. CDI provides an API that JSR 375 (Security) can leverage to activate the per request initialization of CDI inside a wrapper auth module that it installs. Thoughts? Kind regards, Arjan Tijms > > If you look at most of the Java EE specs, there's often a "relationship to > other specs" section (example Interceptor 1.2 "Relationship to Other > Specifications"). > > EJB has two sections (2.8 - Relationship to Managed Bean Specification and > 2.9 - Relationship to Contexts and Dependency Injection (CDI). If you read > the relation to CDI section, you see things like "An EJB packaged into a CDI > bean archive and not annotated with javax.enterprise.inject.Vetoed > annotation, is considered a CDI-enabled bean" > > And, of course, most of the specs have a "Related Documents" section at the > end that points to all the related specs. > > Antonio > > > On Wed, Mar 25, 2015 at 3:54 PM, arjan tijms wrote: >> >> Hi, >> >> In the Security EG many proposals that are currently being discussed >> depend on CDI being available in authentication modules. >> >> Low level authentication modules do not necessarily have to be beans >> themselves, but they have to be able to programmatically pull beans from the >> bean manager, in order to be able to delegate certain authentication >> decisions to those. >> >> Now if I'm not mistaken, CDI is most often initialized per request via a >> ServletRequestListener (in a vendor specific way), so those obviously have >> to be invoked before an authentication module is invoked (which is a Servlet >> concern). >> >> On the other hand, the CDI spec defines when the request scope, session >> scope and application scope should be active, referencing other spec >> artifacts there. >> >> Furthermore, it seems the CDI 2.0 spec is also working on providing APIs >> for initializing CDI, but does that also take into account the per request >> initialization that CDI implementations currently do? Would this be powerful >> enough for code in an authentication module to initialize CDI itself, such >> that request- session- and application scoped beans can be pulled from the >> bean manager? >> >> And if the above would be possible, what would happen if an authentication >> module initialized the per request bits of CDI, and then afterwards (within >> the same request) the container would attempt to initialize CDI as it would >> normally do for usage in Servlets and Filters? >> >> So, what would be spec-wise and practically speaking the best way to >> specify that CDI should be available in authentication modules? >> >> Kind regards, >> Arjan Tijms >> >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 >> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other intellectual >> property rights inherent in such information. > > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France From werner.keil at gmail.com Thu Apr 16 08:32:47 2015 From: werner.keil at gmail.com (Werner Keil) Date: Thu, 16 Apr 2015 14:32:47 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: Message-ID: Before or after DevoXXUK? (before should work, but I highly doubt going back and forth multiple times would be easy for me if afterwards;-) On Thu, Apr 16, 2015 at 2:24 PM, Antonio Goncalves < antonio.goncalves at gmail.com> wrote: > Devoxx UK could be a nice target, WDYT ? RedHat has some offices in > London, no ? If some of us will be at Devoxx UK in June, why not have the > face-to-face meeting there on Saturday ? > > On Thu, Apr 16, 2015 at 2:12 PM, Werner Keil > wrote: > >> +1 >> Depending on how soon that F2F would be, Vienna sounded OK. I am in >> Northern Germany till late May, but then moving on to a more Central >> project... >> >> How many of you (I know at least Antoine will be there) come to DevoXX UK >> btw.? >> I have a speaking and Java track duty at DWX (Nuremberg also Central >> Europe) in the same week, so I have to commute between those places after >> the JCP EC F2F, but depending on who came to London on Tuesday, I'd be >> there till that afternoon. >> >> I know at least Anatole who has a talk on the Java track will be at DWX, >> too. He just spoke in Vienna, so while Brno may not be too far from there, >> it would require everyone outside Vienna or Prague to fly to either of >> these airports first and take a bus or train ;-| >> >> Werner >> >> On Thu, Apr 16, 2015 at 2:02 PM, wrote: >> >>> Send cdi-dev mailing list submissions to >>> cdi-dev at lists.jboss.org >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> or, via email, send a message with subject or body 'help' to >>> cdi-dev-request at lists.jboss.org >>> >>> You can reach the person managing the list at >>> cdi-dev-owner at lists.jboss.org >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of cdi-dev digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Re: Shutting down CDI Instances (Antonio Goncalves) >>> 2. Re: Best way to specify for spec that CDI contexts should be >>> available? (Antonio Goncalves) >>> 3. Re: Choosing a date for next CDI Face to Face meeting >>> (Antonio Goncalves) >>> 4. Re: More about SE/EE splitting (arjan tijms) >>> >>> >>> >>> ------------------------------ >>> >>> Message: 3 >>> Date: Thu, 16 Apr 2015 11:17:10 +0200 >>> From: Antonio Goncalves >>> Subject: Re: [cdi-dev] Choosing a date for next CDI Face to Face >>> meeting >>> To: Antoine Sabot-Durand >>> Cc: cdi-dev >>> Message-ID: >>> < >>> CA+ZZq9_+uHvRdJA6aNGXww5NE6PUBfWR4-NkquwAnTsUzVGKOQ at mail.gmail.com> >>> Content-Type: text/plain; charset="utf-8" >>> >>> Hi all, >>> >>> I'm catching up with emails, sorry... I have two questions : >>> >>> - why Brno ? It's quite a difficult place to go to (in terms of >>> transports). If you want to stay in Central Europe, what about Vienna >>> or >>> Prague ? >>> - why just one day ? If we do a face to face, why not target 2 days ? >>> We >>> could start work on a Friday morning, and end a Satuday evening. >>> Again, >>> that would be easier to do in Vienna or Prague as we could easily fly >>> there >>> on a Friday morning. >>> >>> >>> My 2 cents >>> Antonio >>> >>> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >>> antoine at sabot-durand.net> wrote: >>> >>> > Don't be shy. If you have concern with the date or other point let me >>> know. >>> > >>> > >>> > >>> > -- >>> > View this message in context: >>> > >>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>> > Sent from the CDI Development mailing list mailing list archive at >>> > Nabble.com. >>> > _______________________________________________ >>> > cdi-dev mailing list >>> > cdi-dev at lists.jboss.org >>> > https://lists.jboss.org/mailman/listinfo/cdi-dev >>> > >>> > Note that for all code provided on this list, the provider licenses the >>> > code under the Apache License, Version 2 ( >>> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> > provided on this list, the provider waives all patent and other >>> > intellectual property rights inherent in such information. >>> > >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >>> End of cdi-dev Digest, Vol 53, Issue 16 >>> *************************************** >>> >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/e2b7b254/attachment.html From antonio.goncalves at gmail.com Thu Apr 16 08:37:44 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Thu, 16 Apr 2015 14:37:44 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: Message-ID: Devoxx UK is from Wed to Fri, so we could use the Saturday On Thu, Apr 16, 2015 at 2:32 PM, Werner Keil wrote: > Before or after DevoXXUK? > (before should work, but I highly doubt going back and forth multiple > times would be easy for me if afterwards;-) > > > > > On Thu, Apr 16, 2015 at 2:24 PM, Antonio Goncalves < > antonio.goncalves at gmail.com> wrote: > >> Devoxx UK could be a nice target, WDYT ? RedHat has some offices in >> London, no ? If some of us will be at Devoxx UK in June, why not have the >> face-to-face meeting there on Saturday ? >> >> On Thu, Apr 16, 2015 at 2:12 PM, Werner Keil >> wrote: >> >>> +1 >>> Depending on how soon that F2F would be, Vienna sounded OK. I am in >>> Northern Germany till late May, but then moving on to a more Central >>> project... >>> >>> How many of you (I know at least Antoine will be there) come to DevoXX >>> UK btw.? >>> I have a speaking and Java track duty at DWX (Nuremberg also Central >>> Europe) in the same week, so I have to commute between those places after >>> the JCP EC F2F, but depending on who came to London on Tuesday, I'd be >>> there till that afternoon. >>> >>> I know at least Anatole who has a talk on the Java track will be at >>> DWX, too. He just spoke in Vienna, so while Brno may not be too far from >>> there, it would require everyone outside Vienna or Prague to fly to either >>> of these airports first and take a bus or train ;-| >>> >>> Werner >>> >>> On Thu, Apr 16, 2015 at 2:02 PM, >>> wrote: >>> >>>> Send cdi-dev mailing list submissions to >>>> cdi-dev at lists.jboss.org >>>> >>>> To subscribe or unsubscribe via the World Wide Web, visit >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> or, via email, send a message with subject or body 'help' to >>>> cdi-dev-request at lists.jboss.org >>>> >>>> You can reach the person managing the list at >>>> cdi-dev-owner at lists.jboss.org >>>> >>>> When replying, please edit your Subject line so it is more specific >>>> than "Re: Contents of cdi-dev digest..." >>>> >>>> >>>> Today's Topics: >>>> >>>> 1. Re: Shutting down CDI Instances (Antonio Goncalves) >>>> 2. Re: Best way to specify for spec that CDI contexts should be >>>> available? (Antonio Goncalves) >>>> 3. Re: Choosing a date for next CDI Face to Face meeting >>>> (Antonio Goncalves) >>>> 4. Re: More about SE/EE splitting (arjan tijms) >>>> >>>> >>>> >>>> ------------------------------ >>>> >>>> Message: 3 >>>> Date: Thu, 16 Apr 2015 11:17:10 +0200 >>>> From: Antonio Goncalves >>>> Subject: Re: [cdi-dev] Choosing a date for next CDI Face to Face >>>> meeting >>>> To: Antoine Sabot-Durand >>>> Cc: cdi-dev >>>> Message-ID: >>>> < >>>> CA+ZZq9_+uHvRdJA6aNGXww5NE6PUBfWR4-NkquwAnTsUzVGKOQ at mail.gmail.com> >>>> Content-Type: text/plain; charset="utf-8" >>>> >>>> Hi all, >>>> >>>> I'm catching up with emails, sorry... I have two questions : >>>> >>>> - why Brno ? It's quite a difficult place to go to (in terms of >>>> transports). If you want to stay in Central Europe, what about >>>> Vienna or >>>> Prague ? >>>> - why just one day ? If we do a face to face, why not target 2 days >>>> ? We >>>> could start work on a Friday morning, and end a Satuday evening. >>>> Again, >>>> that would be easier to do in Vienna or Prague as we could easily >>>> fly there >>>> on a Friday morning. >>>> >>>> >>>> My 2 cents >>>> Antonio >>>> >>>> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >>>> antoine at sabot-durand.net> wrote: >>>> >>>> > Don't be shy. If you have concern with the date or other point let me >>>> know. >>>> > >>>> > >>>> > >>>> > -- >>>> > View this message in context: >>>> > >>>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>>> > Sent from the CDI Development mailing list mailing list archive at >>>> > Nabble.com. >>>> > _______________________________________________ >>>> > cdi-dev mailing list >>>> > cdi-dev at lists.jboss.org >>>> > https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> > >>>> > Note that for all code provided on this list, the provider licenses >>>> the >>>> > code under the Apache License, Version 2 ( >>>> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> > provided on this list, the provider waives all patent and other >>>> > intellectual property rights inherent in such information. >>>> > >>>> >>>> ------------------------------ >>>> >>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>>> End of cdi-dev Digest, Vol 53, Issue 16 >>>> *************************************** >>>> >>> >>> >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter >> | LinkedIn >> | Pluralsight >> | Paris >> JUG | Devoxx France >> > > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/27f17cbb/attachment-0001.html From werner.keil at gmail.com Thu Apr 16 08:41:42 2015 From: werner.keil at gmail.com (Werner Keil) Date: Thu, 16 Apr 2015 14:41:42 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: Message-ID: I wouldn't outrule it on a WE, but it depends on what travel options are available. I must be on the continent on Wed, so does e.g. Anatole, but maybe we'd find a way if that date was confirmed by most;-) On Thu, Apr 16, 2015 at 2:37 PM, Antonio Goncalves < antonio.goncalves at gmail.com> wrote: > Devoxx UK is from Wed to Fri, so we could use the Saturday > > On Thu, Apr 16, 2015 at 2:32 PM, Werner Keil > wrote: > >> Before or after DevoXXUK? >> (before should work, but I highly doubt going back and forth multiple >> times would be easy for me if afterwards;-) >> >> >> >> >> On Thu, Apr 16, 2015 at 2:24 PM, Antonio Goncalves < >> antonio.goncalves at gmail.com> wrote: >> >>> Devoxx UK could be a nice target, WDYT ? RedHat has some offices in >>> London, no ? If some of us will be at Devoxx UK in June, why not have the >>> face-to-face meeting there on Saturday ? >>> >>> On Thu, Apr 16, 2015 at 2:12 PM, Werner Keil >>> wrote: >>> >>>> +1 >>>> Depending on how soon that F2F would be, Vienna sounded OK. I am in >>>> Northern Germany till late May, but then moving on to a more Central >>>> project... >>>> >>>> How many of you (I know at least Antoine will be there) come to DevoXX >>>> UK btw.? >>>> I have a speaking and Java track duty at DWX (Nuremberg also Central >>>> Europe) in the same week, so I have to commute between those places after >>>> the JCP EC F2F, but depending on who came to London on Tuesday, I'd be >>>> there till that afternoon. >>>> >>>> I know at least Anatole who has a talk on the Java track will be at >>>> DWX, too. He just spoke in Vienna, so while Brno may not be too far from >>>> there, it would require everyone outside Vienna or Prague to fly to either >>>> of these airports first and take a bus or train ;-| >>>> >>>> Werner >>>> >>>> On Thu, Apr 16, 2015 at 2:02 PM, >>>> wrote: >>>> >>>>> Send cdi-dev mailing list submissions to >>>>> cdi-dev at lists.jboss.org >>>>> >>>>> To subscribe or unsubscribe via the World Wide Web, visit >>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> or, via email, send a message with subject or body 'help' to >>>>> cdi-dev-request at lists.jboss.org >>>>> >>>>> You can reach the person managing the list at >>>>> cdi-dev-owner at lists.jboss.org >>>>> >>>>> When replying, please edit your Subject line so it is more specific >>>>> than "Re: Contents of cdi-dev digest..." >>>>> >>>>> >>>>> Today's Topics: >>>>> >>>>> 1. Re: Shutting down CDI Instances (Antonio Goncalves) >>>>> 2. Re: Best way to specify for spec that CDI contexts should be >>>>> available? (Antonio Goncalves) >>>>> 3. Re: Choosing a date for next CDI Face to Face meeting >>>>> (Antonio Goncalves) >>>>> 4. Re: More about SE/EE splitting (arjan tijms) >>>>> >>>>> >>>>> >>>>> ------------------------------ >>>>> >>>>> Message: 3 >>>>> Date: Thu, 16 Apr 2015 11:17:10 +0200 >>>>> From: Antonio Goncalves >>>>> Subject: Re: [cdi-dev] Choosing a date for next CDI Face to Face >>>>> meeting >>>>> To: Antoine Sabot-Durand >>>>> Cc: cdi-dev >>>>> Message-ID: >>>>> < >>>>> CA+ZZq9_+uHvRdJA6aNGXww5NE6PUBfWR4-NkquwAnTsUzVGKOQ at mail.gmail.com> >>>>> Content-Type: text/plain; charset="utf-8" >>>>> >>>>> Hi all, >>>>> >>>>> I'm catching up with emails, sorry... I have two questions : >>>>> >>>>> - why Brno ? It's quite a difficult place to go to (in terms of >>>>> transports). If you want to stay in Central Europe, what about >>>>> Vienna or >>>>> Prague ? >>>>> - why just one day ? If we do a face to face, why not target 2 days >>>>> ? We >>>>> could start work on a Friday morning, and end a Satuday evening. >>>>> Again, >>>>> that would be easier to do in Vienna or Prague as we could easily >>>>> fly there >>>>> on a Friday morning. >>>>> >>>>> >>>>> My 2 cents >>>>> Antonio >>>>> >>>>> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >>>>> antoine at sabot-durand.net> wrote: >>>>> >>>>> > Don't be shy. If you have concern with the date or other point let >>>>> me know. >>>>> > >>>>> > >>>>> > >>>>> > -- >>>>> > View this message in context: >>>>> > >>>>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>>>> > Sent from the CDI Development mailing list mailing list archive at >>>>> > Nabble.com. >>>>> > _______________________________________________ >>>>> > cdi-dev mailing list >>>>> > cdi-dev at lists.jboss.org >>>>> > https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> > >>>>> > Note that for all code provided on this list, the provider licenses >>>>> the >>>>> > code under the Apache License, Version 2 ( >>>>> > http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>> ideas >>>>> > provided on this list, the provider waives all patent and other >>>>> > intellectual property rights inherent in such information. >>>>> > >>>>> >>>>> ------------------------------ >>>>> >>>>> _______________________________________________ >>>>> cdi-dev mailing list >>>>> cdi-dev at lists.jboss.org >>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>>> >>>>> Note that for all code provided on this list, the provider licenses >>>>> the code under the Apache License, Version 2 ( >>>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other >>>>> ideas provided on this list, the provider waives all patent and other >>>>> intellectual property rights inherent in such information. >>>>> >>>>> End of cdi-dev Digest, Vol 53, Issue 16 >>>>> *************************************** >>>>> >>>> >>>> >>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>> >>> >>> >>> -- >>> Antonio Goncalves >>> Software architect, Java Champion and Pluralsight author >>> >>> Web site | Twitter >>> | LinkedIn >>> | Pluralsight >>> | Paris >>> JUG | Devoxx France >>> >> >> > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150416/e3e946c9/attachment.html From struberg at yahoo.de Thu Apr 16 08:53:05 2015 From: struberg at yahoo.de (Mark Struberg) Date: Thu, 16 Apr 2015 12:53:05 +0000 (UTC) Subject: [cdi-dev] More about SE/EE splitting In-Reply-To: References: Message-ID: <2058978205.3531507.1429188785118.JavaMail.yahoo@mail.yahoo.com> What Pete was pointing out is that the terminus 'Managed Bean' in CDI only is _one_ possible case of a Bean. This exactly only means classes which get scanned by the CDI container and picked up as Beans. A Producer Method of Field otoh is also a Bean, but _not_ a 'Managed Bean'. E.g. there are only Interceptors and Decorators for 'Managed Beans' atm (at least portably). Please not that this only got clarified in the CDI-1.1 spec as the 'bean' term in the CDI-1.0 spec meant lots of different things in a pretty much situation-dynamic way. :/ LieGrue, strub > On Thursday, 16 April 2015, 14:03, arjan tijms wrote: > > Hi, > > On Thu, Apr 16, 2015 at 9:25 AM, Antonio Goncalves > wrote: >> Managed Beans are already confusing.... turning it to "bean" can > be even >> more confusing. > > And what about the confusion that a "factory" for a type is also > called Bean? (Bean) > > Kind regards, > Arjan Tijms > > >> >> Antonio >> >> On Wed, Apr 15, 2015 at 5:08 PM, Pete Muir wrote: >>> >>> >>> > On 15 Apr 2015, at 13:31, Antoine Sabot-Durand >>> > wrote: >>> > >>> > Hi all, >>> > >>> > Rethinking of this task and reading the feedback on this, I really > think >>> > we should go step by step on this splitting. >>> > >>> > What I have produced here is a full extraction of EJB in the spec > to put >>> > it in EE part. >>> >>> Yes, this is a great start. >>> >>> > There are still Java EE references in core with EL, JSF, Servlet. >>> >>> I?m least worried about EL, most about JSF and Serlet. >>> >>> > >>> > The more problematic part is the Contexts chapter: hard to remove >>> > servlet ref without rewriting all... >>> > >>> > And yes, I did some rewording that could be no very nice. >>> > >>> > In some places I replaces "Managed Beans or Session > Beans" by the >>> > generic term "bean?. >>> >>> This is definitely not ok, as you expanded the scope of the sentence to >>> include built-in beans, producer methods, producer fields, and custom > beans. >>> I would suggest providing list of these changes, so we can review each > one. >>> >>> > Java EE component was replaced by component (yes, I'm not sure > it is >>> > very meaningful) >>> >>> I also think this is problematic. A Java EE component is a specific > thing. >>> I would suggest providing list of these changes, so we can review each > one. >>> >>> > >>> > In the EE part, I added changed all "session bean" > occurrences by "EJB >>> > session bean?. >>> >>> Ok, I don?t think this is a problem. >>> >>> > >>> > The step I see are: >>> > >>> > 0) Validate that we're all ok with the principle of splitting >>> > 1) validate that all EJB references are removed from core >>> > 2) Correct bad terminology that I introduced >>> > >>> > And then we should continue the splitting by rewriting the > contexts >>> > chapter and EL references in Core. >>> >>> +1 >>> >>> > >>> > Antoine >>> > _______________________________________________ >>> > cdi-dev mailing list >>> > cdi-dev at lists.jboss.org >>> > https://lists.jboss.org/mailman/listinfo/cdi-dev >>> > >>> > Note that for all code provided on this list, the provider > licenses the >>> > code under the Apache License, Version 2 >>> > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other > ideas >>> > provided on this list, the provider waives all patent and other > intellectual >>> > property rights inherent in such information. >>> >>> >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 >>> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other > intellectual >>> property rights inherent in such information. >> >> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the > code >> under the Apache License, Version 2 >> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other > intellectual >> property rights inherent in such information. > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code > under the Apache License, Version 2 > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided > on this list, the provider waives all patent and other intellectual property > rights inherent in such information. > From struberg at yahoo.de Thu Apr 16 08:58:40 2015 From: struberg at yahoo.de (Mark Struberg) Date: Thu, 16 Apr 2015 12:58:40 +0000 (UTC) Subject: [cdi-dev] Best way to specify for spec that CDI contexts should be available? In-Reply-To: References: Message-ID: <1524022840.4301549.1429189120088.JavaMail.yahoo@mail.yahoo.com> Aside from other aspects, the whole sentence is wrong or at least not complete: "An EJB packaged into a CDI bean archive and not annotated with javax.enterprise.inject.Vetoed annotation, is considered a CDI-enabled bean" This misses ProcessAnnotatedType#veto() and all kind of other things. E.g. dynamically removing the javax.ejb.Stateless annotation. Does this make the EJB not being picked up? In other words: does EJB utilize the changes done via CDI Extensions? LieGrue, strub On Thursday, 16 April 2015, 11:13, Antonio Goncalves wrote: > > >Hi Arjan, > > >Are you just wondering on how this should be expressed in the specification ? > > >If you look at most of the Java EE specs, there's often a "relationship to other specs" section (example Interceptor 1.2 "Relationship to Other Specifications"). > > >EJB has two sections (2.8 - Relationship to Managed Bean Specification and 2.9 - Relationship to Contexts and Dependency Injection (CDI). If you read the relation to CDI section, you see things like "An EJB packaged into a CDI bean archive and not annotated with javax.enterprise.inject.Vetoed annotation, is considered a CDI-enabled bean" > > >And, of course, most of the specs have a "Related Documents" section at the end that points to all the related specs. > > >Antonio > > > > >On Wed, Mar 25, 2015 at 3:54 PM, arjan tijms wrote: > >Hi, >> >> >>In the Security EG many proposals that are currently being discussed depend on CDI being available in authentication modules. >> >> >>Low level authentication modules do not necessarily have to be beans themselves, but they have to be able to programmatically pull beans from the bean manager, in order to be able to delegate certain authentication decisions to those. >> >> >>Now if I'm not mistaken, CDI is most often initialized per request via a ServletRequestListener (in a vendor specific way), so those obviously have to be invoked before an authentication module is invoked (which is a Servlet concern). >> >> >>On the other hand, the CDI spec defines when the request scope, session scope and application scope should be active, referencing other spec artifacts there. >> >> >>Furthermore, it seems the CDI 2.0 spec is also working on providing APIs for initializing CDI, but does that also take into account the per request initialization that CDI implementations currently do? Would this be powerful enough for code in an authentication module to initialize CDI itself, such that request- session- and application scoped beans can be pulled from the bean manager? >> >> >>And if the above would be possible, what would happen if an authentication module initialized the per request bits of CDI, and then afterwards (within the same request) the container would attempt to initialize CDI as it would normally do for usage in Servlets and Filters? >> >> >>So, what would be spec-wise and practically speaking the best way to specify that CDI should be available in authentication modules? >> >> >>Kind regards, >>Arjan Tijms >> >> >> >> >>_______________________________________________ >>cdi-dev mailing list >>cdi-dev at lists.jboss.org >>https://lists.jboss.org/mailman/listinfo/cdi-dev >> >>Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >> > > > >-- > >Antonio Goncalves >Software architect, Java Champion and Pluralsight author > >Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > >_______________________________________________ >cdi-dev mailing list >cdi-dev at lists.jboss.org >https://lists.jboss.org/mailman/listinfo/cdi-dev > >Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > From issues at jboss.org Sat Apr 18 17:04:20 2015 From: issues at jboss.org (Martin Andersson (JIRA)) Date: Sat, 18 Apr 2015 17:04:20 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-499) Firing events asynchronously In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060395#comment-13060395 ] Martin Andersson commented on CDI-499: -------------------------------------- h2. {{fireAsync()}} "Discussion is open *but*".. sounds like the discussion is not open =) Jos?s idea about an {{Executor}} is excellent. We talk about ONE method right? Easy to add, huge impact on the world. If you want "basic tasks", then why do we want to add an asynchronous feature to begin with? Jos?s point about being true to the nature of asynchronous Java API:s are undoubtedly a good one. Either don't implement the feature, or go all the way and deliver a great product. Time to step up our game if we want to compete with other technologies available on the market. I don't think {{asyncSupported()}} should default to {{false}}. It should default to {{true}}. Firstly, backward compatibility must not stand in the way of technology advances. That's kind of why the major release version become a number "2". And if I'm thinking clearly here, then {{true}}, which is without doubt (?) the most natural fit, does not break backward compatibility. Legacy code already call {{Event.fire()}}. If I write new and modern code and call {{Event.fireAsync()}}, then isn't it it my responsibility to make sure that if I use old event container types and thus target old observer methods, that the observer can handle asynchronicity? To put things in another perspective: An observer method that does *not* support asynchronicity is knowledgeable and dependent on who fired the event, how and where. He is dependent on a particular context. That sounds like a design smell to me. But, the one firing the event should have a saying if he want the call to be blocking or not. But imagine the confusion a default false would produce: calling {{fireAsyn()}} is most likely to actually block. Depends on the observer methods! Simply put it, the developer must scan through the entire code base every time to make sure his asynchronous request really will be honored. Even worse, he can never be sure that will always be the case. 5 minutes later, another developer add an observer method and will *by default* make all unknowingly asynchronous events of this type in the system turn synchronous. At best, this will have such an enormous impact on user experience and create large enough bottlenecks to be discovered. At worst, the application will slowly die a painful death as the number of parallell tasks going down the serialized lane increase. Simply put it, don't fix what's not broken. Letting the observer methods have a saying smells bad. Having a method be called {{fireAsync()}} but who in fact work nondeterministically smells even worse and can create all kinds of drama. I think {{asyncSupported}} should be dropped. If it must be in place, then let it by default be {{true}}. If so, it will be the one implementing the observer method that might destroy the application, not the unknowing poor guy who wrote the world's most beautiful code, thinking a method called {{fireAsync()}} actually work as advertised. As an example, I don't use {{@Asynchronous}} from EJB because of the nondeterministic behavior. I am not guaranteed that the container actually run my task. He might reject the task. And the way exception handling work in EJB (which is contrary to the spec's own design goal), I can never be sure that my portable application code can determine why the EJB call crashed. So basically, I must use {{ManagedExecutorService}} and be prepared to catch a {{RejectedExecutionException}}. So, EJB asynchronicity is dead and of no use for serious application code that want to be portable. Please don't make the same mistake with CDI. Oh you should also specify that fireAsync() might throw RejectedExecutionException? h2. {{asyncSupported}} To continue my "ranting" - or improvement ideas =) .. I see what might be a problem if asynchronous observer methods are prioritized, submitted before synchronous observers are called. Today, if a non-transactional observer method crash, then the event processing is aborted - no more observers called. But what if we already submitted asynchronous tasks to a queue somewhere, are they aborted? Are they guaranteed to be aborted if execution of the tasks has not begun when a synchronous observer crash? If we want to keep the "feature" that an observer method should be able to stop propagation, then asynchronous observers should be called ??after?? all synchronous observers has been called. OR be very clear in JavaDoc and in the new specification that it is *not defined* whether or not synchronous observers that crash stop event propagation to asynchronous observers. I understand that it is more pleasing to have the asynchronous tasks be submitted as fast as possible. And if I were the one designing the spec, then observer method crashes would not stop propagation. Instead, {{EventMetadata}} should have a method for that. To elaborate a bit on the backward compatibility, if CDI 2 really is supposed to be a new major release, we should take every chance we have to make improvements. Suppressed exceptions and say {{EventMetadata.stopPropagation()}} would be such a thing. Best of both worlds. Thank you all for you hard work. Asynchronocity is a major improvement. Let's go all the way and put together a killer product =) > Firing events asynchronously > ----------------------------- > > Key: CDI-499 > URL: https://issues.jboss.org/browse/CDI-499 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Events > Affects Versions: 1.2.Final > Reporter: Antoine Sabot-Durand > > We should allow a way to fire event asynchronously. This mechanism should leverage new async API in JDK8 especially the {{CompletionStage}} interface. > Our proposal is: > h2. 1. Add {{fireAsync()}} method to {{Event}} and {{BeanManager}} > Signature of the method on {{Event}} would be > {code:java} > CompletionStage fireAsync(U event); > {code} > Signature on {{BeanManager}} would be > {code:java} > CompletionStage fireAsyncEvent(T event, Annotation... qualifiers) > {code} > h2. 2. Add an {{asyncSupported()}} member to {{@Observes}} > For backward compatibility reason the possibility to invoke an observer asynchronously should be let to the observer (legacy observers should be called synchronously). We propose to add the boolean {{asyncSupported()}} member with the {{false}} default value to support this backward compatibility aspect. > So to be notified asynchronously an observer should have {{asyncSupported}} member to true. otherwise it will be called synchronously. > h2. 3. Observer bound to a transaction phase > these observer will be invoked in the right transaction phase but asynchronously > h2. 4. Event Ordering > Should we decide to add events ordering in CDI 2.0, the order will be keep in asynchronous observer notification. If there are a mix of synchronous and asynchronous observer, asynchronous will be called first in order, then synchronous in their order (async has priority on sync). > h2. 5. Event state (payload mutability) > We'll keep payload mutability with async events (but should explicitly specify it). That means that we should guarantee the event state consistency between observers and in case of ordered observers the fact that observer N+1 get the event state at the end of observer N. -- This message was sent by Atlassian JIRA (v6.3.11#6341) From mpaluch at paluch.biz Sun Apr 19 10:29:20 2015 From: mpaluch at paluch.biz (Mark Paluch) Date: Sun, 19 Apr 2015 16:29:20 +0200 Subject: [cdi-dev] CDI-4 Event observer ordering, spec additions Message-ID: <508F78F7-7077-46AF-A68A-A1E762C80143@paluch.biz> Hi all, I created a PR (https://github.com/cdi-spec/cdi/pull/242 ) to add Event observer ordering to the spec. A rendered version of the changes is available at https://www.dropbox.com/s/vnkh7agw4pz1waa/cdi-spec.html The change implies @Priority on parameters. Thanks for comments and feedback in advance. Best regards from sunny germany, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150419/9cff1725/attachment.html From antoine at sabot-durand.net Mon Apr 20 09:23:07 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Mon, 20 Apr 2015 15:23:07 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Hi Guys, After some internal discussion we agreed on point raised by Antonio. So we are thinking about having this community face to face meeting on 2 days (a Friday and Saturday) and in more central and convenient place in Europe. Candidate cities so far are: - Munich - Paris - Neuchatel Date proposed stay the same (with the Friday in bonus). We are still in decision process, but your feedback is welcome to see if it would have an impact on number of participants. So speak loud :-) Antoine > Le 16 avr. 2015 ? 11:17, Antonio Goncalves a ?crit : > > Hi all, > > I'm catching up with emails, sorry... I have two questions : > why Brno ? It's quite a difficult place to go to (in terms of transports). If you want to stay in Central Europe, what about Vienna or Prague ? > why just one day ? If we do a face to face, why not target 2 days ? We could start work on a Friday morning, and end a Satuday evening. Again, that would be easier to do in Vienna or Prague as we could easily fly there on a Friday morning. > > My 2 cents > Antonio > > On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand > wrote: > Don't be shy. If you have concern with the date or other point let me know. > > > > -- > View this message in context: http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html > Sent from the CDI Development mailing list mailing list archive at Nabble.com. > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/62e0fa91/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/62e0fa91/attachment.bin From antonio.goncalves at gmail.com Mon Apr 20 09:28:33 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Mon, 20 Apr 2015 15:28:33 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Good !!! 2 days will be good to exchange ideas and work all together (one day is a bit short). For me all the cities are ok, Neuchatel being my preference (nothing better than a bit of fresh air ;o) Antonio On Mon, Apr 20, 2015 at 3:23 PM, Antoine Sabot-Durand < antoine at sabot-durand.net> wrote: > Hi Guys, > > After some internal discussion we agreed on point raised by Antonio. > > So we are thinking about having this community face to face meeting on 2 > days (a Friday and Saturday) and in more central and convenient place in > Europe. > > Candidate cities so far are: > > - Munich > - Paris > - Neuchatel > > Date proposed stay the same (with the Friday in bonus). We are still in > decision process, but your feedback is welcome to see if it would have an > impact on number of participants. So speak loud :-) > > Antoine > > > Le 16 avr. 2015 ? 11:17, Antonio Goncalves > a ?crit : > > Hi all, > > I'm catching up with emails, sorry... I have two questions : > > - why Brno ? It's quite a difficult place to go to (in terms of > transports). If you want to stay in Central Europe, what about Vienna or > Prague ? > - why just one day ? If we do a face to face, why not target 2 days ? > We could start work on a Friday morning, and end a Satuday evening. Again, > that would be easier to do in Vienna or Prague as we could easily fly there > on a Friday morning. > > > My 2 cents > Antonio > > On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < > antoine at sabot-durand.net> wrote: > >> Don't be shy. If you have concern with the date or other point let me >> know. >> >> >> >> -- >> View this message in context: >> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >> Sent from the CDI Development mailing list mailing list archive at >> Nabble.com. >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > > > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/91cb84ba/attachment-0001.html From jose.paumard at gmail.com Mon Apr 20 10:25:06 2015 From: jose.paumard at gmail.com (=?UTF-8?Q?Jos=C3=A9_Paumard?=) Date: Mon, 20 Apr 2015 16:25:06 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Hello all, Paris has my preference! Jos? Le 20 avr. 2015 3:29 PM, "Antonio Goncalves" a ?crit : > Good !!! 2 days will be good to exchange ideas and work all together (one > day is a bit short). > > For me all the cities are ok, Neuchatel being my preference (nothing > better than a bit of fresh air ;o) > > Antonio > > On Mon, Apr 20, 2015 at 3:23 PM, Antoine Sabot-Durand < > antoine at sabot-durand.net> wrote: > >> Hi Guys, >> >> After some internal discussion we agreed on point raised by Antonio. >> >> So we are thinking about having this community face to face meeting on 2 >> days (a Friday and Saturday) and in more central and convenient place in >> Europe. >> >> Candidate cities so far are: >> >> - Munich >> - Paris >> - Neuchatel >> >> Date proposed stay the same (with the Friday in bonus). We are still in >> decision process, but your feedback is welcome to see if it would have an >> impact on number of participants. So speak loud :-) >> >> Antoine >> >> >> Le 16 avr. 2015 ? 11:17, Antonio Goncalves >> a ?crit : >> >> Hi all, >> >> I'm catching up with emails, sorry... I have two questions : >> >> - why Brno ? It's quite a difficult place to go to (in terms of >> transports). If you want to stay in Central Europe, what about Vienna or >> Prague ? >> - why just one day ? If we do a face to face, why not target 2 days ? >> We could start work on a Friday morning, and end a Satuday evening. Again, >> that would be easier to do in Vienna or Prague as we could easily fly there >> on a Friday morning. >> >> >> My 2 cents >> Antonio >> >> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >> antoine at sabot-durand.net> wrote: >> >>> Don't be shy. If you have concern with the date or other point let me >>> know. >>> >>> >>> >>> -- >>> View this message in context: >>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>> Sent from the CDI Development mailing list mailing list archive at >>> Nabble.com. >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter >> | LinkedIn >> | Pluralsight >> | Paris >> JUG | Devoxx France >> >> >> > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/0bc85602/attachment.html From thjanssen123 at gmail.com Mon Apr 20 10:33:00 2015 From: thjanssen123 at gmail.com (Thorben Janssen) Date: Mon, 20 Apr 2015 16:33:00 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Hi, I would prefer Munich. Paris would be my second pick. Neuchatel seems to be difficult to reach from Dresden, Germany. Regards, Thorben -- *Thorben Janssen* @thjanssen123 www.thoughts-on-java.org 2015-04-20 16:25 GMT+02:00 Jos? Paumard : > Hello all, > > Paris has my preference! > > Jos? > Le 20 avr. 2015 3:29 PM, "Antonio Goncalves" > a ?crit : > >> Good !!! 2 days will be good to exchange ideas and work all together (one >> day is a bit short). >> >> For me all the cities are ok, Neuchatel being my preference (nothing >> better than a bit of fresh air ;o) >> >> Antonio >> >> On Mon, Apr 20, 2015 at 3:23 PM, Antoine Sabot-Durand < >> antoine at sabot-durand.net> wrote: >> >>> Hi Guys, >>> >>> After some internal discussion we agreed on point raised by Antonio. >>> >>> So we are thinking about having this community face to face meeting on 2 >>> days (a Friday and Saturday) and in more central and convenient place in >>> Europe. >>> >>> Candidate cities so far are: >>> >>> - Munich >>> - Paris >>> - Neuchatel >>> >>> Date proposed stay the same (with the Friday in bonus). We are still in >>> decision process, but your feedback is welcome to see if it would have an >>> impact on number of participants. So speak loud :-) >>> >>> Antoine >>> >>> >>> Le 16 avr. 2015 ? 11:17, Antonio Goncalves >>> a ?crit : >>> >>> Hi all, >>> >>> I'm catching up with emails, sorry... I have two questions : >>> >>> - why Brno ? It's quite a difficult place to go to (in terms of >>> transports). If you want to stay in Central Europe, what about Vienna or >>> Prague ? >>> - why just one day ? If we do a face to face, why not target 2 days >>> ? We could start work on a Friday morning, and end a Satuday evening. >>> Again, that would be easier to do in Vienna or Prague as we could easily >>> fly there on a Friday morning. >>> >>> >>> My 2 cents >>> Antonio >>> >>> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >>> antoine at sabot-durand.net> wrote: >>> >>>> Don't be shy. If you have concern with the date or other point let me >>>> know. >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>>> Sent from the CDI Development mailing list mailing list archive at >>>> Nabble.com. >>>> _______________________________________________ >>>> cdi-dev mailing list >>>> cdi-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>>> >>>> Note that for all code provided on this list, the provider licenses the >>>> code under the Apache License, Version 2 ( >>>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>>> provided on this list, the provider waives all patent and other >>>> intellectual property rights inherent in such information. >>>> >>> >>> >>> >>> -- >>> Antonio Goncalves >>> Software architect, Java Champion and Pluralsight author >>> >>> Web site | Twitter >>> | LinkedIn >>> | Pluralsight >>> | Paris >>> JUG | Devoxx France >>> >>> >>> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter >> | LinkedIn >> | Pluralsight >> | Paris >> JUG | Devoxx France >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/8b10b096/attachment.html From struberg at yahoo.de Mon Apr 20 10:47:43 2015 From: struberg at yahoo.de (Mark Struberg) Date: Mon, 20 Apr 2015 16:47:43 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: +1 for Munich, Vienna, Praha or Brno ;) LieGrue, strub > Am 20.04.2015 um 16:33 schrieb Thorben Janssen : > > Hi, > > I would prefer Munich. Paris would be my second pick. Neuchatel seems to be difficult to reach from Dresden, Germany. > > Regards, > Thorben > > -- > Thorben Janssen > > @thjanssen123 > www.thoughts-on-java.org > > 2015-04-20 16:25 GMT+02:00 Jos? Paumard : > Hello all, > > Paris has my preference! > > Jos? > > Le 20 avr. 2015 3:29 PM, "Antonio Goncalves" a ?crit : > Good !!! 2 days will be good to exchange ideas and work all together (one day is a bit short). > > For me all the cities are ok, Neuchatel being my preference (nothing better than a bit of fresh air ;o) > > Antonio > > On Mon, Apr 20, 2015 at 3:23 PM, Antoine Sabot-Durand wrote: > Hi Guys, > > After some internal discussion we agreed on point raised by Antonio. > > So we are thinking about having this community face to face meeting on 2 days (a Friday and Saturday) and in more central and convenient place in Europe. > > Candidate cities so far are: > > - Munich > - Paris > - Neuchatel > > Date proposed stay the same (with the Friday in bonus). We are still in decision process, but your feedback is welcome to see if it would have an impact on number of participants. So speak loud :-) > > Antoine > > >> Le 16 avr. 2015 ? 11:17, Antonio Goncalves a ?crit : >> >> Hi all, >> >> I'm catching up with emails, sorry... I have two questions : >> ? why Brno ? It's quite a difficult place to go to (in terms of transports). If you want to stay in Central Europe, what about Vienna or Prague ? >> ? why just one day ? If we do a face to face, why not target 2 days ? We could start work on a Friday morning, and end a Satuday evening. Again, that would be easier to do in Vienna or Prague as we could easily fly there on a Friday morning. >> >> My 2 cents >> Antonio >> >> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand wrote: >> Don't be shy. If you have concern with the date or other point let me know. >> >> >> >> -- >> View this message in context: http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >> Sent from the CDI Development mailing list mailing list archive at Nabble.com. >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. >> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From issues at jboss.org Mon Apr 20 13:31:18 2015 From: issues at jboss.org (Martin Andersson (JIRA)) Date: Mon, 20 Apr 2015 13:31:18 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-520) 3.6. Java EE components In-Reply-To: References: Message-ID: Martin Andersson created CDI-520: ------------------------------------ Summary: 3.6. Java EE components Key: CDI-520 URL: https://issues.jboss.org/browse/CDI-520 Project: CDI Specification Issues Issue Type: Clarification Components: Java EE integration Affects Versions: 1.1.Final Reporter: Martin Andersson I don't understand this text: "The instance used by the container to service an invocation of a Java EE component will not be the same instance obtained when using @Inject, instantiated by the container to invoke a producer method, observer method or disposer method, or instantiated by the container to access the value of a producer field." More specifically, I am trying to understand how we can use CDI to put a scope on {{EntityManager}} whose life cycle is rather undefined by JPA. I see that the specification use an example of a {{@Disposes}} method to close a container-managed entity manager which throw {{IllegalStateException}} in the disposer (!). Anyways, trying to solve this puzzle has led me to the paragraph quoted previously, of which I understand nothing to be honest. My research about the "CDI managed container-managed entity manager" continues. As of now, the example is flawed and a container-managed entity manager remains open after the disposer method. Anyways, I might open up a separate ticket for that. -- This message was sent by Atlassian JIRA (v6.3.11#6341) From antoine at sabot-durand.net Mon Apr 20 15:33:54 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Mon, 20 Apr 2015 21:33:54 +0200 Subject: [cdi-dev] Unavailable for tomorrow meeting Message-ID: Hi All, I won?t be available for tomorrow meeting. Let?s meet next week (apr 29th) Regards, Antoine -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150420/f63c820d/attachment.bin From john.d.ament at gmail.com Mon Apr 20 20:41:27 2015 From: john.d.ament at gmail.com (John D. Ament) Date: Tue, 21 Apr 2015 00:41:27 +0000 Subject: [cdi-dev] CDI-26 PR Opened Message-ID: All, I've opened a PR for CDI-26, CDI SE Bootstrap support. Please review. I think I got all of the issues found from the original proposals. https://github.com/cdi-spec/cdi/pull/243 I may not be at tomorrow's meeting, But please do provide me some input and I'll address. John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150421/a8c96ec9/attachment.html From atsticks at gmail.com Fri Apr 24 18:43:51 2015 From: atsticks at gmail.com (Anatole Tresch) Date: Sat, 25 Apr 2015 00:43:51 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Hi all of course, Neuchatel would be preferred, since it is in Switzerland (in the heart of Europe), Munich is doable as well, whereas Paris (sorry Antonio) is my least preferred variant. Best Anatole 2015-04-20 15:23 GMT+02:00 Antoine Sabot-Durand : > Hi Guys, > > After some internal discussion we agreed on point raised by Antonio. > > So we are thinking about having this community face to face meeting on 2 > days (a Friday and Saturday) and in more central and convenient place in > Europe. > > Candidate cities so far are: > > - Munich > - Paris > - Neuchatel > > Date proposed stay the same (with the Friday in bonus). We are still in > decision process, but your feedback is welcome to see if it would have an > impact on number of participants. So speak loud :-) > > Antoine > > > Le 16 avr. 2015 ? 11:17, Antonio Goncalves > a ?crit : > > Hi all, > > I'm catching up with emails, sorry... I have two questions : > > - why Brno ? It's quite a difficult place to go to (in terms of > transports). If you want to stay in Central Europe, what about Vienna or > Prague ? > - why just one day ? If we do a face to face, why not target 2 days ? > We could start work on a Friday morning, and end a Satuday evening. Again, > that would be easier to do in Vienna or Prague as we could easily fly there > on a Friday morning. > > > My 2 cents > Antonio > > On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < > antoine at sabot-durand.net> wrote: > >> Don't be shy. If you have concern with the date or other point let me >> know. >> >> >> >> -- >> View this message in context: >> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >> Sent from the CDI Development mailing list mailing list archive at >> Nabble.com. >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | Paris > JUG | Devoxx France > > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- *Anatole Tresch* Java Engineer & Architect, JSR Spec Lead Gl?rnischweg 10 CH - 8620 Wetzikon *Switzerland, Europe Zurich, GMT+1* *Twitter: @atsticks* *Blogs: **http://javaremarkables.blogspot.ch/ * *Google: atsticksMobile +41-76 344 62 79* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150425/4ab313d2/attachment.html From antonio.goncalves at gmail.com Sat Apr 25 06:33:39 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Sat, 25 Apr 2015 12:33:39 +0200 Subject: [cdi-dev] Choosing a date for next CDI Face to Face meeting In-Reply-To: References: <5BF5FCD9-FBF2-4A46-AB8F-0335C2618BB8@sabot-durand.net> <1426775904740-5711245.post@n5.nabble.com> Message-ID: Oh, I'm more than happy with Neuchatel (or Munich) Antonio Le 25 avr. 2015 00:44, "Anatole Tresch" a ?crit : > Hi all > > of course, Neuchatel would be preferred, since it is in Switzerland (in > the heart of Europe), Munich is doable as well, whereas Paris (sorry > Antonio) is my least preferred variant. > > Best > Anatole > > > 2015-04-20 15:23 GMT+02:00 Antoine Sabot-Durand > : > >> Hi Guys, >> >> After some internal discussion we agreed on point raised by Antonio. >> >> So we are thinking about having this community face to face meeting on 2 >> days (a Friday and Saturday) and in more central and convenient place in >> Europe. >> >> Candidate cities so far are: >> >> - Munich >> - Paris >> - Neuchatel >> >> Date proposed stay the same (with the Friday in bonus). We are still in >> decision process, but your feedback is welcome to see if it would have an >> impact on number of participants. So speak loud :-) >> >> Antoine >> >> >> Le 16 avr. 2015 ? 11:17, Antonio Goncalves >> a ?crit : >> >> Hi all, >> >> I'm catching up with emails, sorry... I have two questions : >> >> - why Brno ? It's quite a difficult place to go to (in terms of >> transports). If you want to stay in Central Europe, what about Vienna or >> Prague ? >> - why just one day ? If we do a face to face, why not target 2 days ? >> We could start work on a Friday morning, and end a Satuday evening. Again, >> that would be easier to do in Vienna or Prague as we could easily fly there >> on a Friday morning. >> >> >> My 2 cents >> Antonio >> >> On Thu, Mar 19, 2015 at 3:38 PM, Antoine Sabot-Durand < >> antoine at sabot-durand.net> wrote: >> >>> Don't be shy. If you have concern with the date or other point let me >>> know. >>> >>> >>> >>> -- >>> View this message in context: >>> http://cdi-development-mailing-list.1064426.n5.nabble.com/Choosing-a-date-for-next-CDI-Face-to-Face-meeting-tp5711199p5711245.html >>> Sent from the CDI Development mailing list mailing list archive at >>> Nabble.com. >>> _______________________________________________ >>> cdi-dev mailing list >>> cdi-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/cdi-dev >>> >>> Note that for all code provided on this list, the provider licenses the >>> code under the Apache License, Version 2 ( >>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >>> provided on this list, the provider waives all patent and other >>> intellectual property rights inherent in such information. >>> >> >> >> >> -- >> Antonio Goncalves >> Software architect, Java Champion and Pluralsight author >> >> Web site | Twitter >> | LinkedIn >> | Pluralsight >> | Paris >> JUG | Devoxx France >> >> >> >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. >> > > > > -- > *Anatole Tresch* > Java Engineer & Architect, JSR Spec Lead > Gl?rnischweg 10 > CH - 8620 Wetzikon > > *Switzerland, Europe Zurich, GMT+1* > *Twitter: @atsticks* > *Blogs: **http://javaremarkables.blogspot.ch/ > * > > *Google: atsticksMobile +41-76 344 62 79 <%2B41-76%20344%2062%2079>* > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150425/4ff0b0ea/attachment-0001.html From antoine at sabot-durand.net Mon Apr 27 09:13:15 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Mon, 27 Apr 2015 15:13:15 +0200 Subject: [cdi-dev] Feedback on PR 242 (event ordering) Message-ID: <7DB8CE89-9279-4841-9AC6-490ED752B778@sabot-durand.net> Hi Mark, Back from my vacation and moto trip. I just posted my feedback on your PR : https://github.com/cdi-spec/cdi/pull/242. I agree with all points raised by Jozef and added mention about observers ordering in extension I encourage others to do their feedback as well. Anyway, thanks for your PR, always nice to see new contributor for the spec. Antoine -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150427/bb1d5c17/attachment.bin From jharting at redhat.com Mon Apr 27 10:57:05 2015 From: jharting at redhat.com (Jozef Hartinger) Date: Mon, 27 Apr 2015 16:57:05 +0200 Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 Message-ID: <553E4E41.7020200@redhat.com> We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. The main feature is a new builder for programmatic configuration of managed classes, packages, enabled interceptors and others. This could serve as a draft for the bootstrap API to be added to CDI. See the release blog post for more details: http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ Jozef From antonio.goncalves at gmail.com Mon Apr 27 17:36:48 2015 From: antonio.goncalves at gmail.com (Antonio Goncalves) Date: Mon, 27 Apr 2015 23:36:48 +0200 Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 In-Reply-To: <553E4E41.7020200@redhat.com> References: <553E4E41.7020200@redhat.com> Message-ID: Hi Josef, Which Maven artifact is needed to start playing with it ? When I use this one below, I miss all the CDI APIs (javax.inject.*, javax.enterprise.inject.*, etc.) : org.jboss.weld.se weld-se-core 3.0.0.Alpha8 Is there an artifact that also depends on the new version of the API ? Or we just use the "old" CDI 1.2 APIs ? Thanks Antonio On Mon, Apr 27, 2015 at 4:57 PM, Jozef Hartinger wrote: > We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. > The main feature is a new builder for programmatic configuration of > managed classes, packages, enabled interceptors and others. This could > serve as a draft for the bootstrap API to be added to CDI. > > See the release blog post for more details: > http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ > > Jozef > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150427/8f86e63b/attachment.html From ggastald at redhat.com Mon Apr 27 21:11:41 2015 From: ggastald at redhat.com (George Gastaldi) Date: Mon, 27 Apr 2015 21:11:41 -0400 (EDT) Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 In-Reply-To: References: <553E4E41.7020200@redhat.com> Message-ID: <1929806698.5131219.1430183501574.JavaMail.zimbra@redhat.com> Hi Antonio, There is no CDI 2.0 API yet, so you must use the CDI 1.2 that is fetch transitively using the dependency you mentioned. AFAIK the new features are implemented using the "Experimental" prefix in the Weld JARs. Best Regards, George Gastaldi ----- Mensagem original ----- De: "Antonio Goncalves" Para: "Jozef Hartinger" Cc: "Weld" , "cdi-dev" Enviadas: Segunda-feira, 27 de abril de 2015 18:36:48 Assunto: Re: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 Hi Josef, Which Maven artifact is needed to start playing with it ? When I use this one below, I miss all the CDI APIs (javax.inject.*, javax.enterprise.inject.*, etc.) : org.jboss.weld.se weld-se-core 3.0.0.Alpha8 Is there an artifact that also depends on the new version of the API ? Or we just use the "old" CDI 1.2 APIs ? Thanks Antonio On Mon, Apr 27, 2015 at 4:57 PM, Jozef Hartinger < jharting at redhat.com > wrote: We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. The main feature is a new builder for programmatic configuration of managed classes, packages, enabled interceptors and others. This could serve as a draft for the bootstrap API to be added to CDI. See the release blog post for more details: http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ Jozef _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From jharting at redhat.com Tue Apr 28 01:58:23 2015 From: jharting at redhat.com (Jozef Hartinger) Date: Tue, 28 Apr 2015 07:58:23 +0200 Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 In-Reply-To: References: <553E4E41.7020200@redhat.com> Message-ID: <553F217F.8040001@redhat.com> Hi Antonio, the artifact you mentioned is correct. The CDI API 1.2, which is transitively resolved, is correct also. The builder API is present in the Weld-specific org.jboss.weld.environment.se package. HTH, Jozef On 04/27/2015 11:36 PM, Antonio Goncalves wrote: > Hi Josef, > > Which Maven artifact is needed to start playing with it ? When I use > this one below, I miss all the CDI APIs (javax.inject.*, > javax.enterprise.inject.*, etc.) : > > > org.jboss.weld.se > > weld-se-core > 3.0.0.Alpha8 > > > Is there an artifact that also depends on the new version of the API ? > Or we just use the "old" CDI 1.2 APIs ? > > Thanks > Antonio > > > On Mon, Apr 27, 2015 at 4:57 PM, Jozef Hartinger > wrote: > > We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. > The main feature is a new builder for programmatic configuration of > managed classes, packages, enabled interceptors and others. This could > serve as a draft for the bootstrap API to be added to CDI. > > See the release blog post for more details: > http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ > > Jozef > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider > licenses the code under the Apache License, Version 2 > (http://www.apache.org/licenses/LICENSE-2.0.html). For all other > ideas provided on this list, the provider waives all patent and > other intellectual property rights inherent in such information. > > > > > -- > Antonio Goncalves > Software architect, Java Champion and Pluralsight author > > Web site | Twitter > | LinkedIn > | Pluralsight > | > Paris JUG | Devoxx France -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/b47ed998/attachment.html From john.d.ament at gmail.com Tue Apr 28 11:49:41 2015 From: john.d.ament at gmail.com (John D. Ament) Date: Tue, 28 Apr 2015 15:49:41 +0000 Subject: [cdi-dev] Not at today's meeting Message-ID: Sorry guys, something came up. I'm hoping to get to the PR comments for the SE bootstrap today/tomorrow. John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/7e112cd3/attachment.html From antoine at sabot-durand.net Tue Apr 28 13:57:47 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Tue, 28 Apr 2015 19:57:47 +0200 Subject: [cdi-dev] Update on Java EE/SE split Message-ID: <67CD68BB-3A3D-470B-9141-8FD39010453C@sabot-durand.net> Hi all, I corrected some points on the split in https://github.com/cdi-spec/cdi/pull/241 There are still things to correct. I?ll do a recap this week. After discussing with Pete, I renamed the first part to CDI core and introduced a new part for Java SE. So the spec is now: - CDI Core (feature present in SE and EE) - CDI in SE (will contains SE bootstrap and specific bean discovery stuff) - CDI in EE The new spec draft is available here : https://dl.dropboxusercontent.com/u/2898173/cdi-spec.html I?ll continue working on it this week, but your feedback and proposal to improve this split is always welcome. Antoine -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/6561977c/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/6561977c/attachment-0001.bin From struberg at yahoo.de Tue Apr 28 14:56:28 2015 From: struberg at yahoo.de (Mark Struberg) Date: Tue, 28 Apr 2015 20:56:28 +0200 Subject: [cdi-dev] @Destroyed(ApplicationScoped.class) Message-ID: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> Hi! The CDI-1.2 spec says in 6.7.3: ?An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired when the application is destroyed. " Now from the pure wording (?IS initialized?, ?IS destroyed?) I?d say that both events must be fired _after_ the state is reached. Means _after_ the context got initialized and _after_ the context got destroyed. Means an observer like @ApplicationScoped public class MyBean { public void endIt(@Observes @Destroyed(ApplicationScoped.class) endObject) { doSomething() } } will _never_ get invoked. Because the bean (and the whole context) will be already killed? You can observe this event in a @Singleton scoped bean, but not in an @ApplicationScoped bean. If you like to do _that_, then simply use a @PreDestroy. Do others share this interpretation? Do we need to clarify anything? LieGrue, strub From john.d.ament at gmail.com Tue Apr 28 15:00:43 2015 From: john.d.ament at gmail.com (John D. Ament) Date: Tue, 28 Apr 2015 19:00:43 +0000 Subject: [cdi-dev] @Destroyed(ApplicationScoped.class) In-Reply-To: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> References: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> Message-ID: Your understanding matches my understanding, and matches what I typically tell people to do (use @PreDestroy). I think this is more of a use case for lower scopes, or for a dependent bean (which I would imagine would receive this event, though I can't say I've tried). John On Tue, Apr 28, 2015 at 2:56 PM Mark Struberg wrote: > Hi! > > The CDI-1.2 spec says in 6.7.3: > > ?An event with qualifier @Initialized(ApplicationScoped.class) is fired > when the application context is initialized and an event with qualifier > @Destroyed(ApplicationScoped.class) is fired when the application is > destroyed. " > > Now from the pure wording (?IS initialized?, ?IS destroyed?) I?d say that > both events must be fired _after_ the state is reached. Means _after_ the > context got initialized and _after_ the context got destroyed. > > Means an observer like > > @ApplicationScoped > public class MyBean { > public void endIt(@Observes @Destroyed(ApplicationScoped.class) > endObject) { > doSomething() > } > } > > will _never_ get invoked. > Because the bean (and the whole context) will be already killed? > > You can observe this event in a @Singleton scoped bean, but not in an > @ApplicationScoped bean. > If you like to do _that_, then simply use a @PreDestroy. > > Do others share this interpretation? Do we need to clarify anything? > > LieGrue, > strub > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/49551e68/attachment.html From rmannibucau at gmail.com Tue Apr 28 16:14:23 2015 From: rmannibucau at gmail.com (Romain Manni-Bucau) Date: Tue, 28 Apr 2015 22:14:23 +0200 Subject: [cdi-dev] @Destroyed(ApplicationScoped.class) In-Reply-To: References: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> Message-ID: Tcks check this event is "accessible" which is important otherwise it is just useless What is not well defined is integration with other parts of ee. Le 28 avr. 2015 21:00, "John D. Ament" a ?crit : > Your understanding matches my understanding, and matches what I typically > tell people to do (use @PreDestroy). > > I think this is more of a use case for lower scopes, or for a dependent > bean (which I would imagine would receive this event, though I can't say > I've tried). > > John > > On Tue, Apr 28, 2015 at 2:56 PM Mark Struberg wrote: > >> Hi! >> >> The CDI-1.2 spec says in 6.7.3: >> >> ?An event with qualifier @Initialized(ApplicationScoped.class) is fired >> when the application context is initialized and an event with qualifier >> @Destroyed(ApplicationScoped.class) is fired when the application is >> destroyed. " >> >> Now from the pure wording (?IS initialized?, ?IS destroyed?) I?d say that >> both events must be fired _after_ the state is reached. Means _after_ the >> context got initialized and _after_ the context got destroyed. >> >> Means an observer like >> >> @ApplicationScoped >> public class MyBean { >> public void endIt(@Observes @Destroyed(ApplicationScoped.class) >> endObject) { >> doSomething() >> } >> } >> >> will _never_ get invoked. >> Because the bean (and the whole context) will be already killed? >> >> You can observe this event in a @Singleton scoped bean, but not in an >> @ApplicationScoped bean. >> If you like to do _that_, then simply use a @PreDestroy. >> >> Do others share this interpretation? Do we need to clarify anything? >> >> LieGrue, >> strub >> _______________________________________________ >> cdi-dev mailing list >> cdi-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/cdi-dev >> >> Note that for all code provided on this list, the provider licenses the >> code under the Apache License, Version 2 ( >> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas >> provided on this list, the provider waives all patent and other >> intellectual property rights inherent in such information. > > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the > code under the Apache License, Version 2 ( > http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas > provided on this list, the provider waives all patent and other > intellectual property rights inherent in such information. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150428/5b4a7ead/attachment.html From mjremijan at yahoo.com Tue Apr 28 21:24:47 2015 From: mjremijan at yahoo.com (Michael Remijan) Date: Wed, 29 Apr 2015 01:24:47 +0000 (UTC) Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 In-Reply-To: <553F217F.8040001@redhat.com> References: <553E4E41.7020200@redhat.com> <553F217F.8040001@redhat.com> Message-ID: <1458360409.116140.1430270687255.JavaMail.yahoo@mail.yahoo.com> Hi cdi-dev, I'm developing an SE application using Weld and I just pulled in the?3.0.0.Alpha8 version. ?I immediately ran into an Unsupported major.minor version 52.0 error. ?Is Weld 3 going to be only Java 8? ?Java 7 apps won't be able to use it? Thanks! ? On Tuesday, April 28, 2015 12:59 AM, Jozef Hartinger wrote: Hi Antonio, the artifact you mentioned is correct. The CDI API 1.2, which is transitively resolved, is correct also. The builder API is present in the Weld-specific org.jboss.weld.environment.se package. HTH, Jozef On 04/27/2015 11:36 PM, Antonio Goncalves wrote: Hi Josef, Which Maven artifact is needed to start playing with it ? When I use this one below, I miss all the CDI APIs (javax.inject.*, javax.enterprise.inject.*, etc.) : ? ? ? ? ? ? ? ? ? ? ? ? ? ? org.jboss.weld.se ? ? ? ? ? ? ? ? weld-se-core ? ? ? ? ? ? ? ? 3.0.0.Alpha8 ? ? ? ? ? ? Is there an artifact that also depends on the new version of the API ? Or we just use the "old" CDI 1.2 APIs ? Thanks Antonio On Mon, Apr 27, 2015 at 4:57 PM, Jozef Hartinger wrote: We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. The main feature is a new builder for programmatic configuration of managed classes, packages, enabled interceptors and others. This could serve as a draft for the bootstrap API to be added to CDI. See the release blog post for more details: http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ Jozef _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site?|?Twitter |?LinkedIn?| Pluralsight?|?Paris JUG?| Devoxx France _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150429/a87cfa84/attachment-0001.html From ggastald at redhat.com Tue Apr 28 23:11:21 2015 From: ggastald at redhat.com (George Gastaldi) Date: Tue, 28 Apr 2015 23:11:21 -0400 (EDT) Subject: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 In-Reply-To: <1458360409.116140.1430270687255.JavaMail.yahoo@mail.yahoo.com> References: <553E4E41.7020200@redhat.com> <553F217F.8040001@redhat.com> <1458360409.116140.1430270687255.JavaMail.yahoo@mail.yahoo.com> Message-ID: <825978676.5523168.1430277081751.JavaMail.zimbra@redhat.com> Hi Michael, That is correct. Weld 3 and CDI 2.0 are Java 8+, given the new proposed API changes (usage of CompletableFuture and because JDK 7 is EOL?ed). Java 7 apps should use CDI 1.2. Best Regards, George Gastaldi ----- Mensagem original ----- De: "Michael Remijan" Para: "Jozef Hartinger" , "Antonio Goncalves" Cc: "Weld" , "cdi-dev" Enviadas: Ter?a-feira, 28 de abril de 2015 22:24:47 Assunto: Re: [cdi-dev] Bootstrap API in Weld 3.0.0.Alpha8 Hi cdi-dev, I'm developing an SE application using Weld and I just pulled in the 3.0.0.Alpha8 version. I immediately ran into an Unsupported major.minor version 52.0 error. Is Weld 3 going to be only Java 8? Java 7 apps won't be able to use it? Thanks! On Tuesday, April 28, 2015 12:59 AM, Jozef Hartinger wrote: Hi Antonio, the artifact you mentioned is correct. The CDI API 1.2, which is transitively resolved, is correct also. The builder API is present in the Weld-specific org.jboss.weld.environment.se package. HTH, Jozef On 04/27/2015 11:36 PM, Antonio Goncalves wrote: Hi Josef, Which Maven artifact is needed to start playing with it ? When I use this one below, I miss all the CDI APIs (javax.inject.*, javax.enterprise.inject.*, etc.) : org.jboss.weld.se weld-se-core 3.0.0.Alpha8 Is there an artifact that also depends on the new version of the API ? Or we just use the "old" CDI 1.2 APIs ? Thanks Antonio On Mon, Apr 27, 2015 at 4:57 PM, Jozef Hartinger < jharting at redhat.com > wrote: We extended Weld's API for Java SE in the recent 3.0.0.Alpha8 release. The main feature is a new builder for programmatic configuration of managed classes, packages, enabled interceptors and others. This could serve as a draft for the bootstrap API to be added to CDI. See the release blog post for more details: http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/ Jozef _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -- Antonio Goncalves Software architect, Java Champion and Pluralsight author Web site | Twitter | LinkedIn | Pluralsight | Paris JUG | Devoxx France _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 ( http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From antoine at sabot-durand.net Wed Apr 29 05:10:36 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Wed, 29 Apr 2015 11:10:36 +0200 Subject: [cdi-dev] yesterday meeting Message-ID: <9281D47F-E86F-4A29-9F7C-DD61C6B4A784@sabot-durand.net> Hi all, In yesterday meeting we discuss about ordering event proposal. Meeting summary is here: http://transcripts.jboss.org/meeting/irc.freenode.org/cdi-dev/2015/cdi-dev.2015-04-28-16.06.html Antoine -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150429/e667435c/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150429/e667435c/attachment.bin From antonin at stefanutti.fr Wed Apr 29 05:23:04 2015 From: antonin at stefanutti.fr (Antonin Stefanutti) Date: Wed, 29 Apr 2015 09:23:04 +0000 Subject: [cdi-dev] @Destroyed(ApplicationScoped.class) In-Reply-To: References: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> , Message-ID: <1430299325651.63678@stefanutti.fr> Hi, That somehow relates to the BeforeShutdown lifecycle event which must be fired after the container has finished processing requests and destroyed all contexts. IMO, it would make sense / be useful to be able to execute logic on ApplicationScoped beans from within extensions before they are about to be "destroyed". In the example from the specification (and consistently with other lifecycle events), one can retrieve a reference to the bean manager: void beforeShutdown(@Observes BeforeShutdown event, BeanManager manager) { ... } While that is not clearly stated in the specification (as opposed to the clarification done in version 1.2 for events like AfterBeanDiscovery and AfterDeploymentValidation), I induce that methods like getReference are supposed to systematically throw ContextNotActiveException. To still meet the need, that is external control over ApplicationScoped bean destruction without relying on the @PreDestroy callback nor disposer method, an intermediate lifecycle event may be introduced, similarly to @Initializing / @Destroying(ApplicationScoped.class). Interestingly enough, the specification states that the application scope is active [...] when the disposer method or @PreDestroy callback of any bean with any normal scope other than @ApplicationScoped is called, which tends to validate John's "lower scopes" hypothesis. For the information, calling BeanManager.getReference in BeforeShutdown actually works in Weld 2.x (I haven't tested that use case in OWB). Antonin ________________________________ From: cdi-dev-bounces at lists.jboss.org on behalf of Romain Manni-Bucau Sent: Tuesday, April 28, 2015 10:14 PM To: John D. Ament Cc: cdi-dev at lists.jboss.org Subject: Re: [cdi-dev] @Destroyed(ApplicationScoped.class) Tcks check this event is "accessible" which is important otherwise it is just useless What is not well defined is integration with other parts of ee. Le 28 avr. 2015 21:00, "John D. Ament" > a ?crit : Your understanding matches my understanding, and matches what I typically tell people to do (use @PreDestroy). I think this is more of a use case for lower scopes, or for a dependent bean (which I would imagine would receive this event, though I can't say I've tried). John On Tue, Apr 28, 2015 at 2:56 PM Mark Struberg > wrote: Hi! The CDI-1.2 spec says in 6.7.3: ?An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired when the application is destroyed. " Now from the pure wording (?IS initialized?, ?IS destroyed?) I?d say that both events must be fired _after_ the state is reached. Means _after_ the context got initialized and _after_ the context got destroyed. Means an observer like @ApplicationScoped public class MyBean { public void endIt(@Observes @Destroyed(ApplicationScoped.class) endObject) { doSomething() } } will _never_ get invoked. Because the bean (and the whole context) will be already killed? You can observe this event in a @Singleton scoped bean, but not in an @ApplicationScoped bean. If you like to do _that_, then simply use a @PreDestroy. Do others share this interpretation? Do we need to clarify anything? LieGrue, strub _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. _______________________________________________ cdi-dev mailing list cdi-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/cdi-dev Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150429/bdf8b038/attachment.html From issues at jboss.org Wed Apr 29 05:25:53 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 05:25:53 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-521) Create a Prioritized Interface for SPI element that have a priority In-Reply-To: References: Message-ID: Antoine Sabot-Durand created CDI-521: ---------------------------------------- Summary: Create a Prioritized Interface for SPI element that have a priority Key: CDI-521 URL: https://issues.jboss.org/browse/CDI-521 Project: CDI Specification Issues Issue Type: Feature Request Components: Concepts Affects Versions: 1.2.Final Reporter: Antoine Sabot-Durand With the addition of ordering in Observer (CDI-4), we have a collection of element in SPI that could benefit having a {{getPriority()}} method: * {{ObserverMethod}} * {{Bean}} to be able to read alternative priority and give priority for {{Decorator}} and {{Interceptor}} Any other place? -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 05:25:53 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 05:25:53 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-521) Create a Prioritized Interface for SPI element that have a priority In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-521: ------------------------------------- Fix Version/s: 2.0 (discussion) > Create a Prioritized Interface for SPI element that have a priority > -------------------------------------------------------------------- > > Key: CDI-521 > URL: https://issues.jboss.org/browse/CDI-521 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Concepts > Affects Versions: 1.2.Final > Reporter: Antoine Sabot-Durand > Fix For: 2.0 (discussion) > > > With the addition of ordering in Observer (CDI-4), we have a collection of element in SPI that could benefit having a {{getPriority()}} method: > * {{ObserverMethod}} > * {{Bean}} to be able to read alternative priority and give priority for {{Decorator}} and {{Interceptor}} > Any other place? -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 05:49:52 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 05:49:52 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-522) Create add method setObserver() to ProcessObserverMethod SPI event In-Reply-To: References: Message-ID: Antoine Sabot-Durand created CDI-522: ---------------------------------------- Summary: Create add method setObserver() to ProcessObserverMethod SPI event Key: CDI-522 URL: https://issues.jboss.org/browse/CDI-522 Project: CDI Specification Issues Issue Type: Feature Request Components: Events Affects Versions: 1.2.Final Reporter: Antoine Sabot-Durand Right now {{ObserverMethod}} cannot be change in an extension. In the philosophy of {{ProcessAnnotatedType#setAnnotatedType}} or {{ProcessBeanAttributes#setBeanAttributes}} we could add a {{ProcessObserverMethod#setObserverMethod}} to change properties on an observer. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From mjremijan at yahoo.com Wed Apr 29 09:05:18 2015 From: mjremijan at yahoo.com (Michael Remijan) Date: Wed, 29 Apr 2015 13:05:18 +0000 (UTC) Subject: [cdi-dev] Using StartMain Message-ID: <1498470936.366753.1430312718912.JavaMail.yahoo@mail.yahoo.com> cdi-dev, With the SE Bootstrap standardization in works, I wondering if?org.jboss.weld.environment.se.StartMain is still going to be supported, or, possibly something similar added to the CDI api itself. ?Having a standard way to bootstrap CDI is great but?org.jboss.weld.environment.se.StartMain is even better because I'd say in most cases I don't want to start the container myself I just want it up, running, and available for use in my application. Just a thought.? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150429/15fb34b9/attachment.html From issues at jboss.org Wed Apr 29 10:08:47 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 10:08:47 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-522) Create add method setObserver() to ProcessObserverMethod SPI event In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-522: ------------------------------------- Fix Version/s: 2.0 (discussion) > Create add method setObserver() to ProcessObserverMethod SPI event > ------------------------------------------------------------------ > > Key: CDI-522 > URL: https://issues.jboss.org/browse/CDI-522 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Events > Affects Versions: 1.2.Final > Reporter: Antoine Sabot-Durand > Fix For: 2.0 (discussion) > > > Right now {{ObserverMethod}} cannot be change in an extension. In the philosophy of {{ProcessAnnotatedType#setAnnotatedType}} or {{ProcessBeanAttributes#setBeanAttributes}} we could add a {{ProcessObserverMethod#setObserverMethod}} to change properties on an observer. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 10:12:45 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 10:12:45 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-520) 3.6. Java EE components In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-520: ------------------------------------- Fix Version/s: TBD > 3.6. Java EE components > ----------------------- > > Key: CDI-520 > URL: https://issues.jboss.org/browse/CDI-520 > Project: CDI Specification Issues > Issue Type: Clarification > Components: Java EE integration > Affects Versions: 1.1.Final > Reporter: Martin Andersson > Fix For: TBD > > > I don't understand this text: > "The instance used by the container to service an invocation of a Java EE component will not be the same instance obtained when using @Inject, instantiated by the container to invoke a producer method, observer method or disposer method, or instantiated by the container to access the value of a producer field." > More specifically, I am trying to understand how we can use CDI to put a scope on {{EntityManager}} whose life cycle is rather undefined by JPA. I see that the specification use an example of a {{@Disposes}} method to close a container-managed entity manager which throw {{IllegalStateException}} in the disposer (!). Anyways, trying to solve this puzzle has led me to the paragraph quoted previously, of which I understand nothing to be honest. > My research about the "CDI managed container-managed entity manager" continues. As of now, the example is flawed and a container-managed entity manager remains open after the disposer method. Anyways, I might open up a separate ticket for that. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From struberg at yahoo.de Wed Apr 29 10:37:36 2015 From: struberg at yahoo.de (Mark Struberg) Date: Wed, 29 Apr 2015 16:37:36 +0200 Subject: [cdi-dev] @Destroyed(ApplicationScoped.class) In-Reply-To: <1430299325651.63678@stefanutti.fr> References: <31788D90-EAD9-45B9-BBE2-DBEAB91291BB@yahoo.de> <1430299325651.63678@stefanutti.fr> Message-ID: <4DA5F548-AB28-494F-8A82-95AD8AB153F4@yahoo.de> Hi Antonin! BeforeShutdown is a system event and thus must only be observed by Extensions. You can do what you intended by simply listening to @PreDestroy in any @ApplicationScoped bean. > For the information, calling BeanManager.getReference in BeforeShutdown actually works in Weld 2.x (I haven?t tested that use case in OWB). I expect this to work in OWB as well. The spec is slightly ambiguous when it comes to the ApplicationContext. On the one hand it defines that if only must be started after AfterDeploymentValidation and shut down before BeforeShutdown. But then again all Extensions are provided as @ApplicationScoped beans and you can inject those in any Extensions Observer Method and even send events between them. But that requires the ApplicationContext to be active way earlier resp longer. Both those functions are afaik even TCK tested. LieGrue, strub > Am 29.04.2015 um 11:23 schrieb Antonin Stefanutti : > > Hi, > > That somehow relates to the BeforeShutdown lifecycle event which must be fired after the container has finished processing requests and destroyed all contexts. > > IMO, it would make sense / be useful to be able to execute logic on ApplicationScoped beans from within extensions before they are about to be "destroyed". > > In the example from the specification (and consistently with other lifecycle events), one can retrieve a reference to the bean manager: > > void beforeShutdown(@Observes BeforeShutdown event, BeanManager manager) { ... } > > While that is not clearly stated in the specification (as opposed to the clarification done in version 1.2 for events like AfterBeanDiscovery and AfterDeploymentValidation), I induce that methods likegetReference are supposed to systematically throw ContextNotActiveException. > > To still meet the need, that is external control over ApplicationScoped bean destruction without relying on the @PreDestroy callback nor disposer method, an intermediate lifecycle event may be introduced, similarly to @Initializing / @Destroying(ApplicationScoped.class). Interestingly enough, the specification states that the application scope is active [...] when the disposer method or @PreDestroy callback of any bean with any normal scope other than @ApplicationScoped is called, which tends to validate John's "lower scopes" hypothesis. > > For the information, calling BeanManager.getReference in BeforeShutdown actually works in Weld 2.x (I haven't tested that use case in OWB). > > Antonin > From: cdi-dev-bounces at lists.jboss.org on behalf of Romain Manni-Bucau > Sent: Tuesday, April 28, 2015 10:14 PM > To: John D. Ament > Cc: cdi-dev at lists.jboss.org > Subject: Re: [cdi-dev] @Destroyed(ApplicationScoped.class) > > Tcks check this event is "accessible" which is important otherwise it is just useless > What is not well defined is integration with other parts of ee. > Le 28 avr. 2015 21:00, "John D. Ament" a ?crit : > Your understanding matches my understanding, and matches what I typically tell people to do (use @PreDestroy). > > I think this is more of a use case for lower scopes, or for a dependent bean (which I would imagine would receive this event, though I can't say I've tried). > > John > > On Tue, Apr 28, 2015 at 2:56 PM Mark Struberg wrote: > Hi! > > The CDI-1.2 spec says in 6.7.3: > > ?An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired when the application is destroyed. " > > Now from the pure wording (?IS initialized?, ?IS destroyed?) I?d say that both events must be fired _after_ the state is reached. Means _after_ the context got initialized and _after_ the context got destroyed. > > Means an observer like > > @ApplicationScoped > public class MyBean { > public void endIt(@Observes @Destroyed(ApplicationScoped.class) endObject) { > doSomething() > } > } > > will _never_ get invoked. > Because the bean (and the whole context) will be already killed? > > You can observe this event in a @Singleton scoped bean, but not in an @ApplicationScoped bean. > If you like to do _that_, then simply use a @PreDestroy. > > Do others share this interpretation? Do we need to clarify anything? > > LieGrue, > strub > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. > _______________________________________________ > cdi-dev mailing list > cdi-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/cdi-dev > > Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information. From issues at jboss.org Wed Apr 29 10:56:45 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 10:56:45 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-520) 3.6. Java EE components In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13063950#comment-13063950 ] Antoine Sabot-Durand commented on CDI-520: ------------------------------------------ If you're interested by relations between CDI and EntityManager, you are reading the wrong section. Section 3.6 deals with Java Components like: * Servlet, * Interceptor, * JPA, Entity Listener, * etc... (see table EE5.1 in Java EE 7 spec to have the complete list) These components support injecting CDI beans but are not recommended to be injected or to define producers, disposers or observer methods. I agree that the sentence is not very clear. Regarding your needs, you have to study section [3.7 Resources|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources] since EntityManager is eligible to this notion of resources. As you can read in this part {quote} The container is not required to support resources with scope other than @Dependent. Portable applications should not define resources with any scope other than @Dependent. {quote} so you should try to put a scope on your produced `EntityManager`... What would be your use case anyway? > 3.6. Java EE components > ----------------------- > > Key: CDI-520 > URL: https://issues.jboss.org/browse/CDI-520 > Project: CDI Specification Issues > Issue Type: Clarification > Components: Java EE integration > Affects Versions: 1.1.Final > Reporter: Martin Andersson > Fix For: TBD > > > I don't understand this text: > "The instance used by the container to service an invocation of a Java EE component will not be the same instance obtained when using @Inject, instantiated by the container to invoke a producer method, observer method or disposer method, or instantiated by the container to access the value of a producer field." > More specifically, I am trying to understand how we can use CDI to put a scope on {{EntityManager}} whose life cycle is rather undefined by JPA. I see that the specification use an example of a {{@Disposes}} method to close a container-managed entity manager which throw {{IllegalStateException}} in the disposer (!). Anyways, trying to solve this puzzle has led me to the paragraph quoted previously, of which I understand nothing to be honest. > My research about the "CDI managed container-managed entity manager" continues. As of now, the example is flawed and a container-managed entity manager remains open after the disposer method. Anyways, I might open up a separate ticket for that. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:26:45 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:26:45 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-519) Instance.destroy() cannot be used for dependent bean instances not created by the same Instance object In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13063968#comment-13063968 ] Antoine Sabot-Durand commented on CDI-519: ------------------------------------------ what do you suggest? # to forbid this or, # to explicitly state that {{Instance}} can be used to destroy any dependent scoped bean instance of T. In your example if we go for 1, there will be no solution to destroy the instance you requested thru {{CDI}} > Instance.destroy() cannot be used for dependent bean instances not created by the same Instance object > ------------------------------------------------------------------------------------------------------ > > Key: CDI-519 > URL: https://issues.jboss.org/browse/CDI-519 > Project: CDI Specification Issues > Issue Type: Clarification > Affects Versions: 1.2.Final > Reporter: Martin Kouba > > 5.6.1. The Instance interface: > {quote} > The method destroy() instructs the container to destroy the instance. The bean instance passed to destroy() should be *a dependent scoped bean instance*, or... > {quote} > I think this should be more obvious. E.g. this wouldn't work correctly even though it doesn't violate the spec: > {code:java} > @Dependent > class Bar { > } > class Foo { > @Inject > Instance instance; > void ping() { > instance.destroy(CDI.current().select(Bar.class).get()); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:40:46 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:40:46 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-516) Firing events with dynamic parameterized types In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-516: ------------------------------------- Affects Version/s: 1.2.Final > Firing events with dynamic parameterized types > ---------------------------------------------- > > Key: CDI-516 > URL: https://issues.jboss.org/browse/CDI-516 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Events > Affects Versions: 1.2.Final > Reporter: Antonin Stefanutti > Fix For: 2.0 (discussion) > > > For the time being, either by using {{Event.select(...)}}, respectively {{BeanManager.fireEvent(...)}}, it is not possible to fire an event whose runtime type is a dynamic parameterized type, as specified in [The {{Event}} interface|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#event]: > {quote} > If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. > If the runtime type of the event object contains an unresolvable type variable, an {{IllegalArgumentException}} is thrown. > {quote} > Respectively in [Firing an event|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bm_fire_event]: > {quote} > If the runtime type of the event object contains a type variable, an {{IllegalArgumentException}} is thrown. > {quote} > While, it is possible to pass a {{TypeLiteral}} to the {{Event.select(...)}} method, e.g.: > {code} > @Inject > Event event; > event.select(new TypeLiteral() {}); > {code} > It is not possible to pass a type variable known at runtime as the {{TypeLiteral}} class relies on the declared type variable and does not permit to override that behavior as the {{TypeLiteral.getType()}} method is declared {{final}}. > Yet, there are use cases where that need is valid, for example: > {code} > CdiEventEndpoint cdiEventEndpoint(InjectionPoint ip, CamelContext context, @Any Event event) throws Exception { > // Represents the runtime type for T > Type type = ((ParameterizedType) ip.getType()).getActualTypeArguments()[0]; > String uri = endpointUri(type, ip.getQualifiers()); > if (context.hasEndpoint(uri) == null) { > // Work around to pass the dynamic type > TypeLiteral literal = new TypeLiteral() {}; > for (Field field : TypeLiteral.class.getDeclaredFields()) { > if (field.getType().equals(Type.class)) { > field.setAccessible(true); > field.set(literal, type); > break; > } > } > // Here we used the dynamic type > Event typedEvent = event.select(literal, ip.getQualifiers().toArray(new Annotation[ip.getQualifiers().size()])); > context.addEndpoint(uri, new CdiEventEndpoint<>(typedEvent, uri, context)); > } > return CamelContextHelper.getMandatoryEndpoint(context, uri, CdiEventEndpoint.class); > } > {code} > In the example above, the {{TypeLiteral}} class could have a constructor taking the dynamic type as argument. > Another alternative would be to enrich the {{BeanManager}} SPI with the following method: > {code} > public void fireEvent(Object event, Type type, Annotation... qualifiers); > {code} > That use case is taken from the [CDI event Camel endpoint|https://github.com/astefanutti/camel-cdi/blob/84426570bcd7815eb98f87b07739aa9ddfc44191/impl/src/main/java/org/apache/camel/cdi/CdiCamelFactory.java#L91] in the [Camel CDI extension|https://github.com/astefanutti/camel-cdi]. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:40:46 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:40:46 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-516) Firing events with dynamic parameterized types In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-516: ------------------------------------- Fix Version/s: 2.0 (discussion) > Firing events with dynamic parameterized types > ---------------------------------------------- > > Key: CDI-516 > URL: https://issues.jboss.org/browse/CDI-516 > Project: CDI Specification Issues > Issue Type: Feature Request > Components: Events > Affects Versions: 1.2.Final > Reporter: Antonin Stefanutti > Fix For: 2.0 (discussion) > > > For the time being, either by using {{Event.select(...)}}, respectively {{BeanManager.fireEvent(...)}}, it is not possible to fire an event whose runtime type is a dynamic parameterized type, as specified in [The {{Event}} interface|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#event]: > {quote} > If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. > If the runtime type of the event object contains an unresolvable type variable, an {{IllegalArgumentException}} is thrown. > {quote} > Respectively in [Firing an event|http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bm_fire_event]: > {quote} > If the runtime type of the event object contains a type variable, an {{IllegalArgumentException}} is thrown. > {quote} > While, it is possible to pass a {{TypeLiteral}} to the {{Event.select(...)}} method, e.g.: > {code} > @Inject > Event event; > event.select(new TypeLiteral() {}); > {code} > It is not possible to pass a type variable known at runtime as the {{TypeLiteral}} class relies on the declared type variable and does not permit to override that behavior as the {{TypeLiteral.getType()}} method is declared {{final}}. > Yet, there are use cases where that need is valid, for example: > {code} > CdiEventEndpoint cdiEventEndpoint(InjectionPoint ip, CamelContext context, @Any Event event) throws Exception { > // Represents the runtime type for T > Type type = ((ParameterizedType) ip.getType()).getActualTypeArguments()[0]; > String uri = endpointUri(type, ip.getQualifiers()); > if (context.hasEndpoint(uri) == null) { > // Work around to pass the dynamic type > TypeLiteral literal = new TypeLiteral() {}; > for (Field field : TypeLiteral.class.getDeclaredFields()) { > if (field.getType().equals(Type.class)) { > field.setAccessible(true); > field.set(literal, type); > break; > } > } > // Here we used the dynamic type > Event typedEvent = event.select(literal, ip.getQualifiers().toArray(new Annotation[ip.getQualifiers().size()])); > context.addEndpoint(uri, new CdiEventEndpoint<>(typedEvent, uri, context)); > } > return CamelContextHelper.getMandatoryEndpoint(context, uri, CdiEventEndpoint.class); > } > {code} > In the example above, the {{TypeLiteral}} class could have a constructor taking the dynamic type as argument. > Another alternative would be to enrich the {{BeanManager}} SPI with the following method: > {code} > public void fireEvent(Object event, Type type, Annotation... qualifiers); > {code} > That use case is taken from the [CDI event Camel endpoint|https://github.com/astefanutti/camel-cdi/blob/84426570bcd7815eb98f87b07739aa9ddfc44191/impl/src/main/java/org/apache/camel/cdi/CdiCamelFactory.java#L91] in the [Camel CDI extension|https://github.com/astefanutti/camel-cdi]. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:42:46 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:42:46 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-518) Clarify boundaries of the ServletContext event In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-518: ------------------------------------- Fix Version/s: 2.0 (discussion) > Clarify boundaries of the ServletContext event > ---------------------------------------------- > > Key: CDI-518 > URL: https://issues.jboss.org/browse/CDI-518 > Project: CDI Specification Issues > Issue Type: Clarification > Components: Events > Reporter: Jozef Hartinger > Fix For: 2.0 (discussion) > > > {quote} > An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application > context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired > when the application is destroyed. The event payload is: > ? the ServletContext if the application is a web application deployed to a Servlet container, or Conversation context lifecycle > ? any java.lang.Object for other types of application. > {quote} > Unlike dependency injection, the spec does not define any visibility boundaries for events. It could therefore be implied that in an EAR a web application could observe the ServletContext event for a different web application. This obviously does not seem right and the spec should explicitly define the expected behavior. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:43:45 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:43:45 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-518) Clarify boundaries of the ServletContext event In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-518: ------------------------------------- Affects Version/s: 1.2.Final > Clarify boundaries of the ServletContext event > ---------------------------------------------- > > Key: CDI-518 > URL: https://issues.jboss.org/browse/CDI-518 > Project: CDI Specification Issues > Issue Type: Clarification > Components: Events > Affects Versions: 1.2.Final > Reporter: Jozef Hartinger > Fix For: 2.0 (discussion) > > > {quote} > An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application > context is initialized and an event with qualifier @Destroyed(ApplicationScoped.class) is fired > when the application is destroyed. The event payload is: > ? the ServletContext if the application is a web application deployed to a Servlet container, or Conversation context lifecycle > ? any java.lang.Object for other types of application. > {quote} > Unlike dependency injection, the spec does not define any visibility boundaries for events. It could therefore be implied that in an EAR a web application could observe the ServletContext event for a different web application. This obviously does not seem right and the spec should explicitly define the expected behavior. -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:53:45 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:53:45 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-515) Allow to obtain Bean metadata from javax.enterprise.inject.Instance In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-515: ------------------------------------- Fix Version/s: 2.0 (discussion) > Allow to obtain Bean metadata from javax.enterprise.inject.Instance > ------------------------------------------------------------------- > > Key: CDI-515 > URL: https://issues.jboss.org/browse/CDI-515 > Project: CDI Specification Issues > Issue Type: Feature Request > Affects Versions: 1.2.Final > Reporter: Martin Kouba > Fix For: 2.0 (discussion) > > > Sometimes it might be useful to obtain Bean metadata from the {{javax.enterprise.inject.Instance}} (similarly as 5.5.8. Bean metadata). The method could be named {{getBean()}} and should have similar restrictions like {{get()}} (e.g. throw {{UnsatisfiedResolutionException}} if appropriate). -- This message was sent by Atlassian JIRA (v6.3.15#6346) From issues at jboss.org Wed Apr 29 11:53:46 2015 From: issues at jboss.org (Antoine Sabot-Durand (JIRA)) Date: Wed, 29 Apr 2015 11:53:46 -0400 (EDT) Subject: [cdi-dev] [JBoss JIRA] (CDI-515) Allow to obtain Bean metadata from javax.enterprise.inject.Instance In-Reply-To: References: Message-ID: [ https://issues.jboss.org/browse/CDI-515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Antoine Sabot-Durand updated CDI-515: ------------------------------------- Affects Version/s: 1.2.Final > Allow to obtain Bean metadata from javax.enterprise.inject.Instance > ------------------------------------------------------------------- > > Key: CDI-515 > URL: https://issues.jboss.org/browse/CDI-515 > Project: CDI Specification Issues > Issue Type: Feature Request > Affects Versions: 1.2.Final > Reporter: Martin Kouba > Fix For: 2.0 (discussion) > > > Sometimes it might be useful to obtain Bean metadata from the {{javax.enterprise.inject.Instance}} (similarly as 5.5.8. Bean metadata). The method could be named {{getBean()}} and should have similar restrictions like {{get()}} (e.g. throw {{UnsatisfiedResolutionException}} if appropriate). -- This message was sent by Atlassian JIRA (v6.3.15#6346) From antoine at sabot-durand.net Thu Apr 30 06:58:06 2015 From: antoine at sabot-durand.net (Antoine Sabot-Durand) Date: Thu, 30 Apr 2015 12:58:06 +0200 Subject: [cdi-dev] Spec doc generation and work simplification Message-ID: <23B6D549-EB5E-49E2-9B7E-8E8FF20FEE9E@sabot-durand.net> Hi all, I just brought simplification to spec generation (one maven module instead of 4) and added some tools to ease the work on spec writing. Just check spec/README.adoc -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150430/19a3c052/attachment.bin