public void setTimeLimit ( int timeLimit ) { if ( lock == SET ) { throw new IllegalStateException ( "EntryInfo is locked" ) ; } expirationTimeFlag = SET ; this . timeLimit = timeLimit ; if ( timeLimit > 0 ) { long ttlmsec = ( ( long ) timeLimit ) * 1000 ; expirationTime = ttlmsec + System . currentTimeMillis ( ) ; } }
This sets the time limit in the timeLimit variable . Once an entry is cached it will remain in the cache for this many seconds