diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-14 23:29:09 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-19 21:13:49 -0400 |
commit | a5f4db210aa2878eb8e15a6d9fe5235199d4aee6 (patch) | |
tree | 62ee3ddd75578f340a6c36f99188fae413585b4e /stage1/ClassLoaderCache.scala | |
parent | 35a96fea9336dfcac8aac75824450cbf7dc4ae1a (diff) | |
download | cbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.tar.gz cbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.tar.bz2 cbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.zip |
replace two level classloader with hierarchy
replace two level classloader (one for non-cachable dependencies with a cached parent one for cachable ones) with a hierachy of classloaders corresponding
this should eventually allow re-using CBT's classloader between stage1 and stage2
this change breaks the ScalaTest support for now
Diffstat (limited to 'stage1/ClassLoaderCache.scala')
-rw-r--r-- | stage1/ClassLoaderCache.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stage1/ClassLoaderCache.scala b/stage1/ClassLoaderCache.scala index 3e77dd6..10d872d 100644 --- a/stage1/ClassLoaderCache.scala +++ b/stage1/ClassLoaderCache.scala @@ -2,11 +2,12 @@ package cbt import java.net._ import java.util.concurrent.ConcurrentHashMap +import collection.JavaConversions._ class ClassLoaderCache(logger: Logger){ val persistent = new KeyLockedLazyCache( - NailgunLauncher.classLoaderCache.asInstanceOf[ConcurrentHashMap[String,AnyRef]], - NailgunLauncher.classLoaderCache.asInstanceOf[ConcurrentHashMap[AnyRef,ClassLoader]], + NailgunLauncher.classLoaderCacheKeys.asInstanceOf[ConcurrentHashMap[String,AnyRef]], + NailgunLauncher.classLoaderCacheValues.asInstanceOf[ConcurrentHashMap[AnyRef,ClassLoader]], Some(logger) ) val transient = new KeyLockedLazyCache( @@ -14,4 +15,5 @@ class ClassLoaderCache(logger: Logger){ new ConcurrentHashMap[AnyRef,ClassLoader], Some(logger) ) + override def toString = s"""ClassLoaderCache("""+ persistent.keys.keySet.toVector.map(_.toString).sorted.map(" "++_).mkString("\n","\n","\n") +""")""" } |