return new MulticastRMICacheManagerPeerProvider(cacheManager, groupAddress, multicastPort, timeToLive, hostAddress);
for (Iterator iterator = peerUrls.keySet().iterator(); iterator.hasNext();) { String rmiUrl = (String) iterator.next(); String rmiUrlCacheName = extractCacheName(rmiUrl); try { if (!rmiUrlCacheName.equals(cache.getName())) { if (!stale(date)) { CachePeer cachePeer = cachePeerEntry.cachePeer; remoteCachePeers.add(cachePeer);
/** * @param rmiUrls * @return true if our own hostname and listener port are found in the list. This then means we have * caught our onw multicast, and should be ignored. */ private boolean self(String rmiUrls) { CacheManager cacheManager = peerProvider.getCacheManager(); CacheManagerPeerListener cacheManagerPeerListener = cacheManager.getCachePeerListener("RMI"); if (cacheManagerPeerListener == null) { return false; } List boundCachePeers = cacheManagerPeerListener.getBoundCachePeers(); if (boundCachePeers == null || boundCachePeers.size() == 0) { return false; } CachePeer peer = (CachePeer) boundCachePeers.get(0); try { String cacheManagerUrlBase = peer.getUrlBase(); int baseUrlMatch = rmiUrls.indexOf(cacheManagerUrlBase); return baseUrlMatch != -1; } catch (RemoteException e) { LOG.error("Error geting url base", e); return false; } }
try { CachePeerEntry cachePeerEntry = (CachePeerEntry) peerUrls.get(rmiUrl); if (cachePeerEntry == null || stale(cachePeerEntry.date)) { CachePeer cachePeer = lookupRemoteCachePeer(rmiUrl); cachePeerEntry = new CachePeerEntry(cachePeer, new Date()); + e.getMessage()); unregisterPeer(rmiUrl); } catch (NotBoundException e) { peerUrls.remove(rmiUrl);
/** * Whether the entry should be considered stale. * This will depend on the type of RMICacheManagerPeerProvider. * This method should be overridden for implementations that go stale based on date * * @param date the date the entry was created * @return true if stale */ protected final boolean stale(Date date) { long now = System.currentTimeMillis(); return date.getTime() < (now - getStaleTime()); }
private void registerNotification(String rmiUrl) { peerProvider.registerPeer(rmiUrl); }
try { CachePeerEntry cachePeerEntry = (CachePeerEntry) peerUrls.get(rmiUrl); if (cachePeerEntry == null || stale(cachePeerEntry.date)) { CachePeer cachePeer = lookupRemoteCachePeer(rmiUrl); cachePeerEntry = new CachePeerEntry(cachePeer, new Date()); + e.getMessage()); unregisterPeer(rmiUrl); } catch (NotBoundException e) { peerUrls.remove(rmiUrl);
/** * Whether the entry should be considered stale. * This will depend on the type of RMICacheManagerPeerProvider. * This method should be overridden for implementations that go stale based on date * * @param date the date the entry was created * @return true if stale */ protected final boolean stale(Date date) { long now = System.currentTimeMillis(); return date.getTime() < (now - getStaleTime()); }
private void registerNotification(String rmiUrl) { peerProvider.registerPeer(rmiUrl); }
try { CachePeerEntry cachePeerEntry = (CachePeerEntry) peerUrls.get(rmiUrl); if (cachePeerEntry == null || stale(cachePeerEntry.date)) { CachePeer cachePeer = lookupRemoteCachePeer(rmiUrl); cachePeerEntry = new CachePeerEntry(cachePeer, new Date()); + e.getMessage()); unregisterPeer(rmiUrl); } catch (NotBoundException e) { peerUrls.remove(rmiUrl);
for (Iterator iterator = peerUrls.keySet().iterator(); iterator.hasNext();) { String rmiUrl = (String) iterator.next(); String rmiUrlCacheName = extractCacheName(rmiUrl); try { if (!rmiUrlCacheName.equals(cache.getName())) { if (!stale(date)) { CachePeer cachePeer = cachePeerEntry.cachePeer; remoteCachePeers.add(cachePeer);
/** * Whether the entry should be considered stale. * This will depend on the type of RMICacheManagerPeerProvider. * This method should be overridden for implementations that go stale based on date * * @param date the date the entry was created * @return true if stale */ protected final boolean stale(Date date) { long now = System.currentTimeMillis(); return date.getTime() < (now - getStaleTime()); }
private void registerNotification(String rmiUrl) { peerProvider.registerPeer(rmiUrl); }
/** * @param rmiUrls * @return true if our own hostname and listener port are found in the list. This then means we have * caught our onw multicast, and should be ignored. */ private boolean self(String rmiUrls) { CacheManager cacheManager = peerProvider.getCacheManager(); CacheManagerPeerListener cacheManagerPeerListener = cacheManager.getCachePeerListener("RMI"); if (cacheManagerPeerListener == null) { return false; } List boundCachePeers = cacheManagerPeerListener.getBoundCachePeers(); if (boundCachePeers == null || boundCachePeers.size() == 0) { return false; } CachePeer peer = (CachePeer) boundCachePeers.get(0); try { String cacheManagerUrlBase = peer.getUrlBase(); int baseUrlMatch = rmiUrls.indexOf(cacheManagerUrlBase); return baseUrlMatch != -1; } catch (RemoteException e) { LOG.error("Error geting url base", e); return false; } }
return new MulticastRMICacheManagerPeerProvider(cacheManager, groupAddress, multicastPort, timeToLive, hostAddress);
try { CachePeerEntry cachePeerEntry = (CachePeerEntry) peerUrls.get(rmiUrl); if (cachePeerEntry == null || stale(cachePeerEntry.date)) { CachePeer cachePeer = lookupRemoteCachePeer(rmiUrl); cachePeerEntry = new CachePeerEntry(cachePeer, new Date()); + e.getMessage()); unregisterPeer(rmiUrl); } catch (NotBoundException e) { peerUrls.remove(rmiUrl);
for (Iterator iterator = peerUrls.keySet().iterator(); iterator.hasNext();) { String rmiUrl = (String) iterator.next(); String rmiUrlCacheName = extractCacheName(rmiUrl); try { if (!rmiUrlCacheName.equals(cache.getName())) { if (!stale(date)) { CachePeer cachePeer = cachePeerEntry.cachePeer; remoteCachePeers.add(cachePeer);
/** * Whether the entry should be considered stale. * This will depend on the type of RMICacheManagerPeerProvider. * This method should be overridden for implementations that go stale based on date * * @param date the date the entry was created * @return true if stale */ protected final boolean stale(Date date) { long now = System.currentTimeMillis(); return date.getTime() < (now - getStaleTime()); }
private void registerNotification(String rmiUrl) { peerProvider.registerPeer(rmiUrl); }
/** * @param rmiUrls * @return true if our own hostname and listener port are found in the list. This then means we have * caught our onw multicast, and should be ignored. */ private boolean self(String rmiUrls) { CacheManager cacheManager = peerProvider.getCacheManager(); CacheManagerPeerListener cacheManagerPeerListener = cacheManager.getCachePeerListener("RMI"); if (cacheManagerPeerListener == null) { return false; } List boundCachePeers = cacheManagerPeerListener.getBoundCachePeers(); if (boundCachePeers == null || boundCachePeers.size() == 0) { return false; } CachePeer peer = (CachePeer) boundCachePeers.get(0); try { String cacheManagerUrlBase = peer.getUrlBase(); int baseUrlMatch = rmiUrls.indexOf(cacheManagerUrlBase); return baseUrlMatch != -1; } catch (RemoteException e) { LOG.error("Error geting url base", e); return false; } }