You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Mark Struberg <st...@yahoo.de> on 2010/02/09 18:17:51 UTC

interceptors in constructors

As far as I read in the EJB interceptors spec, constructors may not get intercepted. The question is if methods called within the constructors may have to become intercepted. Afaik common sense is that this is not really defined and shall not be used.

Anyone has better information on that topic? David?

txs and LieGrue,
strub

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

Re: interceptors in constructors

Posted by David Blevins <da...@visi.com>.
On Feb 9, 2010, at 9:17 AM, Mark Struberg wrote:

> As far as I read in the EJB interceptors spec, constructors may not  
> get intercepted. The question is if methods called within the  
> constructors may have to become intercepted. Afaik common sense is  
> that this is not really defined and shall not be used.

Constructors are not intercepted.  As far as methods called within a  
constructor it's really orthogonal.  Any method invocation on a proxy  
go through the "container" and hit the bean.  If someone has a "this"  
reference to the bean instance itself and invokes it (that includes  
the bean itself), then no container managed anything happens.

-David


Re: interceptors in constructors

Posted by Sven Linstaedt <sv...@googlemail.com>.
Mirrors exactly my state of knowledge.

br, Sven



2010/2/9, Mark Struberg <st...@yahoo.de>:
> As far as I read in the EJB interceptors spec, constructors may not get
> intercepted. The question is if methods called within the constructors may
> have to become intercepted. Afaik common sense is that this is not really
> defined and shall not be used.
>
> Anyone has better information on that topic? David?
>
> txs and LieGrue,
> strub
>
> __________________________________________________
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
> gegen Massenmails.
> http://mail.yahoo.com
>

Re: interceptors in constructors

Posted by Mark Struberg <st...@yahoo.de>.
hmm, I think the behaviour is not really well defined. So we should not really test it.

LieGrue,
strub

--- Eric Covener <co...@gmail.com> schrieb am Di, 9.2.2010:

> Von: Eric Covener <co...@gmail.com>
> Betreff: Re: interceptors in constructors
> An: dev@openwebbeans.apache.org
> Datum: Dienstag, 9. Februar 2010, 20:06
> On Tue, Feb 9, 2010 at 1:57 PM, Mark
> Struberg <st...@yahoo.de>
> wrote:
> > yes, completely agree. Thus I marked our
> CallingBusinessInConstructorTest with @Ignore. If other also
> think that this should not be allowed (or at least it
> doesn't have to be supported) - then I'd say we remove this
> test completely.
> 
> Or invert the assertion?
> 
> -- 
> Eric Covener
> covener@gmail.com
> 

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

Re: interceptors in constructors

Posted by Eric Covener <co...@gmail.com>.
On Tue, Feb 9, 2010 at 1:57 PM, Mark Struberg <st...@yahoo.de> wrote:
> yes, completely agree. Thus I marked our CallingBusinessInConstructorTest with @Ignore. If other also think that this should not be allowed (or at least it doesn't have to be supported) - then I'd say we remove this test completely.

Or invert the assertion?

-- 
Eric Covener
covener@gmail.com

Re: interceptors in constructors

Posted by Mark Struberg <st...@yahoo.de>.
yes, completely agree. Thus I marked our CallingBusinessInConstructorTest with @Ignore. If other also think that this should not be allowed (or at least it doesn't have to be supported) - then I'd say we remove this test completely.

LieGrue,
strub

--- Joseph Bergmark <be...@apache.org> schrieb am Di, 9.2.2010:

> Von: Joseph Bergmark <be...@apache.org>
> Betreff: Re: interceptors in constructors
> An: dev@openwebbeans.apache.org
> Datum: Dienstag, 9. Februar 2010, 19:52
> I think I agree with Eric here. 
> Calling another method in the same class
> from inside of the constructor wouldn't be the same as
> calling it on a
> contextual instance.  You wouldn't expect the same
> services to be added
> (Decorator & Interceptors for example).
> 
> Sincerely,
> 
> Joe
> 
> On Tue, Feb 9, 2010 at 1:37 PM, Eric Covener <co...@gmail.com>
> wrote:
> 
> > On Tue, Feb 9, 2010 at 12:17 PM, Mark Struberg <st...@yahoo.de>
> wrote:
> > > As far as I read in the EJB interceptors spec,
> constructors may not get
> > intercepted. The question is if methods called within
> the constructors may
> > have to become intercepted. Afaik common sense is that
> this is not really
> > defined and shall not be used.
> >
> > Would we say those are not invocations via a
> contextual reference and
> > are thus not intercepted?
> >
> > --
> > Eric Covener
> > covener@gmail.com
> >
> 

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

Re: interceptors in constructors

Posted by Joseph Bergmark <be...@apache.org>.
I think I agree with Eric here.  Calling another method in the same class
from inside of the constructor wouldn't be the same as calling it on a
contextual instance.  You wouldn't expect the same services to be added
(Decorator & Interceptors for example).

Sincerely,

Joe

On Tue, Feb 9, 2010 at 1:37 PM, Eric Covener <co...@gmail.com> wrote:

> On Tue, Feb 9, 2010 at 12:17 PM, Mark Struberg <st...@yahoo.de> wrote:
> > As far as I read in the EJB interceptors spec, constructors may not get
> intercepted. The question is if methods called within the constructors may
> have to become intercepted. Afaik common sense is that this is not really
> defined and shall not be used.
>
> Would we say those are not invocations via a contextual reference and
> are thus not intercepted?
>
> --
> Eric Covener
> covener@gmail.com
>

Re: interceptors in constructors

Posted by Mark Struberg <st...@yahoo.de>.
in fact, they are sometimes (most times?) even constructed from within the proxy. So it would be a bit schizophrenic imho. 

--- Eric Covener <co...@gmail.com> schrieb am Di, 9.2.2010:

> Von: Eric Covener <co...@gmail.com>
> Betreff: Re: interceptors in constructors
> An: dev@openwebbeans.apache.org
> Datum: Dienstag, 9. Februar 2010, 19:37
> On Tue, Feb 9, 2010 at 12:17 PM, Mark
> Struberg <st...@yahoo.de>
> wrote:
> > As far as I read in the EJB interceptors spec,
> constructors may not get intercepted. The question is if
> methods called within the constructors may have to become
> intercepted. Afaik common sense is that this is not really
> defined and shall not be used.
> 
> Would we say those are not invocations via a contextual
> reference and
> are thus not intercepted?
> 
> -- 
> Eric Covener
> covener@gmail.com
> 

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

Re: interceptors in constructors

Posted by Eric Covener <co...@gmail.com>.
On Tue, Feb 9, 2010 at 12:17 PM, Mark Struberg <st...@yahoo.de> wrote:
> As far as I read in the EJB interceptors spec, constructors may not get intercepted. The question is if methods called within the constructors may have to become intercepted. Afaik common sense is that this is not really defined and shall not be used.

Would we say those are not invocations via a contextual reference and
are thus not intercepted?

-- 
Eric Covener
covener@gmail.com