{
- override val obj by lazy { busyProviders.runFactory(this) }
- override fun toString() = underlying.toString()
-}
-
-private class Invocation(val constructor: PublicConstructor
, val argSuppliers: List>) : Callable {
- fun providerCount() = argSuppliers.stream().filter { (_, supplier) -> supplier.provider != null }.count() // Allow repeated providers.
- override fun call() = constructor(argSuppliers)
- override fun toString() = constructor.toString()
-}
-
-private class BusyProviders {
- private val busyProviders = mutableMapOf, Callable<*>>()
- fun