Helper method to send event when a new cache entry is inserted.

@param event the event to send.
557927
protected void sendEntryAddedEvent(CacheEntryEvent<T> event)
    {
        for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners
            .getListeners(org.xwiki.cache.event.CacheEntryListener.class)) {
            listener.cacheEntryAdded(event);
        }
    }
536834
public void afterCommit(PBStateEvent event)
    {
        if(log.isDebugEnabled()) log.debug("afterCommit() call, push objects to application cache");
        if(invokeCounter != 0)
        {
            log.error("** Please check method calls of ObjectCacheTwoLevelImpl#enableMaterialization and" +
                    " ObjectCacheTwoLevelImpl#disableMaterialization, number of calls have to be equals **");
        }
        try
        {
            // we only push "really modified objects" to the application cache
            pushToApplicationCache(TYPE_WRITE, TYPE_CACHED_READ);
        }
        finally
        {
            resetSessionCache();
        }
    }
1092939
public void onApplicationEvent(ContextRefreshedEvent event) {

		if (event.getApplicationContext().equals(context) && targetSource != null) {
			targetSource.freeze();
		}
	}
1238164
void add(int event) {
        int b = bits.addAndGet(event);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "add " + event + ", polling state: " + b);
    }
1065409
public void dispatchEvent(IEvent event) {
        for (IEventListener listener : listeners) {
            if (event.getSource() == null || event.getSource() != listener) {
                listener.notifyEvent(event);
            }
        }
    }
109063
public void publishUpdated(Cache<K, V> cache, K key, V oldValue, V newValue) {
    publish(cache, EventType.UPDATED, key, oldValue, newValue, /* quiet */ false);
  }
218118
public void addEvent(FlowEvent event) throws IOException {
    Put p = createPutForEvent(event);
    Table eventTable = null;
    try {
      eventTable = hbaseConnection
          .getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE));
      eventTable.put(p);
    } finally {
      if (eventTable != null) {
        eventTable.close();
      }
    }
  }
520735
function(event) {
			if(event && event.type === 'Changed' && Array.isArray(event.modified)) {
				event.modified.forEach(function(file) {
					if(typeof file === 'string') {
						this.cache.remove(this._getKey(file));
					}
				}.bind(this));
			}
		}
1212435
protected void enqueueEvent(Object event, EventHandler handler) {
    eventsToDispatch.get().offer(new EventWithHandler(event, handler));
  }
495697
@SuppressWarnings({ "rawtypes", "unchecked" })
   @CacheEntryModified
   @CacheEntryCreated
   @Deprecated
   public void onCacheModification(CacheEntryEvent event){

      if( !event.getKey().equals(key) )
         return;

      if(event.isPre())
         return;

      try {

         GenericJBossMarshaller marshaller = new GenericJBossMarshaller();
         byte[] bb = (byte[]) event.getValue();
         Call call = (Call) marshaller.objectFromByteBuffer(bb);
         if (log.isDebugEnabled()) log.debugf("Receive %s (isOriginLocal=%s) ", call, event.isOriginLocal());
         callExecutor.execute(new AtomicObjectContainerTask(call));

      } catch (Exception e) {
         e.printStackTrace();
      }

   }
615938
public void offerEvent(final Event event) throws IOException
    {
        if (!acceptEvents.get()) {
            // TODO shouldn't we increment eventsLost here?
            return;
        }

        eventsReceived.incrementAndGet();

        try {
            log.debug("Writing event: {}", event);
            eventWriter.write(event);
        }
        catch (IOException e) {
            log.error(String.format("Failed to write event: %s", event), e);
            eventsLost.incrementAndGet();

            throw e;
        }
    }
1148149
public final void flush(CacheEvent event, boolean propagate){
        doFlush(event);
        if(propagate){
            propagate(event);
        }

            String message = "Cache purged: " + (event.getType() == CacheEvent.CacheEventType.ALL
                    ? "all caches" : "table: " + event.getGroup());
            LogFilter.log(LOGGER, LogLevel.DEBUG, message);
    }
150688
@MainThread
    private void handleEventResult(Event event, EventResult result) {
        if (!activeEvents.contains(event)) {
            Utils.logE(event.getKey(), "Cannot send result of finished event");
            return;
        }

        scheduleResultCallbacks(event, result);
        executeTasks(false);
    }
69410
public function onRequestSent(Event $event)
    {
        $request = $event['request'];
        $response = $event['response'];

        if ($request->getParams()->get('cache.hit') === null &&
            $this->canCache->canCacheRequest($request) &&
            $this->canCache->canCacheResponse($response)
        ) {
            $this->storage->cache($request, $response);
        }

        $this->addResponseHeaders($request, $response);
    }
1115652
public void addEventData(CacheEventData cacheEventData) {
        if (events == null) {
            events = new HashSet<CacheEventData>();
        }
        this.events.add(cacheEventData);
    }
929713
public <T> void handleEvent(final T event) throws EventException {
		final Class<?> type = event.getClass();
		if (!this.cachedListeners.containsKey(event.getClass())) {
			this.cachedListeners.put(type, new LinkedList<ListenerInstancePair<?>>());
			for (final ListenerInstancePair<?> listener : this.listeners) {
				final Type observableType = GenericsUtil.getEntityGenericType(listener.listener.getClass(), 0, Listener.class);
				final Class<?> observable = GenericsUtil.guessClazz(observableType);
				if (observable.isAssignableFrom(type)) {
					this.cachedListeners.get(type).add(listener);
				}
			}
		}
		@SuppressWarnings("unchecked")
		final List<ListenerInstancePair<T>> resolvedListeners = List.class.cast(this.cachedListeners.get(event.getClass()));
		for (final ListenerInstancePair<T> listener : resolvedListeners) {
			listener.handleEvent(event, null);
		}
	}
604680
public function triggerEvent(string $event): void
    {
        // TODO: use event library and allow attach events to IFile and ICacheStateful.
        // cache triggers
        if ($this->file instanceof ICacheStateful) {
            switch ($event) {
                case self::EVENT_CACHED:
                    $this->file->setCachedAt($this->name, time());
                    break;
                case self::EVENT_EMPTY:
                case self::EVENT_ERROR:
                case self::EVENT_NOT_FOUND:
                    // TODO: split those and save different cases of cache state.
                    $this->file->setCachedAt($this->name, null);
                    break;
            }

            $this->file->saveState();
        }

        // other triggers
    }