diff --git a/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java b/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java index 21a225a..55e9879 100644 --- a/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java +++ b/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java @@ -14,26 +14,20 @@ import java.util.function.Function; /** - * Represents an instantiated Proxy-WASM plugin, providing the bridge between the host + * Represents a Proxy-WASM plugin, providing the bridge between the host * environment and the WASM module. * - *

This abstract class defines the core structure and lifecycle of a plugin. - * Concrete plugin instances are created using the {@link Builder}. + *

Concrete Plugin instances are created using the {@link Builder}. * The actual WASM instance and interaction logic are managed internally. */ -public abstract class Plugin { - - /** - * Protected constructor for subclasses. - */ - protected Plugin() {} +public interface Plugin { /** * Returns the configured name of this plugin instance. * * @return the plugin name, which might be null if not explicitly set via the builder. */ - public abstract String name(); + String name(); /** * Creates a new {@link Builder} to configure and construct a {@link Plugin} instance @@ -42,14 +36,14 @@ protected Plugin() {} * @param module the compiled {@link WasmModule} representing the plugin's code. * @return a new {@link Plugin.Builder} instance. */ - public static Plugin.Builder builder(WasmModule module) { + static Plugin.Builder builder(WasmModule module) { return new Plugin.Builder(module); } /** * Builder for creating a Plugin instance. */ - public static final class Builder { + final class Builder { private final WasmModule module; private final ProxyWasm.Builder proxyWasmBuilder = ProxyWasm.builder().withStart(false); diff --git a/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/Plugin.java b/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/Plugin.java index 0aef0d8..697514a 100644 --- a/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/Plugin.java +++ b/proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/Plugin.java @@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; -public final class Plugin extends io.roastedroot.proxywasm.Plugin { +public final class Plugin implements io.roastedroot.proxywasm.Plugin { private final ReentrantLock lock = new ReentrantLock(); final ProxyWasm wasm;