public void wakeUp(long startDaemonTime, long startWakeUpTime) {
        if ( UNIT_TEST_INACTIVITY ) {
            System.out.println("wakUp() - entry");
        }
        //final String methodName = "wakeUp()";
        boolean bTimeOutChecked = false;
        try {
            // check the cache entries timeout when one of following conditions meet
            // (1) lruToDiskTriggerTime == timeoutTriggerTime (TLD granularity; default 5 sec)
            // (2) time elapsed >= timeoutTriggerTime (5 sec) since the last timeout checked.
            if (this.lruToDiskTriggerTime == this.timeoutTriggerTime || 
                ((startWakeUpTime - this.lastTimeoutCheckedTime) >= this.timeoutTriggerTime)) {
                this.lastTimeoutCheckedTime = startWakeUpTime;
                ArrayList <InvalidationData> invalidateIds = new ArrayList <InvalidationData>();
                Iterator walker = cacheInstancesTable.entrySet().iterator();
                while (walker.hasNext()) {
                    Map.Entry entry = (Map.Entry) walker.next();
                    DCache cache = (DCache) entry.getKey();
                    ExpirationMetaData expirationMetaData = (ExpirationMetaData) entry.getValue();
                    synchronized (expirationMetaData) {
                        InvalidationTask currentTask = expirationMetaData.timeLimitHeap.minimum();
                        while (currentTask != null) {
                            if ( UNIT_TEST_INACTIVITY ) {
                                System.out.println(" startWakeUpTime="+ startWakeUpTime);
                                System.out.println(" currentTask.expirationTime="+ currentTask.expirationTime);
                                System.out.println(" currentTask.isInactivityTimeOut="+ currentTask.isInactivityTimeOut);
                            }
                            if (currentTask.expirationTime <= startWakeUpTime) {
                                currentTask = expirationMetaData.timeLimitHeap.deleteMin();
                                expirationMetaData.expirationTable.remove(currentTask.id);
                                //tcount++;
                                //traceDebug(methodName, "cacheName=" + cache.getCacheName() + " id=" + currentTask.id + " expirationTableSize=" + expirationMetaData.expirationTable.size() + " timeLimitHeapSize=" + expirationMetaData.timeLimitHeap.size() + " count=" + tcount);
                                invalidateIds.add(new InvalidationData(currentTask.id, currentTask.isInactivityTimeOut));
                                currentTask.reset();
                                taskPool.add(currentTask);
                                currentTask = expirationMetaData.timeLimitHeap.minimum();
                            } else {
                                currentTask = null;
                            }
                        }
                    }
                    // invalidate expired or inactive CacheEntry
                    if (invalidateIds.size() > 0) {
                        Iterator it = invalidateIds.iterator();
                        while (it.hasNext()) {
                            InvalidationData idata = (InvalidationData) it.next();
                            cache.invalidateById(idata.id, idata.isInactivityTimeOut?CachePerf.INACTIVE:CachePerf.TIMEOUT, false); // CPF-Inactivity
                        }
                        invalidateIds.clear();
                    }
                }
                diskCacheHouseKeeping();  //3821
                bTimeOutChecked = true;
            }
        } catch (Throwable ex) {
            com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.TimeLimitDaemon.wakeUp", "152", this);
        } finally {
            // skip trimCache (removing entries in the overflow buffer) operation if trimCache operation 
            // is still in process
            // loop through each cache instances to remove cache entries in the overflow buffer
            // and asynchronously offloaded to disk at a frequency of lruToDiskTriggerTime 
            // milliseconds. Process trimCache when one of the following conditions meet:
            // (1) timeout has just finished checking (sane behavior as before).
            // (2) lruToDiskTriggerPercent for a particular cache instance > 0
        	// (3) we need to contrain the cache instance in terms of JVM heap
            if (this.isLruToDiskRunnning == false) {
                this.isLruToDiskRunnning = true;
                Map caches = ServerCache.getCacheInstances();
                Iterator i = caches.values().iterator();
                while ( i.hasNext() ) {
                    DCache cache = (DCache)i.next();
                    if (cache != null && cache.getCacheConfig().isDefaultCacheProvider()) {
                        if (bTimeOutChecked ||
                        		cache.getCacheConfig().getLruToDiskTriggerPercent() > 0 || 
                        		cache.isCacheSizeInMBEnabled()) {
                            cache.trimCache();
                        }
                    }
                }
                this.isLruToDiskRunnning = false;
            }
        }
    }
