tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Millies, Sebastian" <Sebastian.Mill...@softwareag.com>
Subject Re: Get Contribution at runtime?
Date Wed, 28 Nov 2012 23:16:58 GMT
> -----Ursprüngliche Nachricht-----
> Von: Simon Nash [mailto:nash@apache.org]
> Gesendet: Mittwoch, 28. November 2012 19:43
> An: user@tuscany.apache.org
> Betreff: Re: Get Contribution at runtime?
> Millies, Sebastian wrote:
> >
> > Of course you're right. The new classloader should look for the
> external libs,
> > then delegate to the parent (the ContributionClassLoader). I was
> still thinking
> > of changing the order in which classes are searched (contribution and
> imports first,
> > parent last), but that's no problem here.
> >
> > The whole idea has a drawback, however: The external libraries are
> not visible to the
> > contributions, but the other way around. So I could not have
> appropriately typed references
> > in my contributions, but would have to use reflection, right?
> >
> A solution might be to make the new classloader the delegation parent
> of the contribution classloader, and load the external libraries before
> Tuscany loads the contributions.  I think this would be safe if the
> contributions don't pass any references to these overriding external
> external libraries to the Tuscany runtime.


>    Simon

Thank you for putting it so plainly. That's exactly what I meant, too. I'm just
not clear at the moment how the Tuscany node APIs allow me to set the classloader
for  a contribution. That's what  the code clutter (now snipped) in my previous
post was all about.

Perhaps I could just change the thread context classloader. But that sounds fishy.
Does not Tuscany have an extension mechanism?   There is code in the
ClassReferenceModelResolver that suggests I should be able to somehow register
my own ContributionClassLoaderProvider in some ExtensionPointRegistry.

Is that so? Is there an example somewhere of how to do that?

-- Sebastian

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Michael Rehm, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial
register: Saarbrücken HRB 19681

View raw message