Class PanamaWasiHttpContext
java.lang.Object
ai.tegmentum.wasmtime4j.panama.wasi.http.PanamaWasiHttpContext
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext,Closeable,AutoCloseable
public final class PanamaWasiHttpContext
extends Object
implements ai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
Panama implementation of
WasiHttpContext.
This class wraps the native WASI HTTP context and provides HTTP capabilities to WebAssembly modules. It manages the lifecycle of the native context and ensures proper resource cleanup.
-
Constructor Summary
ConstructorsConstructorDescriptionPanamaWasiHttpContext(ai.tegmentum.wasmtime4j.wasi.http.WasiHttpConfig config) Creates a new PanamaWasiHttpContext with the specified configuration. -
Method Summary
-
Constructor Details
-
PanamaWasiHttpContext
public PanamaWasiHttpContext(ai.tegmentum.wasmtime4j.wasi.http.WasiHttpConfig config) throws ai.tegmentum.wasmtime4j.exception.WasmException Creates a new PanamaWasiHttpContext with the specified configuration.- Parameters:
config- the HTTP configuration- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException- if the context cannot be createdIllegalArgumentException- if config is null
-
-
Method Details
-
getConfig
public ai.tegmentum.wasmtime4j.wasi.http.WasiHttpConfig getConfig()- Specified by:
getConfigin interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
isHostAllowed
- Specified by:
isHostAllowedin interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
getStats
public ai.tegmentum.wasmtime4j.wasi.http.WasiHttpStats getStats()- Specified by:
getStatsin interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceai.tegmentum.wasmtime4j.wasi.http.WasiHttpContext
-
toString
-