private boolean isRemote(String clientID) { return !ManagerUtil.getClientID().equals(clientID); }
public void notifyRemoveAll(Ehcache theCache) { dmiNotifyRemoveAll(ManagerUtil.getClientID()); }
/** * An unsynchronized check to see if a key is in the Store. No check is made to see if the Element is expired. * * @param key The Element key * @return true if found. If this method return false, it means that an Element with the given key is definitely not * in the MemoryStore. If it returns true, there is an Element there. An attempt to get it may return null if * the Element has expired. */ public final boolean containsKey(Object key) { final boolean rv = map.containsKey(key); if (DebugUtil.DEBUG) { System.err.println("Client-" + ManagerUtil.getClientID() + " " + cache.getName() + " Cache: contains("+key+"): " + rv); } return rv; }
private void logEviction(final K key, final TimestampedValue<V> entry, final int now) { if (config.isLoggingEnabled()) { LOGGER.info(ManagerUtil.getClientID() + " expiring key: " + key + " (expiresAt = " + entry.expiresAt(config) + ", now = " + now + ")"); } }
private void log(String message) { if (config.isLoggingEnabled()) { getLogger().info("[" + ManagerUtil.getClientID() + "] " + message); } }
private void logExpiry(final K key, final TimestampedValue<V> entry, final int now) { if (config.isLoggingEnabled()) { LOGGER.info(ManagerUtil.getClientID() + " expiring key: " + key + " (expiresAt = " + (entry == null ? "[null entry]" : entry.expiresAt(config)) + ", now = " + now + ")"); } }
private void logEviction(final K key, final TimestampedValue<V> entry, final int now) { if (config.isLoggingEnabled()) { logger.info(ManagerUtil.getClientID() + " expiring key: " + key + " (expiresAt = " + entry.expiresAt(config) + ", now = " + now + ")"); } }
private void log(String message) { if (config.isLoggingEnabled()) { getLogger().info("[" + ManagerUtil.getClientID() + "] " + message); } }
private void log(String message) { if (config.isEvictorLoggingEnabled()) { getLogger().info("[" + ManagerUtil.getClientID() + "] " + message); } }
private void log(String message) { if (config.isLoggingEnabled()) { getLogger().info("[" + ManagerUtil.getClientID() + "] " + message); } }
private void logExpiry(final K key, final TimestampedValue<V> entry, final int now) { if (config.isLoggingEnabled()) { LOGGER.info(ManagerUtil.getClientID() + " expiring key: " + key + " (expiresAt = " + (entry == null ? "[null entry]" : entry.expiresAt(config)) + ", now = " + now + ")"); } }
private void log(String message) { if (config.isLoggingEnabled()) { getLogger().info("[" + ManagerUtil.getClientID() + "] " + message); } }
public void notifyElementEvicted(Ehcache theCache, Element element) throws CacheException { dmiNotifyElementEvicted(getKeyForDMI(element), getElementDataForDMI(element), ManagerUtil.getClientID()); }
public void notifyElementUpdated(Ehcache theCache, Element element) throws CacheException { dmiNotifyElementUpdated(getKeyForDMI(element), getElementDataForDMI(element), ManagerUtil.getClientID()); }
private boolean isStillAlive() { if (DebugUtil.DEBUG) { log("Client " + ManagerUtil.getClientID() + ", value: " + value + ", maxTTLMillis: " + timestamp.getMaxTTLMillis() + ", createTime: " + createTime + ", timeToDieMillis: " + getTimeToDieMillis() + ", System.currentTimeMillis() <= getTimeToDieMillis(): " + (System.currentTimeMillis() <= getTimeToDieMillis())); } if (timestamp.getMaxTTLMillis() <= 0) { return true; } return System.currentTimeMillis() <= getTimeToDieMillis(); }
public void notifyElementRemoved(Ehcache theCache, Element element) throws CacheException { dmiNotifyElementRemoved(getKeyForDMI(element), getElementDataForDMI(element), ManagerUtil.getClientID()); }
public void notifyElementPut(Ehcache theCache, Element element) throws CacheException { dmiNotifyElementPut(getKeyForDMI(element), getElementDataForDMI(element), ManagerUtil.getClientID()); }
public void notifyElementExpired(Ehcache theCache, Element element) throws CacheException { dmiNotifyElementExpired(getKeyForDMI(element), getElementDataForDMI(element), ManagerUtil.getClientID()); }
/** * Gets an item from the cache. <p/> The last access time in {@link net.sf.ehcache.Element} is updated. * * @param key the cache key * @return the element, or null if there was no match for the key */ public final synchronized Element get(Object key) { Element element = (Element) map.get(key); if (element != null) { element.updateAccessStatistics(); if (LOG.isTraceEnabled()) { LOG.trace(cache.getName() + "Cache: " + cache.getName() + " MemoryStore hit for " + key); } if (DebugUtil.DEBUG) { System.err.println("Client-" + ManagerUtil.getClientID() + " " + cache.getName() + "Cache: " + cache.getName() + " MemoryStore hit for " + key); } } else { if (LOG.isTraceEnabled()) { LOG.trace(cache.getName() + "Cache: " + cache.getName() + " MemoryStore miss for " + key); } if (DebugUtil.DEBUG) { System.err.println("Client-" + ManagerUtil.getClientID() + " " + cache.getName() + "Cache: " + cache.getName() + " MemoryStore miss for " + key); } } return element; }
private boolean hasNotExpired() { if (DebugUtil.DEBUG) { log("Client " + ManagerUtil.getClientID() + ", value: " + value + ", maxIdleTimeoutMillis: " + timestamp.getMaxIdleMillis() + ", lastAccessedTimeInMillis: " + lastAccessedTimeInMillis + ", idleTimeInMillis: " + getIdleMillis()); } if (timestamp.getMaxIdleMillis() <= 0) { return true; } return getIdleMillis() < timestamp.getMaxIdleMillis(); }