// Put the cache in the map before starting, so if it fails in
// start it can still be destroyed later
caches.put("secretive", cache);
// inject our own message listener and re-wire deps
ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
// cr.unregisterComponent(CacheMessageListener.class);
cr.registerComponent(CacheMessageListener.class.getName(), new SecretiveStateCacheMessageListener(), CacheMessageListener.class);
// cr.updateDependencies();
cache.start();
CacheSPI recipient = (CacheSPI) new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_ASYNC), false);
recipient.getConfiguration().setClusterName("VersionedTestBase");
recipient.getConfiguration().setReplVersionString(getReplicationVersion());
// Use a long timeout to facilitate setting debugger breakpoints
recipient.getConfiguration().setStateRetrievalTimeout(60000);
//Put the cache in the map before starting, so if it fails in
// start it can still be destroyed later
caches.put("secretive2", recipient);
// inject our own message listener and re-wire deps
cr = TestingUtil.extractComponentRegistry(recipient);
//cr.unregisterComponent(CacheMessageListener.class);
cr.registerComponent(CacheMessageListener.class.getName(), new SecretiveStateCacheMessageListener(), CacheMessageListener.class);
//cr.updateDependencies();
try
{
recipient.start();