Return-Path: X-Original-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A8219AD1 for ; Wed, 29 Feb 2012 11:38:26 +0000 (UTC) Received: (qmail 24394 invoked by uid 500); 29 Feb 2012 11:38:26 -0000 Delivered-To: apmail-incubator-deltaspike-dev-archive@incubator.apache.org Received: (qmail 24366 invoked by uid 500); 29 Feb 2012 11:38:26 -0000 Mailing-List: contact deltaspike-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-dev@incubator.apache.org Delivered-To: mailing list deltaspike-dev@incubator.apache.org Received: (qmail 24357 invoked by uid 99); 29 Feb 2012 11:38:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:38:26 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mkouba@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:38:22 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1TBc0FD014220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Feb 2012 06:38:00 -0500 Received: from [10.36.7.178] (vpn1-7-178.ams2.redhat.com [10.36.7.178]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1TBbwlQ025119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Feb 2012 06:38:00 -0500 Message-ID: <4F4E0E16.2010103@redhat.com> Date: Wed, 29 Feb 2012 12:37:58 +0100 From: Martin Kouba User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: deltaspike-dev@incubator.apache.org Subject: Re: CdiControl in Java EE? References: <1330501987.47796.YahooMailNeo@web171511.mail.ir2.yahoo.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Checked: Checked by ClamAV on apache.org Hi, +1 to 2.) as using RequestScoped beans during job execution seems to me pretty useful. AFAIK Seam Cron does not support request context during job execution [1]. +1 to "some kind of Context-Control to the CDI-1.1 spec". Right now similar integration requires CDI impl specific code which is not very practical. BTW my own simple Quartz integration experiment is using Weld API to handle this [2]. Mark: TISS Quartz Extension? Google didn't find anything :-). Is the source available somewhere? [1] https://issues.jboss.org/browse/SEAMCRON-6 [2] https://github.com/symbiont/cdiqi Martin Dne 29.2.2012 09:06, Jason Porter napsal(a): > All sounds good to me. > > We could try to get Peter Royal to explain Seam 3 Cron, but I'm not sure > what his availability is. > > On Wed, Feb 29, 2012 at 00:53, Mark Struberg wrote: > >> Hi! >> >> Pete did ask me a few days ago if the CdiContainer is really only targeted >> to JavaSE. >> Well, basically it _was_. But yesterday I reviewed the 3 Quartz Extensions >> from Ronald, OpenKnowledge and Seam3 and when looking at the first 2 I saw >> that >> >> 1.) OpenKnowledge introduces an own Context named @ThreadScoped and start >> it manually in the newly started Quartz thread. >> >> 2.) our TISS Quartz Extension (done by Ronald) uses OWB specific code to >> start a RequestScope for the newly started thread in which Quartz runs. >> >> I've not looked into the Seam3 extension in detail because it does a hell >> lot more and I'm not sure if we really need all that. A few things look >> really good but I didn't have enough time to plug them apart. >> >> What are the pros and cons of 1.) and 2.) so far? >> 1.) is CDI container independent but you must not use @RequestScoped >> because this Context is not active in the new thread. You can use the new >> @ThreadScoped but if you use the same @Transactional services for the >> Quartz job and the rest of your app, then you must not use a @RequestScoped >> EntityManager. >> >> >> 2.) Sharing the services between the Quartz job and the rest of the app is >> perfectly fine but it's currently Container specific how the @RequestScoped >> can get activated for a freshly created thread. >> >> >> And then Pete's words jumped into my head. >> >> >> So, what about using the CdiContainer#startContext(RequestScoped.class); >> in that CDI Extension? >> That looks pretty much perfect to me! >> >> We could also provide multiple impls, e.g for: WeldSE, WeldEE, OwbSE, >> OwbEE, ResinEE, >> >> Anyone could easily implement the control part himself if the standard >> container integration doesn't work out of the box for a certain EE >> container. >> If e.g. OwbEE will not work on WebSphere-8.0.2, then its easy to just >> write an own! >> >> >> >> wdyt? >> >> LieGrue, >> strub >> >> >> PS: Pete we might add some kind of Context-Control to the CDI-1.1 spec, >> wdyt? >> >> > >