Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>This abstract class defines the core structure and lifecycle of a plugin.
* Concrete plugin instances are created using the {@link Builder}.
* <p>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
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down