Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AspectJ WeavingAdaptor Question: a feature request or intentionally left off?

Hi, 

I have checked feature request list, it doesn't seem to have this one.

I want to use WeavingAdaptor directly from my project, but I don't
bother classLoader at all.

Currently, I just copied WeavingAdaptor.java in my project, rename is as
AspectJWeavingAdaptor.java, and made an extra constructor, like this

	public AspectJWeavingAdaptor (List classPath, List aspectPath) {
		init(classPath, aspectPath);
	}

So far, it works great for me. I am happy with what I have right now.

To make it even better, since it is mostly a copy from original
WeavingAdaptor,
Is it possible to make an extra constructor in AspectJ's
WeavingAdaptor.java? So I can get rid of my wrapper file
AspectJWeavingAdaptor completely, aslo I can take advantage of any
enhancement there.

I understand that I don't use classloader at all, I only need the
functionality of load-time weaving. Here is how I use it:

           in my constructor:
		    adaptor = new AspectJWeavingAdaptor(classList,
aspectList);

           in real code:
                new_bytecode = adaptor.weaveClass(className,
old_bytecode);


To me, in order for weaver to work, it only needs classPath and
aspectPath, nothing more. Was there any reason that it is still not
there?


Thanks a lot,

Larry



Back to the top