0

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?

AgentRegEdit
  • 1,089
  • 2
  • 16
  • 32
  • *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 06 '12 at 22:02
  • Load-time weaving http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html#enabling-load-time-weaving Not sure about unloading, but re-loading with a different classloader should be possible. – mazaneicha Jun 06 '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 07 '12 at 14:54

0 Answers0