File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
core/javax.cache/src/main/java/org/wso2/carbon/caching/impl Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,24 @@ public void put(K key, V value) {
400400 }
401401 }
402402
403+ @ Override
404+ public void putOnRead (K key , V value ) {
405+
406+ Util .checkAccess (ownerTenantDomain , ownerTenantId );
407+ checkStatusStarted ();
408+ lastAccessed = System .currentTimeMillis ();
409+ CacheEntry entry = localCache .get (key );
410+ V oldValue = entry != null ? (V ) entry .getValue () : null ;
411+ if (oldValue == null ) {
412+ internalPut (key , value );
413+ notifyCacheEntryCreated (key , value );
414+ } else {
415+ if (log .isDebugEnabled ()) {
416+ log .debug ("Cache already populated on read. Key: " + key + ", Existing value: " + oldValue );
417+ }
418+ }
419+ }
420+
403421 @ Override
404422 public void putIfNoDuplicate (K key , V value ) {
405423
You can’t perform that action at this time.
0 commit comments