Olaf:


I would have thought that your classloader would need to be applied
at the bottom of the stack (not the top).  I.e. in DefaultClassLoaderModel
you can see the following line that creates the classloader for a
container:

  m_classLoader =
    new URLClassLoader( m_urls, context.getClassLoader() );

If the <classloader> defintion was extended to include an attribute declaring
the type of classloader, then that classloader could be assigned as the new
classloader.


(but keep in mind that I know zero about aspectwerkz)

Cheers, Stephen.


Olaf Bergner wrote:


I wanted to integrate the aspectwerkz aop framework into merlin. By this I
only mean that I want my component classes to be loaded by a custom
classloader derived from aspectwerkz' WeavingClassLoader which will
instrument the loaded bytecode and apply those aspects defined in
aspectwerkz.xml. To do so I will obviously need control over the classloader
to be used for loading my components, i.e. the classloader used by
org.apache.avalon.composition.model.impl.Scanner.

Following a hint given on this list I passed in my custom classloader via
merlin's initial context:

final InitialContext context = new DefaultInitialContext(null, aopLoader,
null, cache, hosts);

where aopLoader is my derived WeavingClassLoader. However, aopLoader will
load a whole bunch of classes, but not the classes in the deployment jar.
After a while I got the impression that Scanner will use the classloader
defined in DefaultSystemContext, no matter what I pass in via
DefaultInitialContext(...). Is this the intended behaviour? And if so, is
there a way of doing what I am trying to achieve? Any hints welcome.

Cheers,

Olaf


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--


Stephen J. McConnell
mailto:[EMAIL PROTECTED]

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to