Hi Alessio, No objections here.
Colm. On Wed, Apr 24, 2013 at 11:24 AM, Alessio Soldano <[email protected]>wrote: > Hi, > I think I might have noticed an issue (at least in my environment) with > the way EHCache availability checks are performed in ReplayCacheFactory > and TokenStoreFactory. The ClassLoaderUtils#loadClass method is used in > static blocks for checking if a class from EHCache is available; if > that's the case, a EHCache-based factory will later be used when a new > instance is required. Now, the factory instance is actually built using > the defining classloader of the ReplayCacheFactory / TokenStoreFactory > class, despite the EHCache availability check having been performed > using the current Thread context classloader (TCCL) first. If EHCache is > visible in the TCCL that is set when initialising the abstract classes > and not visible in their defining classloader, the newInstance > invocation will fail. > I would suggest performing the EHCache availability check using the > defining classloader only in the static block; additionally, if we > really want to try relying on stuff coming from the TCCL only, we could > perform a new check on it when actually required to build a newInstance > and actually use the TCCL to build the EHCache based factory through > reflection. > Any opinion on this? > Cheers > Alessio > > -- > Alessio Soldano > Web Service Lead, JBoss > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
