private < T > void publishToCacheWriter ( Consumer < T > action , Supplier < T > data ) { if ( ! configuration . isWriteThrough ( ) ) { return ; } try { action . accept ( data . get ( ) ) ; } catch ( CacheWriterException e ) { throw e ; } catch ( RuntimeException e ) { throw new CacheWriterException ( "Exception in CacheWriter" , e ) ; } }
Performs the action with the cache writer if write - through is enabled .