added finalize method to close connection to elasticsearch when this instance is no longer needed
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-data-search-client@130208 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1816fa42bc
commit
fcde545ef5
|
@ -181,4 +181,12 @@ public class ElasticSearchClientImpl implements ElasticSearchClientInterface{
|
|||
return response.isFound();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
_log.info("Called finalize.. closing connection to elasticsearch");
|
||||
client.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue