@Provides @ExecutionScoped Response response(Execution execution) throws Throwable { return execution .maybeGet(Response.class) .orElseThrow( () -> { throw new RuntimeException( "Cannot inject Response in execution scope as execution has no response object - this execution is not processing a request"); }); }
@Provides @ExecutionScoped Execution execution() { return Execution.current(); }