Add a few convenience env accessors.
[jrw.git] / src / jrw / Dispatch.java
1 package jrw;
2
3 import java.util.*;
4
5 public class Dispatch {
6     public static Map<Object, Object> handle(Handler handler, Request req) {
7         try(Environment.Frame f = new Environment().frame()) {
8             while(true) {
9                 try {
10                     return(handler.handle(req));
11                 } catch(Restart r) {
12                     handler = r;
13                 }
14             }
15         }
16     }
17 }