public void wakeUp ( long startDaemonTime , long startWakeUpTime ) { if ( UNIT_TEST_INACTIVITY ) { System . out . println ( "wakUp() - entry" ) ; } boolean bTimeOutChecked = false ; try { if ( this . lruToDiskTriggerTime == this . timeoutTriggerTime || ( ( startWakeUpTime - this . lastTimeoutCheckedTime ) >= this . timeoutTriggerTime ) ) { this . lastTimeoutCheckedTime = startWakeUpTime ; ArrayList < InvalidationData > invalidateIds = new ArrayList < InvalidationData > ( ) ; Iterator walker = cacheInstancesTable . entrySet ( ) . iterator ( ) ; while ( walker . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) walker . next ( ) ; DCache cache = ( DCache ) entry . getKey ( ) ; ExpirationMetaData expirationMetaData = ( ExpirationMetaData ) entry . getValue ( ) ; synchronized ( expirationMetaData ) { InvalidationTask currentTask = expirationMetaData . timeLimitHeap . minimum ( ) ; while ( currentTask != null ) { if ( UNIT_TEST_INACTIVITY ) { System . out . println ( " startWakeUpTime=" + startWakeUpTime ) ; System . out . println ( " currentTask.expirationTime=" + currentTask . expirationTime ) ; System . out . println ( " currentTask.isInactivityTimeOut=" + currentTask . isInactivityTimeOut ) ; } if ( currentTask . expirationTime <= startWakeUpTime ) { currentTask = expirationMetaData . timeLimitHeap . deleteMin ( ) ; expirationMetaData . expirationTable . remove ( currentTask . id ) ; invalidateIds . add ( new InvalidationData ( currentTask . id , currentTask . isInactivityTimeOut ) ) ; currentTask . reset ( ) ; taskPool . add ( currentTask ) ; currentTask = expirationMetaData . timeLimitHeap . minimum ( ) ; } else { currentTask = null ; } } } if ( invalidateIds . size ( ) > 0 ) { Iterator it = invalidateIds . iterator ( ) ; while ( it . hasNext ( ) ) { InvalidationData idata = ( InvalidationData ) it . next ( ) ; cache . invalidateById ( idata . id , idata . isInactivityTimeOut ? CachePerf . INACTIVE : CachePerf . TIMEOUT , false ) ; } invalidateIds . clear ( ) ; } } diskCacheHouseKeeping ( ) ; bTimeOutChecked = true ; } } catch ( Throwable ex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.TimeLimitDaemon.wakeUp" , "152" , this ) ; } finally { if ( this . isLruToDiskRunnning == false ) { this . isLruToDiskRunnning = true ; Map caches = ServerCache . getCacheInstances ( ) ; Iterator i = caches . values ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { DCache cache = ( DCache ) i . next ( ) ; if ( cache != null && cache . getCacheConfig ( ) . isDefaultCacheProvider ( ) ) { if ( bTimeOutChecked || cache . getCacheConfig ( ) . getLruToDiskTriggerPercent ( ) > 0 || cache . isCacheSizeInMBEnabled ( ) ) { cache . trimCache ( ) ; } } } this . isLruToDiskRunnning = false ; } } }
This implements the abstract method in RealTimeDaemon.
It gathers all the cacheEntry ids whose timeLimit has expired
and calls the Cache.invalidateById method.
It handles the case where multiple timeIntervals have
elapsed since the last call and catches up to current time
by processing multiple timeLimitArray elements.

@param startDaemonTime The time (in milliseconds) when the daemon
was started.
@param startWakeUpTime The time (in milliseconds) just before
the wakeUp method was called.