Gracefully stop HT threads when the bundle is being stopped (cache terminated exception)
ISSUE:
When HT bundle is being stopped because container is being destroyed,
infinispan cache terminated exceptions are thrown because HT treads
during their last run are accessing terminated HT caches.
CHANGE:
- Have a stopping flag which gets set when dep mgr calls the HT stopping() method,
so that pending threads and timer tasks can be stopped before Cluster Mgr
terminates the HT caches.
- Fix other static analysis issues in HT code
Change-Id: I3eedb81f9db31c8419502d2eba02aa421616f06a
Signed-off-by: Alessandro Boch <aboch@cisco.com>