injectAfter

fun injectAfter(targetClassName: String, methodName: String, parameterTypeNames: List<String> = emptyList(), owner: String? = null, handler: (UnsafeInvocationContext, Any?, Throwable?) -> Unit): UnsafeHandle

Injects a callback after target method execution (string-based overload).

Return

injection handle, usable by rollbackUnsafe

Parameters

targetClassName

target class fully-qualified name

methodName

target method name

parameterTypeNames

parameter type names, e.g. int, java.lang.String

owner

script owner (nullable, auto-resolved from script context if null)

handler

after callback with result and throwable


fun injectAfter(method: Method, owner: String? = null, handler: (UnsafeInvocationContext, Any?, Throwable?) -> Unit): UnsafeHandle

Injects a callback after target method execution (Method overload).

Prefer this overload when a reflected Method is already available.