RusticiSoftware / TinCanJava

Tin Can Java Library
http://rusticisoftware.github.io/TinCanJava/
Apache License 2.0
44 stars 46 forks source link

Added destroy method to safely close the httpClient connections #44

Closed alycklama closed 8 years ago

alycklama commented 8 years ago

Threads remain active within Java EE applications, without decent shutdown

brianjmiller commented 8 years ago

Please switch tabs to 4 spaces.

brianjmiller commented 8 years ago

_httpClient is a static so this method probably ought to be as well, and it needs to set the property to null so that subsequent calls (which I realize is odd) causes the value to be re-instantiated.

brianjmiller commented 8 years ago

Based on above comment it might make more sense to rename the method to something being more specific, kind of like the existing setHTTPClientConnectTimeout method.... destroyHTTPClient perhaps?

brianjmiller commented 8 years ago

@alycklama thanks for the submission, thoughts on the above?

gomezgoiri commented 8 years ago

+1 for the idea of making the method static, renaming it and setting the static attribute to null. I think that it would probably avoid confusions.

brianjmiller commented 8 years ago

Closing this based on inactivity and #50 capturing the important concepts.