CORDA-2525 - Start pooling classpath scanning and related fixes (#4664) (#4685)

* Start pooling classpath scanning

Quickly patch synchronisation of attachment class loader cache.  Needs a revisit but more complicated due to DJVM.

Annotate away for DJVM

Take ClassGraph utils into their own file so we can exclude for DJVM

Clean up a little

* Daemonize the threads

* Seems to be some concurrency problems with use of ClassGraph.  Using a mutex for now to work around.

(cherry picked from commit 7dc7313fb7)
This commit is contained in:
Rick Parker
2019-01-30 14:26:47 +00:00
committed by Katelyn Baker
parent e4b210603c
commit 384a7c37b9
9 changed files with 30 additions and 18 deletions

View File

@ -28,7 +28,7 @@ class ContractsJarFile(private val file: Path) : ContractsJar {
override val hash: SecureHash by lazy(LazyThreadSafetyMode.NONE, file::hash)
override fun scan(): List<ContractClassName> {
val scanResult = ClassGraph().overrideClasspath(singleton(file)).enableAllInfo().scan()
val scanResult = ClassGraph().overrideClasspath(singleton(file)).enableAllInfo().pooledScan()
val contractClassNames = scanResult.use {
coreContractClasses