Class PanamaWasiExit

java.lang.Object
ai.tegmentum.wasmtime4j.panama.wasi.cli.PanamaWasiExit
All Implemented Interfaces:
ai.tegmentum.wasmtime4j.wasi.cli.WasiExit

public final class PanamaWasiExit extends Object implements ai.tegmentum.wasmtime4j.wasi.cli.WasiExit
Panama FFI implementation of the WasiExit interface.

This class provides access to WASI Preview 2 program termination operations through Panama Foreign Function API calls to the native Wasmtime library.

This implementation ensures defensive programming to prevent native resource leaks and JVM crashes.

Since:
1.0.0
  • Field Summary

    Fields inherited from interface ai.tegmentum.wasmtime4j.wasi.cli.WasiExit

    EXIT_FAILURE, EXIT_SUCCESS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Panama WASI exit with the given native context handle.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    exit(int statusCode)
     

    Methods inherited from class java.lang.Object

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

    • PanamaWasiExit

      public PanamaWasiExit(MemorySegment contextHandle)
      Creates a new Panama WASI exit with the given native context handle.
      Parameters:
      contextHandle - the native context handle
      Throws:
      IllegalArgumentException - if context handle is null
  • Method Details

    • exit

      public void exit(int statusCode)
      Specified by:
      exit in interface ai.tegmentum.wasmtime4j.wasi.cli.WasiExit