From d3d92d6cb3b182798cf7cfb8dcd265b0727a663a Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Fri, 25 Feb 2022 17:12:21 +0100 Subject: [PATCH] Rename Environment to Dispatch. --- src/jrw/{Environment.java => Dispatch.java} | 4 ++-- src/jrw/FormData.java | 4 ++-- src/jrw/JagiWrapper.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/jrw/{Environment.java => Dispatch.java} (58%) diff --git a/src/jrw/Environment.java b/src/jrw/Dispatch.java similarity index 58% rename from src/jrw/Environment.java rename to src/jrw/Dispatch.java index f0f1347..d08867c 100644 --- a/src/jrw/Environment.java +++ b/src/jrw/Dispatch.java @@ -2,8 +2,8 @@ package jrw; import java.util.*; -public class Environment { - public static Map dispatch(Handler handler, Request req) { +public class Dispatch { + public static Map handle(Handler handler, Request req) { while(true) { try { return(handler.handle(req)); diff --git a/src/jrw/FormData.java b/src/jrw/FormData.java index 9949f91..fae320b 100644 --- a/src/jrw/FormData.java +++ b/src/jrw/FormData.java @@ -158,12 +158,12 @@ public class FormData extends HashMap { Map resp = new HashMap<>(); if(req.ihead("Content-Type", "").equals("application/x-www-form-urlencoded")) { resp.put("jagi.status", "feed-input"); - resp.put("jagi.next", (Function, Map>)env -> Environment.dispatch(next, req)); + resp.put("jagi.next", (Function, Map>)env -> Dispatch.handle(next, req)); resp.put("jagi.input-sink", new Collector(req)); } else { read(req); resp.put("jagi.status", "chain"); - resp.put("jagi.next", (Function, Map>)env -> Environment.dispatch(next, req)); + resp.put("jagi.next", (Function, Map>)env -> Dispatch.handle(next, req)); } return(resp); } diff --git a/src/jrw/JagiWrapper.java b/src/jrw/JagiWrapper.java index 8b1a3fb..451d8fe 100644 --- a/src/jrw/JagiWrapper.java +++ b/src/jrw/JagiWrapper.java @@ -5,7 +5,7 @@ import java.util.function.*; public abstract class JagiWrapper implements Handler, Function, Map> { public Map apply(Map env) { - return(Environment.dispatch(this, new Request(env))); + return(Dispatch.handle(this, new Request(env))); } public static JagiWrapper of(Handler handler) { -- 2.11.0