protected ValueSet readAndDeleteInvalidationFile ( ) { final String methodName = "readAndDeleteInvalidationFile()" ; final File f = new File ( invalidationFileName ) ; final CacheOnDisk cod = this ; this . valueSet = new ValueSet ( 1 ) ; if ( f . exists ( ) ) { AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { FileInputStream fis = null ; ObjectInputStream ois = null ; try { fis = new FileInputStream ( f ) ; ois = new ObjectInputStream ( fis ) ; int size = ois . readInt ( ) ; cod . valueSet = new ValueSet ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { cod . valueSet . add ( ois . readObject ( ) ) ; } } catch ( Throwable t1 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t1 , "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile" , "1056" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t1 ) ) ; } finally { try { if ( ois != null ) { ois . close ( ) ; } if ( fis != null ) { fis . close ( ) ; } f . delete ( ) ; } catch ( Throwable t2 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t2 , "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile" , "1068" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t2 ) ) ; } } return null ; } } ) ; } traceDebug ( methodName , "cacheName=" + this . cacheName + " " + invalidationFileName + " valueSet=" + valueSet . size ( ) ) ; return this . valueSet ; }
Call this method to read in all invalidation cache ids if the invalidation file exists . and then delete the invalidation file .