class export feature does not work in all cases
-----------------------------------------------

                 Key: CDV-598
                 URL: https://jira.terracotta.org/jira//browse/CDV-598
             Project: Community Development
          Issue Type: Bug
          Components: Byte Code Transform
    Affects Versions: 2.5.0
            Reporter: Tim Eck
            Assignee: Issue Review Board


The DSO client (and the TIMs it contains) can "export" classes to application 
level classloaders. The implementation is essentially a VM wide map that 
provides URL sources for specific classnames. Inside of the base 
java.lang.ClassLoader class, we add a hook which consults this map whenever 
classes are being loaded. If there is an entry present in our map, then we use 
the URL source to get the bytes and define the class in the initiating loader. 

Our hook is present in ClassLoader.loadClassInternal()  however (the VMs entry 
point for implicit class loading). For explicit loading via loadClass(..), the 
hook for export is not invoked. 

This isn't simpy a matter of just moving the hook though. loadClassInternal() 
has the nice feature that it only called once per class to load (this is not 
true of loadClass). The other thing about loadClass() is that it can (as 
frequently is overridden in loader subclasses). 

The workaround for code that wants to explicit class loads *and* needs to see 
"exported" classes is to use Class.forName(String, boolean, ClassLoader) 
instead of loadClass(..)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to