Return-Path: Delivered-To: apmail-openwebbeans-user-archive@www.apache.org Received: (qmail 16653 invoked from network); 9 Nov 2010 15:38:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Nov 2010 15:38:35 -0000 Received: (qmail 13063 invoked by uid 500); 9 Nov 2010 15:39:06 -0000 Delivered-To: apmail-openwebbeans-user-archive@openwebbeans.apache.org Received: (qmail 13009 invoked by uid 500); 9 Nov 2010 15:39:06 -0000 Mailing-List: contact user-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@openwebbeans.apache.org Delivered-To: mailing list user@openwebbeans.apache.org Received: (qmail 13001 invoked by uid 99); 9 Nov 2010 15:39:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Nov 2010 15:39:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.180.158.109] (HELO web84413.mail.ac2.yahoo.com) (68.180.158.109) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 09 Nov 2010 15:38:58 +0000 Received: (qmail 89745 invoked by uid 60001); 9 Nov 2010 15:38:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1289317117; bh=+76e+DhLVoVX9n77zWYyrwvFVE3GQrpk4TpsEx6wyBk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=iZYifxN/S7Sls6oYx6EKteJLZBRvKh/ei78HGBxl3x/9rD9AlI+4ZO7nV83YJz/nzf9uz6buA33KSfSmupQ8Lc4OdLvEbYZSUnfA4eAxyWHPaxAzT5rkTu0lNP4DZ+d8I2JoMEOBGtDXzan8XRATIGYI1Pm+GIVX6c81F0VVBpI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=fYJBv2pok7u3a06SW2HkcuejNh0LWwZy74f0IUx8Uc4AoT55kpHB1o5LPk8oVOYDo/BtwzWGS3dsn2LobMTZk/HoRFMgOf+RmjT+B7uNF7qhupJFcvWDcUtrleC4nwRhnnys9baGSH0TLar/zm1rxqUQvuA4Ty63xyxrDDe2250=; Message-ID: <146228.88723.qm@web84413.mail.ac2.yahoo.com> X-YMail-OSG: nvoT70UVM1kuZ80R_2BWEbN92SqiTL9ukUwHaxitvDYguFX mlV2FZNzRLH519Qq6aF.fMYjiyJ7mtg3h00NfylPavMfscGM.o20gYD..GkZ FvZNL6Lx0Ir3CS2MW7P.CmXG0BqUqb8BD_XSHO6mGtYw9Q1cOdAwJrhWXZx. OWYLsCZ6B_mcrnzrW1LOI7E6YYhNtBgEdAjMEK9Z33KB7XagpIAYFdxjynoS 4J6SBOK7WYSs84xz3gBcTsOJ7VfxvVkwkx9kMUMRgu73_n4r5OwPiRTIJk.T WmsoyhuDOGI6ZCNz22PdMDv_xTYk- Received: from [173.74.237.85] by web84413.mail.ac2.yahoo.com via HTTP; Tue, 09 Nov 2010 07:38:37 PST X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.107.284920 Date: Tue, 9 Nov 2010 07:38:37 -0800 (PST) From: Aaron Anderson Subject: Standalone extension and manual bean discovery To: user@openwebbeans.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1600267004-1289317117=:88723" --0-1600267004-1289317117=:88723 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, I am writing a standalone application outside of JavaEE and I would like to= use OpenWebBeans for dependency injection. I have discovered the standalon= e sample and I am able to boot up my own standalone environment. I do not wish to use the automatic bean discovery method but instead wish t= o manually control which beans are exposed to the container. In JavaEE I wo= uld set the metadata-complete flag to false but I am not sure if there is a= SE equivalent. In my application I have not included a beans.xml file but = instead I have written a simple extension that observes the BeforeBeanDisco= very event and then manually adds all the beans I desire to be managed: public void beforeBeanDiscovery (@Observes BeforeBeanDiscovery bbd, BeanMan= ager bm){ =A0 bbd.addAnnotatedType(bm.createAnnotatedType(MyBean.class)); }=20 I thought this would be sufficient to add my class for discovery but after = the lifecycle is started and I dump all the beans using lifecycle.getBeanManager().getBeans(Object.class, AnnotationLiteral(){= }); only the standard CDI classes are present. Any idea of what I am doing wron= g or if there a superior way to accomplish my goal of manually "wiring" bea= ns together in a CDI extension? =A0Thanks, Aaron --0-1600267004-1289317117=:88723 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <= /table> --0-1600267004-1289317117=:88723--
Hi,

I am writing a standalone applicat= ion outside of JavaEE and I would like to use OpenWebBeans for dependency i= njection. I have discovered the standalone sample and I am able to boot up = my own standalone environment.

I do not wish to use the automatic be= an discovery method but instead wish to manually control which beans are ex= posed to the container. In JavaEE I would set the metadata-complete flag to= false but I am not sure if there is a SE equivalent. In my application I h= ave not included a beans.xml file but instead I have written a simple exten= sion that observes the BeforeBeanDiscovery event and then manually adds all= the beans I desire to be managed:

public void beforeBeanDiscovery (= @Observes BeforeBeanDiscovery bbd, BeanManager bm){
  bbd.addAnnota= tedType(bm.createAnnotatedType(MyBean.class));
}

I thought this would be sufficient to add my class for discovery but after the lifecycle = is started and I dump all the beans using

lifecycle.getBeanManager()= .getBeans(Object.class, AnnotationLiteral<Any>(){});

only the = standard CDI classes are present. Any idea of what I am doing wrong or if t= here a superior way to accomplish my goal of manually "wiring" beans togeth= er in a CDI extension?

 Thanks,

Aaron