solution: refactoring, make ObjectMapper as a global object, not bean

This commit is contained in:
Igor Artamonov
2020-05-18 19:23:48 -04:00
parent 2cfdf392ad
commit 2fc6896a83
73 changed files with 345 additions and 368 deletions

View File

@@ -31,8 +31,7 @@ import reactor.core.publisher.Mono
open class BitcoinMultistream(
chain: Chain,
val upstreams: MutableList<BitcoinUpstream>,
caches: Caches,
private val objectMapper: ObjectMapper
caches: Caches
) : Multistream(chain, upstreams as MutableList<Upstream>, caches), Lifecycle {
companion object {
@@ -40,7 +39,7 @@ open class BitcoinMultistream(
}
private var head: Head? = null
private var reader = BitcoinReader(this, EmptyHead(), objectMapper)
private var reader = BitcoinReader(this, EmptyHead())
override fun init() {
if (upstreams.size > 0) {
@@ -84,7 +83,7 @@ open class BitcoinMultistream(
override fun setHead(head: Head) {
this.head = head
reader = BitcoinReader(this, head, objectMapper)
reader = BitcoinReader(this, head)
}
override fun getHead(): Head {