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

Large diffs are not rendered by default.

157 changes: 0 additions & 157 deletions src/main/java/io/roastedroot/proxywasm/impl/Common.java

This file was deleted.

186 changes: 0 additions & 186 deletions src/main/java/io/roastedroot/proxywasm/impl/Exports.java

This file was deleted.

13 changes: 3 additions & 10 deletions src/main/java/io/roastedroot/proxywasm/v1/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ public abstract class Context implements Closeable {

abstract Handler handler();

void activate() throws WasmException {
if (this != proxyWasm.getActiveContext()) {
proxyWasm.setActiveContext(this);
proxyWasm.exports().proxySetEffectiveContext(id);
}
}

public int id() {
return id;
}
Expand All @@ -34,7 +27,7 @@ public void close() {
closeStarted = true;
if (!closeDone) {
// the plugin may want to finish closing later...
if (proxyWasm.exports().proxyOnDone(id)) {
if (proxyWasm.abi().proxyOnDone(id)) {
// close now...
finishClose();
}
Expand All @@ -56,7 +49,7 @@ WasmResult done() {
protected void finishClose() {
closeDone = true;

proxyWasm.exports().proxyOnLog(id);
proxyWasm.abi().proxyOnLog(id);

proxyWasm.contexts().remove(id);
// todo: we likely need to callback to user code to allow cleaning up resources like http
Expand All @@ -67,6 +60,6 @@ protected void finishClose() {

// unset active context so that callbacks don't try to use us.
proxyWasm.setActiveContext(null);
proxyWasm.exports().proxyOnDelete(id);
proxyWasm.abi().proxyOnDelete(id);
}
}
4 changes: 4 additions & 0 deletions src/main/java/io/roastedroot/proxywasm/v1/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ public interface Handler {

default void log(LogLevel level, String message) throws WasmException {}

default LogLevel getLogLevel() throws WasmException {
return LogLevel.TRACE;
}

// TODO: use a better type than Map so that we can support repeated headers
default Map<String, String> getHttpRequestHeaders() {
return null;
Expand Down
Loading