2.5. Stopping and Destroying the Cache
It is good practice to stop and destroy your cache when you are done using it, particularly if it is a clustered cache and has thus used a JGroups channel. Stopping and destroying a cache ensures resources like network sockets and maintenance threads are properly cleaned up.
cache.stop(); cache.destroy();
Not also that a cache that has had
stop()
invoked on it can be started again with a new call to start()
. Similarly, a cache that has had destroy()
invoked on it can be created again with a new call to create()
(and then started again with a start()
call).