Commit | Line | Data |
---|---|---|
104fa785 FT |
1 | package dolda.jsvc; |
2 | ||
3 | public class RequestThread extends Thread { | |
4 | private Request req; | |
5 | private Responder resp; | |
5cdd61df | 6 | private long stime = 0; |
104fa785 FT |
7 | |
8 | public RequestThread(Responder resp, Request req, ThreadGroup th, String name) { | |
9 | super(th, name); | |
10 | this.resp = resp; | |
11 | this.req = req; | |
12 | } | |
13 | ||
14 | public void run() { | |
5cdd61df | 15 | stime = System.currentTimeMillis(); |
104fa785 | 16 | resp.respond(req); |
4beebc65 FT |
17 | try { |
18 | req.output().close(); | |
19 | } catch(java.io.IOException e) { | |
20 | throw(new RuntimeException(e)); | |
21 | } | |
104fa785 FT |
22 | } |
23 | ||
24 | public static Request request() { | |
25 | return(((RequestThread)Thread.currentThread()).req); | |
26 | } | |
5cdd61df FT |
27 | |
28 | public long stime() { | |
29 | return(stime); | |
30 | } | |
104fa785 | 31 | } |