A small ClassLoader change proposal

Rémi Forax forax at univ-mlv.fr
Thu Sep 16 14:21:17 UTC 2010


  Le 16/09/2010 15:53, David M. Lloyd a écrit :
> This comes up from time to time.  I proposed a very similar thing a 
> while ago and was shot down ("wait for ephemeron support!").
>
> http://dmlloyd.blogspot.com/2009/02/class-local-data.html
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-February/001168.html

David,
class locals was recently introduced in java.dyn:
http://hg.openjdk.java.net/jdk7/hotspot-comp/jdk/rev/4ed243e9e9d9

Rémi

>
> On Sep 16, 2010, at 8:44 AM, Jevgeni Kabanov wrote:
>
>> On 16.09.2010, at 16:33, Rémi Forax wrote:
>>
>>> So you want to create a classloader local like there is a thread local.
>>>
>>> You can subclass ClassLoader and put your field in the newly created 
>>> class.
>>> Why do you need to put your localMap in java.lang.Classloader ?
>>
>> Because I want it to work with any class loader, not just the ones 
>> created by me. In a typical Java EE app you have a lot of custom 
>> class loaders created by the container, frameworks and the app. I 
>> want to be able to hold a reference to an object, without having to 
>> think about what happens when that app is redeployed.
>>
>> JK
>
> - DML
>




More information about the core-libs-dev mailing list