forked from roastedroot/proxy-wasm-java-host
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
30 lines (26 loc) · 1.04 KB
/
App.java
File metadata and controls
30 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package io.roastedroot.proxywasm.jaxrs.example;
import com.dylibso.chicory.experimental.aot.AotMachine;
import com.dylibso.chicory.wasm.Parser;
import com.dylibso.chicory.wasm.WasmModule;
import io.roastedroot.proxywasm.StartException;
import io.roastedroot.proxywasm.plugin.Plugin;
import io.roastedroot.proxywasm.plugin.PluginFactory;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import java.nio.file.Path;
@ApplicationScoped
public class App {
private static WasmModule module =
Parser.parse(
Path.of("../proxy-wasm-java-host/src/test/go-examples/unit_tester/main.wasm"));
// configure the the example wasm plugin
@Produces
public PluginFactory example() throws StartException {
return () ->
Plugin.builder()
.withName("example")
.withPluginConfig("{ \"type\": \"headerTests\" }")
.withMachineFactory(AotMachine::new)
.build(module);
}
}