1 31 32 package org.apache.commons.httpclient; 33 34 39 class ExecuteMethodThread extends Thread { 40 41 private HttpMethod method; 42 private HttpClient client; 43 44 private Exception exception; 45 46 public ExecuteMethodThread(HttpMethod method, HttpClient client) { 47 this.method = method; 48 this.client = client; 49 } 50 51 public void run() { 52 try { 53 client.executeMethod(method); 54 method.getResponseBodyAsString(); 55 } catch (Exception e) { 56 this.exception = e; 57 } finally { 58 method.releaseConnection(); 59 } 60 } 61 62 65 public HttpMethod getMethod() { 66 return method; 67 } 68 69 74 public Exception getException() { 75 return exception; 76 } 77 78 } 79 | Popular Tags |