Coverage Report - org.mule.providers.http.HttpStreamMessageAdapter
 
Classes in this File Line Coverage Branch Coverage Complexity
HttpStreamMessageAdapter
0%
0/17
0%
0/2
1.25
 
 1  
 /*
 2  
  * $Id: HttpStreamMessageAdapter.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.providers.http;
 12  
 
 13  
 import org.mule.config.i18n.CoreMessages;
 14  
 import org.mule.providers.streaming.StreamMessageAdapter;
 15  
 import org.mule.umo.provider.OutputHandler;
 16  
 
 17  
 import java.io.InputStream;
 18  
 import java.io.OutputStream;
 19  
 
 20  
 import org.apache.commons.httpclient.HttpMethod;
 21  
 
 22  
 /**
 23  
  * A HttpStream adapter that can be used with the HttpClientMessageDispatcher who
 24  
  * knows when to release the Http Connection.
 25  
  */
 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  0
         super(in);
 35  0
     }
 36  
 
 37  
     public HttpStreamMessageAdapter(InputStream in, OutputStream out)
 38  
     {
 39  0
         super(in, out);
 40  0
     }
 41  
 
 42  
     public HttpStreamMessageAdapter(OutputHandler handler)
 43  
     {
 44  0
         super(handler);
 45  0
     }
 46  
 
 47  
     public HttpStreamMessageAdapter(OutputStream out, OutputHandler handler)
 48  
     {
 49  0
         super(out, handler);
 50  0
     }
 51  
 
 52  
     public HttpStreamMessageAdapter(InputStream in, OutputStream out, OutputHandler handler)
 53  
     {
 54  0
         super(in, out, handler);
 55  0
     }
 56  
 
 57  
     public HttpMethod getHttpMethod()
 58  
     {
 59  0
         return httpMethod;
 60  
     }
 61  
 
 62  
     public void setHttpMethod(HttpMethod httpMethod)
 63  
     {
 64  0
         this.httpMethod = httpMethod;
 65  0
     }
 66  
 
 67  
     public void release()
 68  
     {
 69  0
         if (httpMethod == null)
 70  
         {
 71  0
             throw new IllegalStateException(CoreMessages.objectIsNull("httpMethod object").toString());
 72  
         }
 73  
         else
 74  
         {
 75  0
             httpMethod.releaseConnection();
 76  
         }
 77  0
     }
 78  
 }