protected void putElement ( Ehcache cache , Element element ) { final Set < CacheEntryTag > tags = this . getTags ( element ) ; // Check if the key is tagged if ( tags != null && ! tags . isEmpty ( ) ) { final String cacheName = cache . getName ( ) ; final Object key = element . getObjectKey ( ) ; final LoadingCache < CacheEntryTag , Set < Object > > cacheKeys = taggedCacheKeys . getUnchecked ( cacheName ) ; logger . debug ( "Tracking {} tags in cache {} for key {}" , tags . size ( ) , cacheName , key ) ; // Add all the tags to the tracking map for ( final CacheEntryTag tag : tags ) { // Record that this tag type is stored in this cache final String tagType = tag . getTagType ( ) ; final Set < Ehcache > caches = taggedCaches . getUnchecked ( tagType ) ; caches . add ( cache ) ; // Record the tag->key association final Set < Object > taggedKeys = cacheKeys . getUnchecked ( tag ) ; taggedKeys . add ( key ) ; } } }
If the element has a TaggedCacheKey record the tag associations