All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.p8e.util.FactMethodHandler.kt Maven / Gradle / Ivy

Go to download

A collection of services and libraries that iteract and run Provenance Java based contracts.

There is a newer version: 0.9.0-grpc
Show newest version
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 ""
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy