You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by taha ghasemi <ta...@yahoo.com> on 2013/04/04 09:34:27 UTC
(public) Observer method don't get intercepted
Hi all,
I recently noticed that when I
declare an interceptor above my public observer method, the interceptor
isn't called when the event fires for the first time. If I call this
observer method directly the
interceptor get called as usual.
I think the root problem is in ObserverMethodImpl:notify which decides a method is private or not based on this code:
boolean isPrivateMethod = !observerMethod.isAccessible() ;
And then make the method accessible if it is not. By default, all reflected objects are inaccessible so even public methods in the first time treated as private.
OWB: 1.1.7.
JDK: 1.7
Thanks.
Re: (public) Observer method don't get intercepted
Posted by Mark Struberg <st...@yahoo.de>.
Thanks, Taha!
LieGrue,
strub
>________________________________
> From: taha ghasemi <ta...@yahoo.com>
>To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>; Mark Struberg <st...@yahoo.de>
>Sent: Thursday, April 4, 2013 11:54 AM
>Subject: Re: (public) Observer method don't get intercepted
>
>
>JIRA issue:
>
>https://issues.apache.org/jira/browse/OWB-811
>
Re: (public) Observer method don't get intercepted
Posted by taha ghasemi <ta...@yahoo.com>.
JIRA issue:
https://issues.apache.org/jira/browse/OWB-811
Thanks
________________________________
From: Mark Struberg <st...@yahoo.de>
To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
Sent: Thursday, April 4, 2013 12:24 PM
Subject: Re: (public) Observer method don't get intercepted
Hi Taha!
Can you please create a JIRA [1] so we can fix it - txs!
LieGrue,
strub
[1] https://issues.apache.org/jira/browse/OWB
>________________________________
> From: taha ghasemi <ta...@yahoo.com>
>To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
>Sent: Thursday, April 4, 2013 9:34 AM
>Subject: (public) Observer method don't get intercepted
>
>
>Hi all,
>
>
>I recently noticed that when I
declare an interceptor above my public observer method, the interceptor
isn't called when the event fires for the first time. If I call this
observer method directly the
interceptor get called as usual.
>I think the root problem is in ObserverMethodImpl:notify which decides a method is private or not based on this code:
>
>boolean isPrivateMethod = !observerMethod.isAccessible() ;
>
>And then make the method accessible if it is not. By default, all reflected objects are inaccessible so even public methods in the first time treated as private.
>
>OWB: 1.1.7.
>JDK: 1.7
>
>Thanks.
>
>
>
>
Re: (public) Observer method don't get intercepted
Posted by Mark Struberg <st...@yahoo.de>.
Hi Taha!
Can you please create a JIRA [1] so we can fix it - txs!
LieGrue,
strub
[1] https://issues.apache.org/jira/browse/OWB
>________________________________
> From: taha ghasemi <ta...@yahoo.com>
>To: "user@openwebbeans.apache.org" <us...@openwebbeans.apache.org>
>Sent: Thursday, April 4, 2013 9:34 AM
>Subject: (public) Observer method don't get intercepted
>
>
>Hi all,
>
>
>I recently noticed that when I
declare an interceptor above my public observer method, the interceptor
isn't called when the event fires for the first time. If I call this
observer method directly the
interceptor get called as usual.
>I think the root problem is in ObserverMethodImpl:notify which decides a method is private or not based on this code:
>
>boolean isPrivateMethod = !observerMethod.isAccessible() ;
>
>And then make the method accessible if it is not. By default, all reflected objects are inaccessible so even public methods in the first time treated as private.
>
>OWB: 1.1.7.
>JDK: 1.7
>
>Thanks.
>
>
>
>