Take the 2-minute tour ×

Is it possible to define properties of an aspect's pointcut through a constructor and then allow it to weave at run time after an instance has been created? Also is it possible to load/unload/modify specific aspects during run time? I was planning on exposing some methods in the aspect over rmi to allow communication with a client app. Perhaps this is possible to java agent technology?

share|improve this question
After an instance has been created? Weaving modifies bytecode; this normally happens on load, since that's when the bytecode is trivially available. Maybe something with something like jrebel, otherwise I don't see how, without hacking a JVM. –  Dave Newton Jun 6 '12 at 22:02
Load-time weaving eclipse.org/aspectj/doc/released/devguide/… Not sure about unloading, but re-loading with a different classloader should be possible. –  mazaneicha Jun 6 '12 at 22:32
Yea I was hoping that wasn't the case, my current solution is involving a pointcut of call(* * (..)) to hijack everything and see if the method or class i want to hijack belongs to a HashSet, but this seems like a real hacked solution –  AgentRegEdit Jun 7 '12 at 14:54
add comment


Your Answer



Browse other questions tagged or ask your own question.