Class PanamaCallbackRegistry

java.lang.Object
ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
ai.tegmentum.wasmtime4j.panama.PanamaCallbackRegistry
All Implemented Interfaces:
ai.tegmentum.wasmtime4j.func.CallbackRegistry

public final class PanamaCallbackRegistry extends ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
Panama FFI implementation of the callback registry for managing callbacks and asynchronous operations.

This registry extends AbstractCallbackRegistry with Panama-specific function reference creation and resource cleanup through NativeResourceHandle and ArenaResourceManager.

Since:
1.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ai.tegmentum.wasmtime4j.func.CallbackRegistry

    ai.tegmentum.wasmtime4j.func.CallbackRegistry.AsyncCallbackHandle, ai.tegmentum.wasmtime4j.func.CallbackRegistry.AsyncHostFunction, ai.tegmentum.wasmtime4j.func.CallbackRegistry.CallbackHandle, ai.tegmentum.wasmtime4j.func.CallbackRegistry.CallbackMetrics
  • Field Summary

    Fields inherited from class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry

    callbacks, DEFAULT_ASYNC_TIMEOUT_MILLIS, metrics, nextCallbackId
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
    closeFunctionReference(ai.tegmentum.wasmtime4j.func.FunctionReference ref)
     
    protected ai.tegmentum.wasmtime4j.func.FunctionReference
    createFunctionReferenceForCallback(ai.tegmentum.wasmtime4j.func.HostFunction callback, ai.tegmentum.wasmtime4j.type.FunctionType functionType)
     
    protected void
     
     

    Methods inherited from class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry

    createFunctionReference, getCallbackCount, getMetrics, hasCallback, invokeAsyncCallback, invokeCallback, registerAsyncCallback, registerCallback, unregisterCallback

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createFunctionReferenceForCallback

      protected ai.tegmentum.wasmtime4j.func.FunctionReference createFunctionReferenceForCallback(ai.tegmentum.wasmtime4j.func.HostFunction callback, ai.tegmentum.wasmtime4j.type.FunctionType functionType) throws ai.tegmentum.wasmtime4j.exception.WasmException
      Specified by:
      createFunctionReferenceForCallback in class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasmException
    • closeFunctionReference

      protected void closeFunctionReference(ai.tegmentum.wasmtime4j.func.FunctionReference ref)
      Specified by:
      closeFunctionReference in class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
    • getAsyncExecutor

      protected ScheduledExecutorService getAsyncExecutor()
      Specified by:
      getAsyncExecutor in class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
    • ensureNotClosed

      protected void ensureNotClosed()
      Specified by:
      ensureNotClosed in class ai.tegmentum.wasmtime4j.func.AbstractCallbackRegistry
    • close

      public void close() throws ai.tegmentum.wasmtime4j.exception.WasmException
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasmException