@Override protected boolean removeEldestEntry(Map.Entry<Destination, DestinationBridge> enty) { if (size() > maxCacheSize) { Iterator<Map.Entry<Destination, DestinationBridge>> iter = entrySet().iterator(); Map.Entry<Destination, DestinationBridge> lru = iter.next(); remove(lru.getKey()); DestinationBridge bridge = lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: {}", bridge); } catch (Exception e) { LOG.warn("Stopping expired bridge {} caused an exception", bridge, e); } } return false; } };
@Override protected boolean removeEldestEntry(Map.Entry<Destination, DestinationBridge> enty) { if (size() > maxCacheSize) { Iterator<Map.Entry<Destination, DestinationBridge>> iter = entrySet().iterator(); Map.Entry<Destination, DestinationBridge> lru = iter.next(); remove(lru.getKey()); DestinationBridge bridge = lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: {}", bridge); } catch (Exception e) { LOG.warn("Stopping expired bridge {} caused an exception", bridge, e); } } return false; } };
@Override protected boolean removeEldestEntry(Map.Entry<Destination, DestinationBridge> enty) { if (size() > maxCacheSize) { Iterator<Map.Entry<Destination, DestinationBridge>> iter = entrySet().iterator(); Map.Entry<Destination, DestinationBridge> lru = iter.next(); remove(lru.getKey()); DestinationBridge bridge = lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: {}", bridge); } catch (Exception e) { LOG.warn("Stopping expired bridge {} caused an exception", bridge, e); } } return false; } };
@Override protected boolean removeEldestEntry(Map.Entry<Destination, DestinationBridge> enty) { if (size() > maxCacheSize) { Iterator<Map.Entry<Destination, DestinationBridge>> iter = entrySet().iterator(); Map.Entry<Destination, DestinationBridge> lru = iter.next(); remove(lru.getKey()); DestinationBridge bridge = lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: {}", bridge); } catch (Exception e) { LOG.warn("Stopping expired bridge {} caused an exception", bridge, e); } } return false; } };
protected boolean removeEldestEntry(Map.Entry enty) { if (size() > maxCacheSize) { Iterator iter = entrySet().iterator(); Map.Entry lru = (Map.Entry)iter.next(); remove(lru.getKey()); DestinationBridge bridge = (DestinationBridge)lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: " + bridge); } catch (Exception e) { LOG.warn("stopping expired bridge" + bridge + " caused an exception", e); } } return false; } };