@org.infinispan.notifications.cachelistener.annotation.CacheEntryLoaded public void handle(CacheEntryLoadedEvent e) { handler.handle(e); } }
@Override @CacheEntryLoaded public void fire(CacheEntryLoadedEvent<K, V> payload) { super.fire(new CDICacheEntryLoadedEvent(payload)); } }
@Override @CacheEntryLoaded public void fire(CacheEntryLoadedEvent<K, V> payload) { super.fire(new CDICacheEntryLoadedEvent(payload)); } }
@CacheEntryLoaded public void dataLoaded(CacheEntryLoadedEvent event) { if (log.isTraceEnabled()) { if (event.isPre()) { log.trace("Going to load entry " + event.getKey() + " from the cache " + event.getCache().getName()); } else { log.trace("Loaded entry " + event.getKey() + " from the cache " + event.getCache().getName()); } } }
@CacheEntryLoaded public void handleLoaded(CacheEntryEvent e) { if (e.isPre()) loaded.add(e.getKey()); }
@CacheEntryActivated @CacheEntryCreated @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited public void event(Event event) throws Throwable { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String notFoundPackage = "org.infinispan.test.hibernate.cache.functional.entities"; String[] notFoundClasses = { notFoundPackage + ".Account", notFoundPackage + ".AccountHolder" }; SelectedClassnameClassLoader visible = new SelectedClassnameClassLoader(null, null, notFoundClasses, cl); Thread.currentThread().setContextClassLoader(visible); super.event(event); Thread.currentThread().setContextClassLoader(cl); } }
@CacheEntryActivated @CacheEntryCreated @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited public void event(Event event) throws Throwable { List<Method> methods = this.methods.get(event.getType()); if (methods != null) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); ClassLoader visible = (ClassLoader) cache.classLoaderRef.get(); cache.setContextClassLoader(visible); try { for (Method method : this.methods.get(event.getType())) { try { method.invoke(this.listener, event); } catch (InvocationTargetException e) { throw e.getCause(); } } } finally { cache.setContextClassLoader(classLoader); } } }
@CacheEntryActivated @CacheEntryCreated @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited @CacheEntryExpired public void processEvent(CacheEntryEvent<Object, Object> event) { dispatch(event.getType().toString(), event.isPre(), event.getCache().getName(), event.getKey()); }
@CacheEntryActivated @CacheEntryCreated @CacheEntriesEvicted @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited @TransactionCompleted @TransactionRegistered @CacheEntryExpired public void handle(Event e) { events.add(e); if (e.isPre()) receivedPre = true; else receivedPost = true; invocationCount++; } }
@CacheEntryActivated @CacheEntryCreated @CacheEntriesEvicted @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited @TransactionCompleted @TransactionRegistered public void handle(Event e) { events.add(e); if (e.isPre()) receivedPre = true; else receivedPost = true; invocationCount++; } }
@CacheEntryActivated @CacheEntryCreated @CacheEntriesEvicted @CacheEntryInvalidated @CacheEntryLoaded @CacheEntryModified @CacheEntryPassivated @CacheEntryRemoved @CacheEntryVisited @TransactionCompleted @TransactionRegistered public void handle(Event e) { try { Object value = e.getCache().getAdvancedCache().withFlags(Flag.SKIP_LISTENER_NOTIFICATION).get("key"); log.debugf("Event=%s, value=%s", e, value); } catch (Throwable throwable) { list.add(throwable); } }