@CacheEntryCreated @CacheEntryModified public void event(CacheEntryEvent<Address, Map.Entry<K, V>> event) { if (event.isOriginLocal() || event.isPre()) return; if (!this.listeners.isEmpty()) { Map.Entry<K, V> entry = event.getValue(); if (entry != null) { this.notifyListeners(event.getType(), entry); } } }
@CacheEntryCreated @CacheEntryRemoved @CacheEntryModified public void addEvent(TransactionalEvent event) { if (event.getGlobalTransaction() != null) { map.get(event.getGlobalTransaction()).add(event); } else { processEvent(event); } }
/** * This method handles entry modified events. * * @param evt The event */ @CacheEntryModified public void entryModified(CacheEntryModifiedEvent<Object,Object> evt) { if (!evt.isPre()) { updated(evt.getKey(), evt.getValue()); } }
@CacheEntryModified @SuppressWarnings("unused") public void modify(CacheEntryEvent e) { modified = true; }
@CacheEntryModified @CacheEntryRemoved @CacheEntriesEvicted public void removed(Event<?, ?> e) { if (!e.isPre()) updateCachedDataTable(); } }
@CacheEntryModified public void cacheEntryModified(CacheEntryModifiedEvent<String, Serializable> event) { eventReceived(event.getKey(), event.getValue()); }
@CacheEntryModified public void entryModified(CacheEntryModifiedEvent<String, String> event) { // We are only interested in the pre event if (event.isPre()) System.out.printf("About to modify %s\n", event.getKey()); } }
@CacheEntryModified public void modified(CacheEntryModifiedEvent e) { if (!e.isPre()) newValue = e.getValue(); }
@CacheEntryModified public void handleEvent(CacheEntryModifiedEvent<?, ObjectFilter.FilterResult> event) { ObjectFilter.FilterResult filterResult = event.getValue(); modifyEvents.add(filterResult); } }
@CacheEntryModified @SuppressWarnings("unused") public void entryModified(CacheEntryModifiedEvent event) { if (!event.isPre()) { lockAcquiredLatch.countDown(); try { waitLatch.await(10, SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } throw new RuntimeException("Induced exception"); } } }
@CacheEntryCreated @CacheEntryModified @CacheEntryRemoved public void onCacheNotification(CacheEntryEvent<K, V> event) { log.tracef("Received event: %s", event); events.add(event); } }
@CacheEntryModified public void cacheEntryModified(CacheEntryModifiedEvent evt) { if (!evt.isPre() && evt.getKey() instanceof CacheId) { final ItemData value = (ItemData)evt.getValue(); onCacheEntryUpdated(value); } } }
@org.infinispan.notifications.cachelistener.annotation.CacheEntryModified public void handle(CacheEntryModifiedEvent e) { handler.handle(e); } }
@CacheEntryRemoved @CacheEntryModified public void callback(TransactionalEvent e) { log.trace("Callback got event " + e); log.debug("Callback got event " + e); assertFalse("entry was removed on remote cache so isLocal should be false", e.isOriginLocal()); } }
/** * Update the karma points of the given key in the database, any event that update values on {@link KarmaCache} will trigger this event * @param event {@link CacheEntryModifiedEvent} */ @CacheEntryModified public void entryModified(CacheEntryModifiedEvent event) { try { karma.updateOrCreateKarma(new Karma(event.getKey().toString().split(":")[0], (int) event.getValue())); } catch (final Exception e) { e.printStackTrace(); } }
@CacheEntryModified public void nodeVisisted(CacheEntryModifiedEvent event) { // we need isPre since lock is acquired in the commit phase if ( !event.isPre() && event.getKey().equals( key ) ) { try { synchronized (this) { if (enabled) { triggerLatch.countDown(); enabled = false; blockLatch.await(); } } } catch (InterruptedException e) { log.error( "Interrupted waiting for latch", e ); } } } }
@CacheEntryModified public void handleEvent(CacheEntryModifiedEvent<?, ObjectFilter.FilterResult> event) { if (!event.isPre()) { ObjectFilter.FilterResult filterResult = event.getValue(); results.add(filterResult); } } }
@CacheEntryModified public void entryModified(CacheEntryModifiedEvent event) { ClusteredLockValue value = (ClusteredLockValue) event.getValue(); if (value.getState() == ClusteredLockState.RELEASED) { if (trace) { log.tracef("LOCK[%s] Lock has been released, %s notified", getName(), originator); } retryPendingRequests(value); } }
@CacheEntryCreated @CacheEntryModified @CacheEntryRemoved public void onCacheEvent(CacheEntryEvent event) { log.debugf("Adding new cluster event %s", event); events.add(event); } }
@CacheEntryModified public void observeModify(CacheEntryModifiedEvent<Object, Object> event) { if (event.isPre()) { return; } if (this.toBeUpdated != null) { this.toBeUpdated.entryUpdated(event.getKey(), event.getValue(), this.containerName, this.cacheName, event.isOriginLocal()); } }