io.p8e.util.FactMethodHandler.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of p8e-sdk Show documentation
Show all versions of p8e-sdk Show documentation
A collection of services and libraries that iteract and run Provenance Java based contracts.
package io.p8e.util
import io.p8e.annotations.Fact
import javassist.util.proxy.MethodHandler
import java.lang.reflect.Method
import java.util.concurrent.CompletableFuture
class FactMethodHandler(private val factFuture: CompletableFuture): MethodHandler {
override fun invoke(
self: Any?,
thisMethod: Method?,
proceed: Method?,
args: Array?
): Any {
thisMethod?.getAnnotation(Fact::class.java)?.name?.let(factFuture::complete)
return ""
}
}