private synchronized Jwt getJwt ( ICacheStrategy cacheStrategy , Jwt . Key key ) { Jwt result = cacheStrategy . getCachedJwt ( key ) ; if ( result == null ) { //cache an empty JWT first. result = new Jwt ( key ) ; cacheStrategy . cacheJwt ( key , result ) ; } return result ; }
cache jwt if not exist