Package io.roastedroot.proxywasm.jaxrs
Class WasmPluginFeature
- java.lang.Object
-
- io.roastedroot.proxywasm.jaxrs.internal.AbstractWasmPluginFeature
-
- io.roastedroot.proxywasm.jaxrs.WasmPluginFeature
-
- All Implemented Interfaces:
jakarta.ws.rs.container.DynamicFeature
public class WasmPluginFeature extends io.roastedroot.proxywasm.jaxrs.internal.AbstractWasmPluginFeatureA JAX-RSFeaturethat enables Proxy-Wasm plugin filtering for JAX-RS applications. This feature registers the necessaryWasmPluginFilterto intercept requests and responses for resources annotated withWasmPlugin.To use this feature, register an instance of it with your JAX-RS application, providing the required
ServerAdaptorand a list ofPluginFactoryinstances.If you are using a CDI container like quarkus, you will be using the
WasmPluginFeatureinstead.public class MyApplication extends jakarta.ws.rs.core.Application { @Override public Set<Class<?>> getClasses() { Set<Class<?>> resources = new HashSet<>(); resources.add(MyResource.class); return resources; } @Override public Set<Object> getSingletons() { Set<Object> singletons = new HashSet<>(); try { // Assuming a ServerAdaptor and PluginFactory are available ServerAdaptor serverAdaptor = ...; PluginFactory myPluginFactory = ...; singletons.add(new WasmPluginFeature(serverAdaptor, myPluginFactory)); } catch (StartException e) { throw new RuntimeException("Failed to initialize WasmPluginFeature", e); } return singletons; } }- See Also:
WasmPlugin,WasmPluginFilter,PluginFactory,ServerAdaptor
-
-
Constructor Summary
Constructors Constructor Description WasmPluginFeature(io.roastedroot.proxywasm.internal.ServerAdaptor httpServer, PluginFactory... factories)Constructs a new WasmPluginFeature.WasmPluginFeature(io.roastedroot.proxywasm.internal.ServerAdaptor httpServer, List<PluginFactory> factories)Constructs a new WasmPluginFeature with a list of factories.
-
-
-
Constructor Detail
-
WasmPluginFeature
public WasmPluginFeature(io.roastedroot.proxywasm.internal.ServerAdaptor httpServer, PluginFactory... factories) throws StartExceptionConstructs a new WasmPluginFeature.- Parameters:
httpServer- TheServerAdaptorused to adapt JAX-RS specific request/response objects for the Proxy-Wasm host.factories- One or morePluginFactoryinstances used to create and manage the Proxy-Wasm plugins.- Throws:
StartException- If an error occurs during the initialization or startup of the underlying Proxy-Wasm plugins.
-
WasmPluginFeature
public WasmPluginFeature(io.roastedroot.proxywasm.internal.ServerAdaptor httpServer, List<PluginFactory> factories) throws StartExceptionConstructs a new WasmPluginFeature with a list of factories.- Parameters:
httpServer- TheServerAdaptorused to adapt JAX-RS specific request/response objects for the Proxy-Wasm host.factories- A list ofPluginFactoryinstances used to create and manage the Proxy-Wasm plugins.- Throws:
StartException- If an error occurs during the initialization or startup of the underlying Proxy-Wasm plugins.
-
-