[HHH-5511] (Infinispan Region.destroy() impl should call cache.stop()) Fixed.
[HHH-5512] (JndiInfinispanRegionFactory shouldn't try to stop CacheManager) Fixed. git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@20288 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
8176661952
commit
31037bd103
|
@ -88,4 +88,8 @@ public class JndiInfinispanRegionFactory extends InfinispanRegionFactory {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
// Do not attempt to stop a cache manager because it wasn't created by this region factory.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,7 +150,8 @@ public abstract class BaseRegion implements Region {
|
|||
|
||||
public void destroy() throws CacheException {
|
||||
try {
|
||||
cacheAdapter.clear();
|
||||
cacheAdapter.stop();
|
||||
// cacheAdapter.clear();
|
||||
} finally {
|
||||
cacheAdapter.removeListener(this);
|
||||
}
|
||||
|
|
|
@ -156,6 +156,11 @@ public interface CacheAdapter {
|
|||
*/
|
||||
void clear() throws CacheException;
|
||||
|
||||
/**
|
||||
* Stops the cache.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* Add listener to this cache.
|
||||
*
|
||||
|
|
|
@ -32,6 +32,8 @@ import org.infinispan.config.Configuration;
|
|||
import org.infinispan.context.Flag;
|
||||
import org.infinispan.remoting.rpc.RpcManager;
|
||||
import org.infinispan.util.concurrent.TimeoutException;
|
||||
import org.infinispan.util.logging.Log;
|
||||
import org.infinispan.util.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* CacheAdapterImpl.
|
||||
|
@ -40,6 +42,7 @@ import org.infinispan.util.concurrent.TimeoutException;
|
|||
* @since 3.5
|
||||
*/
|
||||
public class CacheAdapterImpl implements CacheAdapter {
|
||||
private static final Log log = LogFactory.getLog(CacheAdapterImpl.class);
|
||||
|
||||
private final Cache cache;
|
||||
|
||||
|
@ -142,6 +145,12 @@ public class CacheAdapterImpl implements CacheAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (log.isTraceEnabled())
|
||||
log.trace("Stop " + cache);
|
||||
cache.stop();
|
||||
}
|
||||
|
||||
private static boolean isClusteredInvalidation(Configuration.CacheMode cacheMode) {
|
||||
return cacheMode == Configuration.CacheMode.INVALIDATION_ASYNC
|
||||
|| cacheMode == Configuration.CacheMode.INVALIDATION_SYNC;
|
||||
|
|
|
@ -151,11 +151,6 @@ public abstract class AbstractCollectionRegionAccessStrategyTestCase extends Abs
|
|||
|
||||
super.tearDown();
|
||||
|
||||
if (localCollectionRegion != null)
|
||||
localCollectionRegion.destroy();
|
||||
if (remoteCollectionRegion != null)
|
||||
remoteCollectionRegion.destroy();
|
||||
|
||||
try {
|
||||
localCache.withFlags(FlagAdapter.CACHE_MODE_LOCAL).clear();
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -138,11 +138,6 @@ public abstract class AbstractEntityRegionAccessStrategyTestCase extends Abstrac
|
|||
|
||||
super.tearDown();
|
||||
|
||||
if (localEntityRegion != null)
|
||||
localEntityRegion.destroy();
|
||||
if (remoteEntityRegion != null)
|
||||
remoteEntityRegion.destroy();
|
||||
|
||||
try {
|
||||
localCache.withFlags(FlagAdapter.CACHE_MODE_LOCAL).clear();
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue