>
> > -      For the Java Class artifacts, the ClassLoaderModelResolver uses
> the
> > Thread.currentThread().getContextClassLoader() as the parent class loader
> to
> > resolve the Class References.
>
> It may be that the parent classloader for the ClassLoaderModelResolver
> is the TCCL (which I imagine is the Tuscany runtime classloader) but
> this is not the main mode of operation for the
> ClassLoaderModelResolver. If you look at the code for that class
> you'll see that the ClassLoaderModelResolver does two main things.
>
> - Collects together all the Java imports for the contribution and uses
> these first to try and resolve the class
> - Populates its base class URLClassloader with the artifacts from the
> contribution to which it refers and uses this second to try and
> resolve the class
>
> It treats resource slightly differently but using the same basic techniques
>

You are right, we should change the order of this resolution mechanism here,
as per Section 10.2
of the POJO CI specs 1.1, such that,

1. Java artifacts within the contributions is to be searched first to
resolve the class and then,
2. The java imports for the contribution.


> >
> > According to the current specs "The SCA runtime MUST set the thread
> context
> > class loader of a component implementation class to the class loader of
> its
> > containing contribution. [JCI100009]". To comply with the current specs,
> I
> > believe the following changes are required in 2.x code base....
> >
> > 1. Use the ContributionClassLoaderProviderExtensionPoint to register a
> > ContributionClassLoaderProvider, and allow the
> > ContributionClassLoaderProvider to create a ContributionClassLoader
> instance
> > for each contribution.
>
> I think we should be using ClassLoaderModelResolver  but is you
> question here how you get hold of it in the JavaImplementationInvoker?
>

I believe, if we have to set the TCCL from the JavaImplementationInvoker,
then
we would have to set the classloader field in the ContributionImpl.


>
> > 2. Set the TCCL to the class loader of the contribution, from the
> > JavaImplementationInvoker.
>
> +1
>

Here I would like to change my stance, saying that it would be more
appropriate to
set the TCCL from the ClassLoaderModelResolver rather than from the
JavaImplementationInvoker,
as the classloader needs to be set while loading the classes rather than
during invocation time.

I will make appropriate changes as mentioned here.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Reply via email to