-
1. Re: Constructor Interception on Caller-Side?
kabirkhan Mar 9, 2006 5:28 AM (in response to schaefera)For constructor execution to occur we create a wrapper method in the target class which does the "magic", but we need to replace all the callers to use this method.
As you say, for caller constructor execution we need to instrument the caller as well, however the way the interceptor chains are maintained has some slight differences.
For "execution" transformation we use the target class's advisor
For "caller" transformation we use the calling class's advisor -
2. Re: Constructor Interception on Caller-Side?
schaefera Mar 9, 2006 8:25 PM (in response to schaefera)Bottom line: it means that I cannot instrument a constructor which is either created by a non-instrumentable class (JBoss core) or by classes that were not instrumented.
This is unfortunate because AspectJ does it actually as expected even though I cannot use around() advice (must use before and after).
-Andy -
3. Re: Constructor Interception on Caller-Side?
kabirkhan Mar 10, 2006 5:46 AM (in response to schaefera)For this situation you could look at using the "construction" construct, where the mounting the interceptor chains takes place inside the constructor (after the main body.
example:
construction(POJO->new(int))
Note that you can change the value of the jboss.aop.include system property to allow instrumentation of classes in packages under org.jboss. By default all of org.jboss apart from org.jboss.injbossaop is turned off.
There are some classes however that we do not allow weaving of, these inclide classes whose fqn starts with:
javassist.
org.jboss.aop
org.jboss.aop
java.
javax.
sun.
com.sun.
jrockit.
com.bea.vm.