1 10 11 package org.mule.providers.http; 12 13 import java.io.InputStream ; 14 import java.io.OutputStream ; 15 16 import org.apache.commons.httpclient.HttpMethod; 17 import org.mule.config.i18n.Message; 18 import org.mule.config.i18n.Messages; 19 import org.mule.providers.streaming.StreamMessageAdapter; 20 import org.mule.umo.provider.OutputHandler; 21 22 26 public class HttpStreamMessageAdapter extends StreamMessageAdapter 27 { 28 private static final long serialVersionUID = -7836682641618511926L; 29 30 protected volatile HttpMethod httpMethod; 31 32 public HttpStreamMessageAdapter(InputStream in) 33 { 34 super(in); 35 } 36 37 public HttpStreamMessageAdapter(InputStream in, OutputStream out) 38 { 39 super(in, out); 40 } 41 42 public HttpStreamMessageAdapter(OutputHandler handler) 43 { 44 super(handler); 45 } 46 47 public HttpStreamMessageAdapter(OutputStream out, OutputHandler handler) 48 { 49 super(out, handler); 50 } 51 52 public HttpStreamMessageAdapter(InputStream in, OutputStream out, OutputHandler handler) 53 { 54 super(in, out, handler); 55 } 56 57 public HttpMethod getHttpMethod() 58 { 59 return httpMethod; 60 } 61 62 public void setHttpMethod(HttpMethod httpMethod) 63 { 64 this.httpMethod = httpMethod; 65 } 66 67 public void release() 68 { 69 if (httpMethod == null) 70 { 71 throw new IllegalStateException (new Message(Messages.X_IS_NULL, "httpMethod object").toString()); 72 } 73 else 74 { 75 httpMethod.releaseConnection(); 76 } 77 } 78 } 79 | Popular Tags |