@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); } }
@CacheEntryCreated public void observeAdd(CacheEntryCreatedEvent<String, String> event) { if (event.isPre()) return; log.infof("Cache entry %s added in cache %s", event.getKey(), event.getCache()); }
/** * For each cache we provide a structure to account which keys have been * added. This is handled here. * * @param event the evicted event. */ @SuppressWarnings({ StaticAnalysis.RAWTYPES }) @CacheEntryCreated public void receiveCacheEntryCreated(final CacheEntryCreatedEvent event) { // final org.infinispan.Cache cache = event.getCache(); // final Object o = event.getKey(); // if (o instanceof CompoundKey) // { // final CompoundKey key = (CompoundKey) o; // final AtomicMap map = // AtomicMapLookup.getAtomicMap(cache, key.getName(), true); // map.put(key, key.getKey()); // } }
@CacheEntryCreated public void created(CacheEntryCreatedEvent e) { if (!e.isPre()) newValue = e.getValue(); } }
@CacheEntryCreated @CacheEntryRemoved public void addEvent(TransactionalEvent event) { if (event.isOriginLocal()) { // Local events are processed by local HTTP session listener return; } if (event.isPre()) { // only handle post events return; } if (event.getGlobalTransaction() != null) { map.get(event.getGlobalTransaction().globalId()).add(event); } else { processEvent(event); } }
@CacheEntryCreated public void entryCreated(CacheEntryCreatedEvent cec) { if (cec.isPre()) log.add(TxEvent.CREATED); }
@CacheEntryCreated public void entryCreated(CacheEntryCreatedEvent<String, String> event) { // We are only interested in the post event if (!event.isPre()) System.out.printf("Created %s\n", event.getKey()); }
@CacheEntryCreated public void cacheEntryCreated(CacheEntryCreatedEvent<String, Serializable> event) { eventReceived(event.getKey(), event.getValue()); }
@CacheEntryCreated public void processCacheEntryCreated(CacheEntryCreatedEvent event) { emitSessionCreatedEvent((Session) event.getValue()); }
@CacheEntryCreated @CacheEntryModified @CacheEntryRemoved public void onCacheNotification(CacheEntryEvent<K, V> event) { log.tracef("Received event: %s", event); events.add(event); } }
@CacheEntryCreated public void created(CacheEntryCreatedEvent<KeyValuePair<String, Class>, Boolean> e) { if (!e.isOriginLocal() && !e.isPre() && e.getValue()) { handleClusterRegistryRegistration(e.getKey().getValue()); } }
/** * For each cache we provide a structure to account which keys have been * added. This is handled here. * * @param event the evicted event. */ @SuppressWarnings({ StaticAnalysis.RAWTYPES }) @CacheEntryCreated public void receiveCacheEntryCreated(final CacheEntryCreatedEvent event) { // final org.infinispan.Cache cache = event.getCache(); // final Object o = event.getKey(); // if (o instanceof CompoundKey) // { // final CompoundKey key = (CompoundKey) o; // final AtomicMap map = // AtomicMapLookup.getAtomicMap(cache, key.getName(), true); // map.put(key, key.getKey()); // } }
@CacheEntryCreated public void handleEvent(CacheEntryCreatedEvent<?, ObjectFilter.FilterResult> event) { if (!event.isPre()) { ObjectFilter.FilterResult filterResult = event.getValue(); results.add(filterResult); } }
@CacheEntryCreated @CacheEntryRemoved @SuppressWarnings("unused") public void entryTouched(Event e) { if (!e.isPre()) { log.info("Cache entry touched, now check in different thread"); after.countDown(); // Force a bit of delay in the listener so that lack of visibility // of changes in container can be appreciated more easily TestingUtil.sleepThread(1000); } else { before.countDown(); try { boolean signalled = afterContinue.await(30, TimeUnit.SECONDS); assertTrue("Timed out while waiting for post listener event to execute", signalled); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } } }
@CacheEntryCreated public void handle(CacheEntryCreatedEvent e) { if (e.isPre()) { caller = Thread.currentThread(); latch.countDown(); } } }
/** * Each new item added in the {@link KarmaCache} will trigger a event that will add/update the karma points for the given key * in the persistence layer {@link KarmaRepository} * @param event {@link CacheEntryCreatedEvent} */ @CacheEntryCreated public void entryCreated(CacheEntryCreatedEvent event) { if (event.getValue() != null) { try { karma.updateOrCreateKarma(new Karma(event.getKey().toString().split(":")[0], (int) event.getValue())); } catch (final Exception e) { e.printStackTrace(); } } }
@CacheEntryCreated public void handleEvent(CacheEntryCreatedEvent<?, ObjectFilter.FilterResult> event) { ObjectFilter.FilterResult filterResult = event.getValue(); createEvents.add(filterResult); }
@CacheEntryCreated @CacheEntryModified @CacheEntryRemoved public void onCacheEvent(CacheEntryEvent event) { log.debugf("Adding new cluster event %s", event); events.add(event); } }
@CacheEntryCreated public void created(CacheEntryCreatedEvent<KeyValuePair<String, Class>, Boolean> e) { if (!e.isOriginLocal() && !e.isPre() && e.getValue()) { handleClusterRegistryRegistration(e.getKey().getValue()); } }