Search in sources :

Example 1 with CacheManagerPeerProvider

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);
}
Also used : CacheManagerPeerProvider(net.sf.ehcache.distribution.CacheManagerPeerProvider)

Example 2 with CacheManagerPeerProvider

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();
}
Also used : CacheManager(net.sf.ehcache.CacheManager) CacheManagerPeerProvider(net.sf.ehcache.distribution.CacheManagerPeerProvider)

Aggregations

CacheManagerPeerProvider (net.sf.ehcache.distribution.CacheManagerPeerProvider)2 CacheManager (net.sf.ehcache.CacheManager)1