public void init ( K key ) { if ( null == key ) return ; CacheReference < K > refKey = keyFactory . createKey ( key , queue ) ; if ( cache . containsKey ( refKey ) ) return ; FutureTask < CacheReference < V > > task = new FutureTask <> ( ( ) -> { V created = requireNonNull ( create ( key ) ) ; return valueFactory . createValue ( created , queue ) ; } ) ; cache . put ( refKey , task ) ; task . run ( ) ; }
Asynchronously initialize a new cache value to associate with key . If key is null or key already exist will do nothing . Wraps the create method in a future task and starts a new process .