X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FWebOfTrustPinger.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FWebOfTrustPinger.kt;h=9d0522d36ba085c30e797fa4849076c4e4bb8500;hp=e090133d385648324cc42da0cda8a702535b257b;hb=b385551aaa0750cb0041858037cd83dcbf9006b6;hpb=4d52c2de635c2225d206f4666ca070d7b5e70c37 diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPinger.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPinger.kt index e090133..9d0522d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPinger.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/WebOfTrustPinger.kt @@ -20,14 +20,19 @@ package net.pterodactylus.sone.freenet.wot import com.google.common.eventbus.* import net.pterodactylus.sone.core.event.* import net.pterodactylus.sone.freenet.plugin.* +import net.pterodactylus.sone.utils.* import java.util.concurrent.atomic.* +import javax.inject.* /** * [Runnable] that is scheduled via an [Executor][java.util.concurrent.Executor], * checks whether the web of trust plugin can be communicated with, sends * events if its status changes and reschedules itself. */ -class WebOfTrustPinger(private val eventBus: EventBus, private val webOfTrustReacher: () -> Unit, private val reschedule: () -> Unit) : Runnable { +class WebOfTrustPinger @Inject constructor( + private val eventBus: EventBus, + @Named("webOfTrustReacher") private val webOfTrustReacher: Runnable, + @Named("webOfTrustReschedule") private val reschedule: Runnable) : Runnable { private val lastState = AtomicBoolean(false)