/** * Called during {@link net.sf.ehcache.Ehcache#removeAll()} to indicate that the all * elements have been removed from the cache in a bulk operation. The usual * {@link #notifyElementRemoved(net.sf.ehcache.Ehcache,net.sf.ehcache.Element)} * is not called. * <p> * This notification exists because clearing a cache is a special case. It is often * not practical to serially process notifications where potentially millions of elements * have been bulk deleted. * * @param cache the cache emitting the notification */ public void notifyRemoveAll(final Ehcache cache) { if (notAlive()) { return; } if (!replicateRemovals) { return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE_ALL, null, null)); }
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
/** * Called immediately after an attempt to remove an element. The remove method will block until * this method returns. * <p> * This notification is received regardless of whether the cache had an element matching * the removal key or not. If an element was removed, the element is passed to this method, * otherwise a synthetic element, with only the key set is passed in. * <p> * * @param cache the cache emitting the notification * @param element the element just deleted, or a synthetic element with just the key set if * no element was removed. */ public final void notifyElementRemoved(final Ehcache cache, final Element element) throws CacheException { if (notAlive()) { return; } if (!replicateRemovals) { return; } if (!element.isKeySerializable()) { if (LOG.isWarnEnabled()) { LOG.warn("Key " + element.getObjectKey() + " is not Serializable and cannot be replicated."); } return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null)); }
/** * Called during {@link net.sf.ehcache.Ehcache#removeAll()} to indicate that the all * elements have been removed from the cache in a bulk operation. The usual * {@link #notifyElementRemoved(net.sf.ehcache.Ehcache,net.sf.ehcache.Element)} * is not called. * <p/> * This notification exists because clearing a cache is a special case. It is often * not practical to serially process notifications where potentially millions of elements * have been bulk deleted. * * @param cache the cache emitting the notification */ public void notifyRemoveAll(final Ehcache cache) { if (notAlive()) { return; } if (!replicateRemovals) { return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE_ALL, null, null)); }
/** * Called during {@link net.sf.ehcache.Ehcache#removeAll()} to indicate that the all * elements have been removed from the cache in a bulk operation. The usual * {@link #notifyElementRemoved(net.sf.ehcache.Ehcache,net.sf.ehcache.Element)} * is not called. * <p> * This notification exists because clearing a cache is a special case. It is often * not practical to serially process notifications where potentially millions of elements * have been bulk deleted. * * @param cache the cache emitting the notification */ public void notifyRemoveAll(final Ehcache cache) { if (notAlive()) { return; } if (!replicateRemovals) { return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE_ALL, null, null)); }
/** * Called during {@link net.sf.ehcache.Ehcache#removeAll()} to indicate that the all * elements have been removed from the cache in a bulk operation. The usual * {@link #notifyElementRemoved(net.sf.ehcache.Ehcache,net.sf.ehcache.Element)} * is not called. * <p/> * This notification exists because clearing a cache is a special case. It is often * not practical to serially process notifications where potentially millions of elements * have been bulk deleted. * * @param cache the cache emitting the notification */ public void notifyRemoveAll(final Ehcache cache) { if (notAlive()) { return; } if (!replicateRemovals) { return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE_ALL, null, null)); }
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
/** * Called immediately after an attempt to remove an element. The remove method will block until * this method returns. * <p/> * This notification is received regardless of whether the cache had an element matching * the removal key or not. If an element was removed, the element is passed to this method, * otherwise a synthetic element, with only the key set is passed in. * <p/> * * @param cache the cache emitting the notification * @param element the element just deleted, or a synthetic element with just the key set if * no element was removed. */ public final void notifyElementRemoved(final Ehcache cache, final Element element) throws CacheException { if (notAlive()) { return; } if (!replicateRemovals) { return; } if (!element.isKeySerializable()) { if (LOG.isWarnEnabled()) { LOG.warn("Key " + element.getObjectKey() + " is not Serializable and cannot be replicated."); } return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null)); }
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.PUT, null, element)); } else { if (!element.isKeySerializable()) { addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null));
/** * Called immediately after an attempt to remove an element. The remove method will block until * this method returns. * <p> * This notification is received regardless of whether the cache had an element matching * the removal key or not. If an element was removed, the element is passed to this method, * otherwise a synthetic element, with only the key set is passed in. * <p> * * @param cache the cache emitting the notification * @param element the element just deleted, or a synthetic element with just the key set if * no element was removed. */ public final void notifyElementRemoved(final Ehcache cache, final Element element) throws CacheException { if (notAlive()) { return; } if (!replicateRemovals) { return; } if (!element.isKeySerializable()) { if (LOG.isWarnEnabled()) { LOG.warn("Key " + element.getObjectKey() + " is not Serializable and cannot be replicated."); } return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null)); }
/** * Called immediately after an attempt to remove an element. The remove method will block until * this method returns. * <p/> * This notification is received regardless of whether the cache had an element matching * the removal key or not. If an element was removed, the element is passed to this method, * otherwise a synthetic element, with only the key set is passed in. * <p/> * * @param cache the cache emitting the notification * @param element the element just deleted, or a synthetic element with just the key set if * no element was removed. */ public final void notifyElementRemoved(final Ehcache cache, final Element element) throws CacheException { if (notAlive()) { return; } if (!replicateRemovals) { return; } if (!element.isKeySerializable()) { if (LOG.isWarnEnabled()) { LOG.warn("Key " + element.getObjectKey() + " is not Serializable and cannot be replicated."); } return; } addToReplicationQueue(new RmiEventMessage(cache, RmiEventType.REMOVE, element.getKey(), null)); }