public synchronized String addNewFileFromSubProcess ( long spTimeStamp , String spPid , String spLabel ) { // TODO: It is theoretically possible that subProcess already created one of these (although it won't happen in our scenario. // Consider either pulling actual pid from the files on initFileList or looking for the file here before adding it. If found, // adjust the pid to this pid. checkSpaceConstrain ( maxLogFileSize ) ; if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisClass , "addNewFileFromSubProcess" , "Tstamp: " + spTimeStamp + " pid: " + spPid + " lbl: " + spLabel + " Max: " + maxLogFileSize ) ; } if ( ivSubDirectory == null ) getControllingProcessDirectory ( spTimeStamp , svPid ) ; // Note: passing, pid of this region, not sending child region if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisClass , "addNewFileFromSubProcess" , "Got ivSubDir: " + ivSubDirectory . getPath ( ) ) ; } File servantDirectory = new File ( ivSubDirectory , getLogDirectoryName ( - 1 , spPid , spLabel ) ) ; File servantFile = getLogFile ( servantDirectory , spTimeStamp ) ; FileDetails thisFile = new FileDetails ( servantFile , spTimeStamp , maxLogFileSize , spPid ) ; synchronized ( fileList ) { initFileList ( false ) ; fileList . add ( thisFile ) ; // Not active as new one was created incrementFileCount ( servantFile ) ; synchronized ( activeFilesMap ) { // In this block so that fileList always locked first activeFilesMap . put ( spPid , thisFile ) ; } } totalSize += maxLogFileSize ; if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisClass , "addNewFileFromSubProcess" , "Added file: " + servantFile . getPath ( ) + " sz:" + maxLogFileSize + " tstmp: " + spTimeStamp ) ; debugListLL ( "postAddFromSP" ) ; debugListHM ( "postAddFromSP" ) ; } return servantFile . getPath ( ) ; }
add information about a new file being created by a subProcess in order to maintain retention information . This is done for all files created by each subProcess . If IPC facility is not ready subProcess may have to create first then notify when IPC is up .