[
http://jira.jboss.com/jira/browse/JBAOP-385?page=comments#action_12365114 ]
Flavia Rainone commented on JBAOP-385:
--------------------------------------
In PerVMAdvice, exceptions are thrown as is. PerVMAdvice writes invoke methods that simply
delegate execution to the advice, without treating any exception (notice that invoke
method declares to throw Throwable;however, this interceptor is invoked from inside
wrapper methods, that don't declare to throw Throwable).
So, if an interceptor throws an exception when using classic instrumentation, this is the
result:
[java] Exception in thread "main" java.lang.Exception: EXCEPTION
[java] at SimpleInterceptor.invoke(SimpleInterceptor.java:36)
[java] at
org.jboss.aop.joinpoint.ConstructorInvocation.invokeNext(ConstructorInvocation.java:69)
[java] at POJO.POJO_new_$aop(POJO.java)
[java] at Driver.main(Driver.java:28)
JoinPointGenerator, on the other hand, treats the exception. If the exception is in the
declare list of the joinpoint, the exception is thrown as is. The same goes for
RuntimeException. On the contrary, the exception is wrapped in a RuntimeException. Here is
the result of an nterceptor throwing an exception (that is not part of the joinpoint
exception declare list):
[java] Exception in thread "main" java.lang.RuntimeException:
java.lang.Exception: EXCEPTION
[java] at
JoinPoint_constructor_POJO_0_1.invokeJoinpoint(JoinPoint_constructor_POJO_0_1.java)
[java] at POJO$POJOAdvisor.POJOAdvisor_new_$aop(POJO$POJOAdvisor.java)
[java] at POJO.POJO_new_$aop(POJO.java)
[java] at Driver.main(Driver.java:28)
[java] Caused by: java.lang.Exception: EXCEPTION
[java] at SimpleInterceptor.invoke(SimpleInterceptor.java:36)
[java] at
JoinPoint_constructor_POJO_0_1.invokeNext(JoinPoint_constructor_POJO_0_1.java)
[java] ... 4 more
Uniformize Advice Exception Treatment
-------------------------------------
Key: JBAOP-385
URL:
http://jira.jboss.com/jira/browse/JBAOP-385
Project: JBoss AOP
Issue Type: Task
Security Level: Public(Everyone can see)
Reporter: Flavia Rainone
Assigned To: Flavia Rainone
Priority: Minor
Fix For: 2.0.0.alpha5
The treatment of exceptions in PerVMAdvice is different from the one in
JoinPointGenerator.
We need to pick one of them and use the same approach on both cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira