Hi All,

The POJO CI specs 1.1 makes a recommendation that, the thread context
classloader of the thread used to invoke an
operation of a Java POJO component implementation MUST be set as the class
loader of the contribution that contains
the POJO implementation class.

The POJO_10009 test case uses the below code to validate the same...

        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        ClassLoader loader = this.getClass().getClassLoader();
        String result = " thread context classloader is correct";
        if( loader != tccl ) result = " thread context classloader not
correct";

In the current Tuscany code, we use the ClassLoaderModelResolver which
extends the URLClassLoader to load the classes.
The ClassLoaderModelResolver internally sets its parent classloader as TCCL.
So the this.getClass().getClassLoader()
returns ClassLoaderModelResolver instance always.

In my opinion, the current Tuscany code looks valid as we would need a
CustomClassLoader to load the classes
from the contribution URL. In any case, the TCCL might not be able to load
the classes available from the contribution as the
location is only known at runtime. So I believe the spec needs a change in
this case.

Please let me know your suggestions and comments. Thanks.

-- 
Thanks & Regards,
Ramkumar Ramalingam

Reply via email to