Return-Path: X-Original-To: apmail-deltaspike-users-archive@www.apache.org Delivered-To: apmail-deltaspike-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D588104CE for ; Tue, 16 Jul 2013 05:19:22 +0000 (UTC) Received: (qmail 69505 invoked by uid 500); 16 Jul 2013 05:19:21 -0000 Delivered-To: apmail-deltaspike-users-archive@deltaspike.apache.org Received: (qmail 69473 invoked by uid 500); 16 Jul 2013 05:19:18 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 69465 invoked by uid 99); 16 Jul 2013 05:19:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 05:19:16 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [106.10.148.117] (HELO nm3-vm6.bullet.mail.sg3.yahoo.com) (106.10.148.117) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jul 2013 05:19:10 +0000 Received: from [106.10.166.113] by nm3.bullet.mail.sg3.yahoo.com with NNFMP; 16 Jul 2013 05:18:26 -0000 Received: from [106.10.167.168] by tm2.bullet.mail.sg3.yahoo.com with NNFMP; 16 Jul 2013 05:18:26 -0000 Received: from [127.0.0.1] by smtp141.mail.sg3.yahoo.com with NNFMP; 16 Jul 2013 05:18:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.cn; s=s1024; t=1373951906; bh=E1b1OI3fwgXN4JiOGBZsk5tgoHbQNF4HggGcFzi5QTk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Antivirus:X-Antivirus-Status; b=Jz7D+b6EA20jebcyOqT2FSPmUpnzAcZ+LbihxseAULyCaFUiFbbTYpJx2TimhZaTTyEE6N6MQavSUdyBv/l/CQi3ptCekbgXriKqUOG5ARw1uJUKOwFGJCO79wNANZLkHxD+veMNOCr6X7To8YX9c+f2lGe36kIlZ4JRYMWXGMU= X-Yahoo-Newman-Id: 182704.55285.bm@smtp141.mail.sg3.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8r.yU30VM1lSrJfvuPK5dpHDB8CqiSe51HhBGZkbMNHx5NR IedaAr9bAM70hz9lZHhkcGheykUpT4e8OXXsoY9z4XO0WgfYSthocUbyocDr jiVHMCqILySJCfSI_TaZEI3vFAfByvKrqgTaZ5rcJspsLoE4Cb5vxlRz4xlE 8im7l6_3MrHzDLXka7IySEE42vq1i8mzs3iBKbnjigARwB1MqSWdaC8L5j09 _FnqlqY.kMC1r0ZKsqNSTRJJUUrjw2lZWFHeHGrxkbHPW9lDsHeSlfIP7D3b i3Bjde9DHlQZiRs3zYlxehWFlxiX2Iqax57Au6xnVmEdmeVjIfzxBdYGvvI. rF0hQZOeV27fpHULXvTL6m1N9ljPhxMe._gXn0GTkEmIZ2U_WUow8imtwb_i fghijRRavx2OocF1pnCw7rL.JZKYamAbedeKXghLavQQCwiyyKvfh.8FFmn0 N5xV..rmN3V51IyuAEEdoftJOBRq3AduOsFTSw1eH93D26KGy_lUYaSbYnjC bJnq1E2E0XwsnCZEP4SG8wALV.FVaOJTjiIRb9KKXw3V7XUu_.x2x.aq.6F6 PYRFwmoCHRMB0pZAPi2j5Cu3SGL9F.TrGJwt0IWbnUHZo12ePG1nyjWDC2h5 7BR3B_mK1KUju4tOMmHtFY3qkopAeOcNgkdtgIGpr9A94YjwMvvAFxEHKdx7 UQzGw8SsPpOxKVl7prUk0NI0TOBZNqMmFNor0KkJuy8twWh5q9D9XQMq.wNQ sM.hQDGdRN6Cmm1a8zXD8FJOkVvHausm1x0PuNdH2ygqLtESZEUCobaJJW6I QozDX43c03L_nJ9utREH5gdQm.PRfwvyEqzgCk0BysVPcPLU4imJpJivgSbL WelnW3LFTBEO6ewSKn61Wtq5yijjRtUMLNO5NlrRMeVlC1km7Pg-- X-Yahoo-SMTP: f3_8n0KswBDjlT7eh7FoS3fxyw-- X-Rocket-Received: from [127.0.0.1] (hantsy@219.137.7.182 with ) by smtp141.mail.sg3.yahoo.com with SMTP; 15 Jul 2013 22:18:26 -0700 PDT Message-ID: <51E4D780.5090507@yahoo.com.cn> Date: Tue, 16 Jul 2013 13:17:52 +0800 From: hantsy User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: users@deltaspike.apache.org Subject: Re: Eager Instantiation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 130715-1, 07/16/2013), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Spring provides two ApplicationInitializer, one for web application. Seam 3 also provides such features via CDI events observers...but as the sample in the Seam 3 Booking example, the dependent resources is not ready when event is fired. How to overcome this issue? how to make sure the @Startup and @Shutdown beans inject resources freely as others. And we should consider the difference of the initialization event of a web application, ejb module, ear application, jee client application? How to resolve the resource dependencies of at the Startup phase...make lazy beans be instantiated early automatically? Hantsy On 7/16/2013 12:58, Christian Kaltepoth wrote: > Hey Harald, > > I agree with John. Using the initialization event for the ServletContext > could be an alternative for your. Have a look at this test case that shows > how to observe the event: > > https://github.com/apache/deltaspike/blob/master/deltaspike/modules/servlet/impl/src/test/java/org/apache/deltaspike/test/servlet/impl/event/context/ServletContextEventsObserver.java#L41 > > Christian > > > > 2013/7/15 John D. Ament > >> Hi Harald, >> >> You can emulate this functionality using servlet events. See: >> >> https://github.com/apache/deltaspike/blob/master/deltaspike/modules/servlet/impl/src/main/java/org/apache/deltaspike/servlet/impl/event/EventBridgeContextListener.java#L36 >> >> Does this help you? Unfortunately there's no easy way to do this with just >> CDI. >> >> John >> >> >> On Mon, Jul 15, 2013 at 12:02 PM, Harald Wellmann >> wrote: >>> Thanks for checking - I've created a feature request: >>> https://issues.apache.org/jira/browse/DELTASPIKE-393 >>> >>> Best regards, >>> Harald >>> >>> >>> 2013/7/15 Jason Porter : >>>> To my knowledge there isn't anything like that in the code base >>> currently, >>>> though what Dan has in that gist you mentioned would certainly be a >>> simple >>>> and portable solution. >>>> >>>> >>>> On Mon, Jul 15, 2013 at 8:31 AM, Harald Wellmann < >> hwellmann.de@gmail.com >>>> wrote: >>>> >>>>> Does DeltaSpike include support for eager instantiation of >>>>> @ApplicationScoped beans? >>>>> >>>>> E.g. like https://gist.github.com/mojavelinux/635719/ >>>>> >>>>> The following discussion is related: >>>>> >>>>> >> http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Startup-like-td4653932.html >>>>> I'm just wondering if a solution has found its way into the codebase >>> yet... >>>>> Best regards, >>>>> Harald >>>>> >>>> >>>> >>>> -- >>>> Jason Porter >>>> http://en.gravatar.com/lightguardjp > >