Skip to content

Commit 813864f

Browse files
committed
Make Plugin an interface instead of an Abstract class.
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
1 parent 3e9ec49 commit 813864f

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,20 @@
1414
import java.util.function.Function;
1515

1616
/**
17-
* Represents an instantiated Proxy-WASM plugin, providing the bridge between the host
17+
* Represents a Proxy-WASM plugin, providing the bridge between the host
1818
* environment and the WASM module.
1919
*
20-
* <p>This abstract class defines the core structure and lifecycle of a plugin.
21-
* Concrete plugin instances are created using the {@link Builder}.
20+
* <p>Concrete Plugin instances are created using the {@link Builder}.
2221
* The actual WASM instance and interaction logic are managed internally.
2322
*/
24-
public abstract class Plugin {
25-
26-
/**
27-
* Protected constructor for subclasses.
28-
*/
29-
protected Plugin() {}
23+
public interface Plugin {
3024

3125
/**
3226
* Returns the configured name of this plugin instance.
3327
*
3428
* @return the plugin name, which might be null if not explicitly set via the builder.
3529
*/
36-
public abstract String name();
30+
String name();
3731

3832
/**
3933
* Creates a new {@link Builder} to configure and construct a {@link Plugin} instance
@@ -42,14 +36,14 @@ protected Plugin() {}
4236
* @param module the compiled {@link WasmModule} representing the plugin's code.
4337
* @return a new {@link Plugin.Builder} instance.
4438
*/
45-
public static Plugin.Builder builder(WasmModule module) {
39+
static Plugin.Builder builder(WasmModule module) {
4640
return new Plugin.Builder(module);
4741
}
4842

4943
/**
5044
* Builder for creating a Plugin instance.
5145
*/
52-
public static final class Builder {
46+
final class Builder {
5347

5448
private final WasmModule module;
5549
private final ProxyWasm.Builder proxyWasmBuilder = ProxyWasm.builder().withStart(false);

proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/Plugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.concurrent.atomic.AtomicInteger;
2828
import java.util.concurrent.locks.ReentrantLock;
2929

30-
public final class Plugin extends io.roastedroot.proxywasm.Plugin {
30+
public final class Plugin implements io.roastedroot.proxywasm.Plugin {
3131

3232
private final ReentrantLock lock = new ReentrantLock();
3333
final ProxyWasm wasm;

0 commit comments

Comments
 (0)