You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Karthik K (Created) (JIRA)" <ji...@apache.org> on 2012/01/18 20:30:41 UTC

[jira] [Created] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Helper methods to release resources of HttpClient / HttpResponse after use 
---------------------------------------------------------------------------

                 Key: HTTPCLIENT-1159
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
             Project: HttpComponents HttpClient
          Issue Type: Improvement
            Reporter: Karthik K
         Attachments: HTTPCLIENT-1159.patch

Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 

New class: 

o.a.http.client.utils.HttpClientUtils added: 
<pre>
  public static void closeQuietly(final HttpResponse response); 
  public static void closeQuietly(final HttpClient httpClient); 
</pre>

with 2 methods ( as above ) in the same, to help release resources: 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment: HTTPCLIENT-1159.patch
    
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Summary: HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use   (was: Helper methods to release resources of HttpClient / HttpResponse after use )
    
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment: HTTPCLIENT-1159.patch

Revised file with test cases
                
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.1.3
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188753#comment-13188753 ] 

Karthik K commented on HTTPCLIENT-1159:
---------------------------------------

Thanks, Oleg and Sebb.  My bad for completely missing that one. Point taken and a new patch uploaded. ( and the old ones removed ). 

Also added the license header to the test class as well. 

Regarding EntityUtils.consumerQuietly , that would probably go into httpcore and a different jira ticket hence ? 



                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment:     (was: HTTPCLIENT-1159.patch)
    
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment:     (was: HTTPCLIENT-1159.patch)
    
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-1159.
-------------------------------------------

    Resolution: Fixed

Patch committed to SVN trunk with some minor changes to the test cases. I had to eliminate calls to www.google.com in order to make unit tests self-contained.

Many thanks, Karthik, for contributing the patch.

Oleg
                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Oleg Kalnichevski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188749#comment-13188749 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1159:
-----------------------------------------------

Sebastian is absolutely right (my bad for missing it). The methods should only catch and discard IOExceptions and let RuntimeExceptions propagate to the caller.

You might also consider adding #consumeQuietly to the EntityUtils class instead.

Oleg 
                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Oleg Kalnichevski (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-1159:
------------------------------------------

    Fix Version/s:     (was: 4.1.3)
                   4.2 Alpha2
    
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment: HTTPCLIENT-1159.patch

Added @since 4.2 to the class and the methods. 
                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Oleg Kalnichevski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188762#comment-13188762 ] 

Oleg Kalnichevski commented on HTTPCLIENT-1159:
-----------------------------------------------

No need for a separate JIRA. I'll sort it out.

Cheers

Oleg
                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment: HTTPCLIENT-1159.patch
    
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188714#comment-13188714 ] 

Karthik K commented on HTTPCLIENT-1159:
---------------------------------------

Removed static logger as per coding guidelines, per discussion in the mailing list. 

Removed logging as well, as it is supposed to close 'quietly' anyway.
                
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

          Component/s: HttpClient
        Fix Version/s: 4.1.3
    Affects Version/s: 4.1.2
    
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.1.3
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188768#comment-13188768 ] 

Karthik K commented on HTTPCLIENT-1159:
---------------------------------------

Well - just logged HTTPCORE-290 and ready with the patch. 

                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPCLIENT-1159) Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Karthik K (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karthik K updated HTTPCLIENT-1159:
----------------------------------

    Attachment: HTTPCLIENT-1159.patch
    
> Helper methods to release resources of HttpClient / HttpResponse after use 
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.1.3
>
>         Attachments: HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPCLIENT-1159) HttpClientUtils - Helper methods to release resources of HttpClient / HttpResponse after use

Posted by "Sebb (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188722#comment-13188722 ] 

Sebb commented on HTTPCLIENT-1159:
----------------------------------

Catching Exception is not ideal; it would be better to catch the expected exceptions and allow any others to propagate.

Also there are now 3 versions of the patch attached; the obsolete ones could perhaps be deleted?
                
> HttpClientUtils  - Helper methods to release resources of HttpClient / HttpResponse after use 
> ----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1159
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1159
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Karthik K
>             Fix For: 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch, HTTPCLIENT-1159.patch
>
>
> Found myself writing this boiler plate code in various httpclient related projects , to release resources , and wanted to provide a simpler way to release resources similar to IOUtils.closeQuietly as opposed to maintaining the same in my code. 
> New class: 
> o.a.http.client.utils.HttpClientUtils added: 
> <pre>
>   public static void closeQuietly(final HttpResponse response); 
>   public static void closeQuietly(final HttpClient httpClient); 
> </pre>
> with 2 methods ( as above ) in the same, to help release resources: 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org