[infinispan-dev] [Pull Request] Modular Classloading Compatibility

Manik Surtani manik at jboss.org
Wed Jun 8 09:13:35 EDT 2011


On 8 Jun 2011, at 14:06, Pete Muir wrote:

> We've decided that rather than swap out the TCCL (which is frankly a bit error prone), to fix this properly and have it so that each time a class is loaded it must select the classloaders it wants. To help, we will add an advancedCache.getClassLoader(), which defaults to the TCCL but can be overridden as described below.
> 
> As a first step, I have removed the TCCL from the default lookup in Util (AFAICT all class loading was going through there), and required that, if you want to lookup app classes (as opposed to Infinispan classes) you explicitly pass in a classloader. I have then passed in the TCCL as a parameter throughout the codebase. This now makes it explicit where the TCCL is being used and should mean that any new work does think about whether they need to look at app classes or not.
> 
> Under this new scheme we have 45 refs to the TCCL in the codebase. Some of these are:
> 
> a) not needed, we are only ever loading system classes
> b) can, with a bit of a refactor, refer to the classloader we select using withClassLoader()
> c) other (these will be harder to fix :-()
> 
> My plan is to go through each one, and chat with the owner of the code and discuss which of (a), (b) or (c) is relevant here.

Sounds good.

--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org






More information about the infinispan-dev mailing list