Start and stop the key affinity service
Lifecycle KeyAffinityService extends Lifecycle, which allows stopping and (re)starting it: public interface Lifecycle { Â Â void start(); Â Â void stop(); } The service is instantiated through KeyAffinityServiceFactory. All the factory method have an Executors parameter, that is used for asynchronous key generation (so that it won't happen in the caller's thread). It is user's responsibility to handle the shutdown of this Executor. The KeyAffinityService, once started, needs to be explicitly stopped. This stops the async key generation and releases other held resources. The only situation in which KeyAffinityService stopps by itself is when the cache manager with wich it was registered is shutdown.