CacheManager.stop() destroys all running caches. This is incorrect; since it didn't create them in start(). It should just call releaseCache for all eager-start caches to reduce the ref count. Then make the releaseCache method usable after stop() so if anyone has a ref to the CacheManager they can still release the cache.
This is essentially a workaround-type solution for
JBAS-7228 and JBAS-7229. The correct solution for those is to have services using the CacheManager depend on it, so they stop first. But the MC may not be aware of everything using CacheManager (e.g. a Hibernate SessionFactory created by a ServletContextListener) so it can't always enforce dependencies. And, the ^^^ behavior of stop only undoing what start did is correct anyway.