use of net.sf.ehcache.distribution.CacheManagerPeerProvider in project joynr by bmwcarit.
the class BounceProxyEhcacheAdapter method tracePeers.
private void tracePeers() {
CacheManagerPeerProvider peerProvider = manager.getCacheManagerPeerProvider("RMI");
int peers = peerProvider.listRemoteCachePeers(manager.getEhcache(cacheName)).size();
log.trace("Found {} remote cache peer(s)", peers);
}
use of net.sf.ehcache.distribution.CacheManagerPeerProvider in project joynr by bmwcarit.
the class ClusteredBounceProxyControllerTest method waitForCachesJoiningCluster.
private void waitForCachesJoiningCluster() throws InterruptedException {
CacheManager cacheManager = CacheManager.newInstance(getClass().getResource("/ehcache_distributed_test.xml"));
CacheManagerPeerProvider peerProvider = cacheManager.getCacheManagerPeerProvider("RMI");
int peers = 0;
long timeoutMs = 10000;
long startMs = System.currentTimeMillis();
do {
Thread.sleep(1000);
peers = peerProvider.listRemoteCachePeers(cacheManager.getEhcache("bpCache1")).size();
} while (peers < 2 && (System.currentTimeMillis() - startMs < timeoutMs));
Assert.assertEquals(2, peers);
cacheManager.shutdown();
}
Aggregations