Class PanamaComponentInstancePre
java.lang.Object
ai.tegmentum.wasmtime4j.panama.PanamaComponentInstancePre
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.component.ComponentInstancePre,Closeable,AutoCloseable
public final class PanamaComponentInstancePre
extends Object
implements ai.tegmentum.wasmtime4j.component.ComponentInstancePre
Panama FFI implementation of ComponentInstancePre for fast repeated component instantiation.
This implementation uses Panama Foreign Function API to interact with the native Wasmtime library for pre-instantiated component operations.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPanamaComponentInstancePre(MemorySegment nativePreHandle, PanamaEngine engine, ai.tegmentum.wasmtime4j.panama.PanamaComponentImpl component) Creates a new Panama ComponentInstancePre. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longai.tegmentum.wasmtime4j.component.Componentai.tegmentum.wasmtime4j.EnginelongGets the native handle for this pre-instantiated component.longai.tegmentum.wasmtime4j.component.ComponentInstanceai.tegmentum.wasmtime4j.component.ComponentInstanceinstantiate(ai.tegmentum.wasmtime4j.component.ComponentStoreConfig config) booleanisValid()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.tegmentum.wasmtime4j.component.ComponentInstancePre
instanceType, instantiateAsync
-
Constructor Details
-
PanamaComponentInstancePre
public PanamaComponentInstancePre(MemorySegment nativePreHandle, PanamaEngine engine, ai.tegmentum.wasmtime4j.panama.PanamaComponentImpl component) Creates a new Panama ComponentInstancePre.- Parameters:
nativePreHandle- the native pre-instantiated handleengine- the enginecomponent- the component that was pre-instantiated
-
-
Method Details
-
instantiate
public ai.tegmentum.wasmtime4j.component.ComponentInstance instantiate() throws ai.tegmentum.wasmtime4j.exception.WasmException- Specified by:
instantiatein interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
instantiate
public ai.tegmentum.wasmtime4j.component.ComponentInstance instantiate(ai.tegmentum.wasmtime4j.component.ComponentStoreConfig config) throws ai.tegmentum.wasmtime4j.exception.WasmException - Specified by:
instantiatein interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre- Throws:
ai.tegmentum.wasmtime4j.exception.WasmException
-
getEngine
public ai.tegmentum.wasmtime4j.Engine getEngine()- Specified by:
getEnginein interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
getComponent
public ai.tegmentum.wasmtime4j.component.Component getComponent()- Specified by:
getComponentin interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
getInstanceCount
public long getInstanceCount()- Specified by:
getInstanceCountin interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
getPreparationTimeNs
public long getPreparationTimeNs()- Specified by:
getPreparationTimeNsin interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
getAverageInstantiationTimeNs
public long getAverageInstantiationTimeNs()- Specified by:
getAverageInstantiationTimeNsin interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceai.tegmentum.wasmtime4j.component.ComponentInstancePre
-
getNativeHandle
Gets the native handle for this pre-instantiated component.- Returns:
- the native handle
-