Check out http://www.eclipse.org/aspectj/doc/next/weaver-api/org/aspectj/weaver/loadtime/WeavingURLClassLoader.html.
Here is a little old code snippet I found in one of my projects when I implemented a plug-in concept in which I had the aspect code in my main project, but wanted to advise plugin JARs which were loaded on demand. Feel free to modify it according to your needs: private void loadPlugin(String pluginJar, String pluginClassName) throws Exception { echo("Trying to load plugin JAR " + pluginJar); ClassLoader loader = Thread.currentThread().getContextClassLoader(); WeavingURLClassLoader weaver = new WeavingURLClassLoader( new URL[] { new File(pluginJar).toURI().toURL() }, new URL[] { loader.getResource(".") }, loader ); Class<?> pluginClass = weaver.loadClass(pluginClassName); Plugin plugin = (Plugin) pluginClass.newInstance(); plugin.init(this); plugins.add(plugin); echo("Successfully loaded and initialised plugin '" + plugin.getName() + "'"); } -- Alexander Kriegisch http://scrum-master.de ----- Original Message ----- From: chatell...@codelutin.com To: aspectj-users@eclipse.org Date: 05.04.2013 10:40:08 Subject: [aspectj-users] Runtime weaving without agent > Hi, > > I'm maintaining a project that is still using unmaintained > aspectwerkz project. It's now time to move on ;) > > In this project, we are using a custom classloader "per thread" > which "weave" class on the fly when class is loaded > (Classloader#findClass(String)). [1] > > Since aspectj and aspectwerkz join forces in 2005, i'm trying > to do the same thing with aspectj. > But, i can find only documentation using agent [2], which is not > possible in our use case. > > Is it still possible to do it with only runtime programmatic way ? > > Regards. > > > [1] > http://forge.codelutin.com/projects/isis-fish/repository/revisions/3798/entry/trunk/src/main/java/fr/ifremer/isisfish/aspect/AspectClassLoader.java > [2] http://www.eclipse.org/aspectj/doc/next/devguide/ltw.html > > -- > Éric Chatellier - Code Lutin > Tel: 02.40.50.29.28 - http://www.codelutin.com > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users _______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users