About Shutdown
Ehcache is shut down through the Ehcache API. Note that Hibernate automatically shuts down its Ehcache CacheManager.
The recommended way to shutdown Ehcache is:

To call CacheManager.shutdown()

In a web app, register the Ehcache ShutdownListener
Though not recommended, you can also register a JVM shutdown hook.