Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] "About AspectJ creation and After advice"

Dear AspectJ users,

   I have simple two questions about AspectJ.

  •  About AspectJ creation (association), we have the "per-object association", which associates a separate aspect instance with the execution object
    (this) for the join point matching the pointcut specified inside perthis(). However, suppose we have an Aspect with twenty (20) anonymous pointcut.
          Question 1: Is there any way to perform the perthis() for this Aspect without explicit all the 20 anonymous pointcut inside the perthis()?
  • About After advice, we have two more kinds of after advice besides the simpler one. One of them is the After throwing -- that is responsible to add behavior when the intercepted method throws an exception. We also can verify the kind of the exception thrown: after() throwing(Throwable throwable), by using thowable inside the advice's body.
            Question 2: I know the uses of after advice (after, after returning and after throwing). However, I really want If there exists any way to handler an exception (or verify the kind
                             of exception thrown) using a simple after advice (no using after throwing).


  Best regards!

--
Henrique Mostaert

Back to the top