[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: Privileged Blocks Issue : JBAOP-675
flavia.rainone@jboss.com
do-not-reply at jboss.com
Thu Nov 20 14:49:25 EST 2008
"anil.saldhana at jboss.com" wrote : I am saying that the privileged block should be in:
|
| | 23:22:07,503 ERROR [STDERR] at org.jboss.jms.client.delegate.ClientSessionDelegate.createMessage
| | (ClientSessionDelegate.java)
| |
Unless the problem is not with Class.getClassLoader call, it shouldn't be in the joinpoint wrapper, createMessage.
There are two good reasons for this. The first one is that the joinpointwrapper, createMessage, will trigger the Class.getClassLoader call only the first time it is reached on a per scope basis (given the aspect is a PER_INSTANCE one, it will be triggered the first time this method is run for each ClientSessionDelegate instance).
So, it is not fair to pay the extra performance price of running the joinpoint inside a privileged block just because it might need to trigger a Class.getClassLoader.
Secondly, I'm following the design decision that Kabir has made for the other points of JBoss AOP code. Kabir created SecurityActions classes that perform a few operations inside privileged blocks. When I want to call, for example, Class.getClassLoader, I am supposed to call SecurityActions.getClassLader(Class).
This method was already there, but it looks like some points of the new 2.0.0GA version mistakenly were invoking Class.getClassLoader instead of delegating to SecurityActions.
There is a new version of the jar attached at the Jira issue, now with all the points replaced. Please, test that jar and let me know if it works or if I missed some Class.getClassLoader call in the code.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191021#4191021
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191021
More information about the jboss-dev-forums
mailing list