Return-Path: X-Original-To: apmail-openwebbeans-user-archive@www.apache.org Delivered-To: apmail-openwebbeans-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 29D9E7F8F for ; Thu, 17 Nov 2011 20:51:43 +0000 (UTC) Received: (qmail 43141 invoked by uid 500); 17 Nov 2011 20:51:43 -0000 Delivered-To: apmail-openwebbeans-user-archive@openwebbeans.apache.org Received: (qmail 43110 invoked by uid 500); 17 Nov 2011 20:51:43 -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 43102 invoked by uid 99); 17 Nov 2011 20:51:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2011 20:51:43 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,FS_OBFU_PRMCY,RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_DBL_REDIR X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gerhard.petracek@gmail.com designates 209.85.213.50 as permitted sender) Received: from [209.85.213.50] (HELO mail-yw0-f50.google.com) (209.85.213.50) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2011 20:51:37 +0000 Received: by ywm13 with SMTP id 13so1675334ywm.9 for ; Thu, 17 Nov 2011 12:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=RcGOy+7RAPtL43hXkcj1yMC+U3dc44WKaw0LyZSRQRY=; b=NVsgnsf0IpKo9IBGig7HRYx5i/fAFPglXyQUak8s/VFM/iouqaok8KNUF5QM4doQD6 9mK7j9LpGjSqrtCti/Klt0V0/g/Ui+H7EVkOPXWI4yakQIS9n+MsSimt6TOc4FU5c1Xr 5goXYAapjifPPSIGyCXZ4EDbX5w8pzQD/gT9g= Received: by 10.236.77.98 with SMTP id c62mr234253yhe.109.1321563074713; Thu, 17 Nov 2011 12:51:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.108.19 with HTTP; Thu, 17 Nov 2011 12:50:51 -0800 (PST) In-Reply-To: <20111117204154.AE8C4164723@mx01.openknowledge.de> References: <20111117114637.C41D016404E@mx01.openknowledge.de> <20111117204154.AE8C4164723@mx01.openknowledge.de> From: Gerhard Petracek Date: Thu, 17 Nov 2011 21:50:51 +0100 Message-ID: Subject: Re: Programmaticly adding interceptors to CDI bean To: user@openwebbeans.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org hi, i haven't tested it with the latest version of owb, however, it used to work (you can see it in the example). regards, gerhard http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2011/11/17 Arne Limburg : > Hi Rudy, > > > > Good to hear that the class-level-solution works for you. Btw. that the > annotation from ProcessAnnotatedType are not used to determine the > interceptor binding is a bug imho, at least it will be with CDI 1.1. > > > > Regards, > > Arne > > > > Von: Rudy De Busscher [mailto:rdebusscher@gmail.com] > Gesendet: Donnerstag, 17. November 2011 21:38 > An: user@openwebbeans.apache.org > Betreff: Re: Programmaticly adding interceptors to CDI bean > > > > @Arne, > > I tried to create something but it isn't working. > > I know now that you can also put the annotation of the interceptor at the > class level and that all methods are then intercepted. > > So I tried to add the annotation to the > ProcessAnnotatedType.getAnnotatedType().getAnnotations() list in the > Extension. But this isn't used to determine the interceptors. > > In the method > org.apache.webbeans.intercept.WebBeansInterceptorConfig#configure, the > annotations are taken from the Class itself, not from the Bean or > AnnotatedType. > > @Gerhard > I'll have a look at those classes to implement it.=A0 But can't try it be= fore > the end of next week. (so no feedback before that) > > But now that I know that you can specify the interceptor annotation also = at > the class level, It is less important to add it programmaticly.=A0 Adding= it > on one place by hand isn't too bad. > > Thx > Rudy > > On 17 November 2011 17:26, Gerhard Petracek > wrote: > > hi rudy, > > for adding an interceptor for a whole bean, you can have a look at [1] > > regards, > gerhard > > [1] http://goo.gl/JTw1Q > > http://www.irian.at > > Your JSF powerhouse - > JSF Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > > > 2011/11/17 Arne Limburg : > >> Hi Rudy, >> >> >> >> You can use a portable Extension to achieve that. With the Extension you >> can >> observe the ProcessAnnotatedType event, modify the AnnotatedType and add >> the >> annotation. >> >> >> >> Regards, >> >> Arne >> >> >> >> Von: Rudy De Busscher [mailto:rdebusscher@gmail.com] >> Gesendet: Donnerstag, 17. November 2011 12:43 >> An: user@openwebbeans.apache.org >> Betreff: Programmaticly adding interceptors to CDI bean >> >> >> >> Hi all, >> >> I would like to add an interceptor to a method programmatical, without t= he >> need for the annotation on the method. >> >> Point is that I have created a new scope and all methods of the bean >> assigned to that scope should also be assigned an interceptor.=A0 I woul= d >> like >> to do that automatically, so that the developer doesn't need to add the >> annotation. >> >> I found the place in the code were OWB is performing the task but there >> seems no portable way of doing this. >> >> Or is there another way of doing such functionality? >> >> Thx >> regards >> Rudy >> >> -- >> Rudy De Busscher >> http://www.c4j.be > > > -- > Rudy De Busscher > http://www.c4j.be