mirror of
https://github.com/extism/extism.git
synced 2026-01-10 22:37:58 -05:00
refactor(java-sdk): Revise API usage (#177)
(cherry picked from commit 766090a1aa8340598c643ca01dded16b15c26ba5)
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package org.extism.sdk;
|
||||
|
||||
import org.extism.sdk.manifest.Manifest;
|
||||
|
||||
import com.sun.jna.Pointer;
|
||||
import org.extism.sdk.manifest.Manifest;
|
||||
|
||||
/**
|
||||
* Extism Context is used to store and manage plugins.
|
||||
@@ -63,6 +62,7 @@ public class Context implements AutoCloseable {
|
||||
|
||||
/**
|
||||
* Get the error associated with a context, if plugin is {@literal null} then the context error will be returned.
|
||||
*
|
||||
* @param plugin
|
||||
* @return the error message
|
||||
*/
|
||||
@@ -72,6 +72,7 @@ public class Context implements AutoCloseable {
|
||||
|
||||
/**
|
||||
* Return the raw pointer to this context.
|
||||
*
|
||||
* @return the pointer
|
||||
*/
|
||||
public Pointer getPointer() {
|
||||
|
||||
@@ -11,10 +11,14 @@ import java.util.Objects;
|
||||
public class Extism {
|
||||
|
||||
/**
|
||||
* Configure the
|
||||
* Configure a log file with the given {@link Path} and configure the given {@link LogLevel}.
|
||||
*
|
||||
* @param path
|
||||
* @param level
|
||||
*
|
||||
* @deprecated will be replaced with better logging API.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void setLogFile(Path path, LogLevel level) {
|
||||
|
||||
Objects.requireNonNull(path, "path");
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.extism.sdk;
|
||||
import com.sun.jna.Library;
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.ptr.IntByReference;
|
||||
|
||||
/**
|
||||
* Wrapper around the Extism library.
|
||||
@@ -14,7 +13,7 @@ public interface LibExtism extends Library {
|
||||
* Holds the extism library instance.
|
||||
* Resolves the extism library based on the resolution algorithm defined in {@link com.sun.jna.NativeLibrary}.
|
||||
*/
|
||||
LibExtism INSTANCE = Native.loadLibrary("extism", LibExtism.class);
|
||||
LibExtism INSTANCE = Native.load("extism", LibExtism.class);
|
||||
|
||||
/**
|
||||
* Create a new context
|
||||
@@ -36,7 +35,7 @@ public interface LibExtism extends Library {
|
||||
/**
|
||||
* Sets the logger to the given path with the given level of verbosity
|
||||
*
|
||||
* @param path The file path of the logger
|
||||
* @param path The file path of the logger
|
||||
* @param logLevel The level of the logger
|
||||
* @return true if successful
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user