mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
ENT-3000 Start pooling classpath scanning and related fixes (#4664)
* 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.
This commit is contained in:
@ -9,7 +9,6 @@ import net.corda.core.crypto.SecureHash
|
||||
import net.corda.core.internal.*
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.io.InputStream
|
||||
import java.net.URLClassLoader
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.StandardCopyOption
|
||||
@ -28,7 +27,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)).enableClassInfo().scan()
|
||||
val scanResult = ClassGraph().overrideClasspath(singleton(file)).enableClassInfo().pooledScan()
|
||||
|
||||
return scanResult.use { result ->
|
||||
coreContractClasses
|
||||
|
Reference in New Issue
Block a user