Search in sources :

Example 1 with NewAixDump

use of com.ibm.dtfj.corereaders.NewAixDump in project openj9 by eclipse.

the class DTFJLibraryAdapter method getLibraryList.

public ArrayList<String> getLibraryList(final File coreFile) {
    if (moduleNames == null) {
        moduleNames = new ArrayList<String>();
        try {
            _parentDir = coreFile.getParentFile();
            logger.fine("Creating DTFJ core file reader");
            ClosingFileReader closingFile = new ClosingFileReader(coreFile);
            ICoreFileReader reader = DumpFactory.createDumpForCore(closingFile);
            isAIX = (reader instanceof NewAixDump);
            logger.fine("Extracting modules");
            reader.extract(this);
        } catch (FileNotFoundException e) {
            logger.log(SEVERE, "Could not open core file " + coreFile.getAbsolutePath(), e);
            errorMessages.add(e.getMessage());
        } catch (IOException e) {
            logger.log(SEVERE, "Error processing core file " + coreFile.getAbsolutePath(), e);
            errorMessages.add(e.getMessage());
        }
    }
    return moduleNames;
}
Also used : FileNotFoundException(java.io.FileNotFoundException) ClosingFileReader(com.ibm.dtfj.corereaders.ClosingFileReader) IOException(java.io.IOException) NewAixDump(com.ibm.dtfj.corereaders.NewAixDump) ICoreFileReader(com.ibm.dtfj.corereaders.ICoreFileReader)

Example 2 with NewAixDump

use of com.ibm.dtfj.corereaders.NewAixDump in project openj9 by eclipse.

the class DTFJLibraryAdapter method isLibraryCollectionRequired.

public boolean isLibraryCollectionRequired(File coreFile) {
    ICoreFileReader reader = null;
    try {
        ClosingFileReader closingFile = new ClosingFileReader(coreFile);
        reader = DumpFactory.createDumpForCore(closingFile);
    } catch (Exception e) {
        logger.log(SEVERE, "Could not determine if library collection is required for " + coreFile.getAbsolutePath(), e);
        errorMessages.add(e.getMessage());
        // if this fails, then so would any collection attempt as well
        return false;
    }
    if (reader instanceof NewElfDump) {
        return true;
    }
    if (reader instanceof NewAixDump) {
        return true;
    }
    return false;
}
Also used : NewElfDump(com.ibm.dtfj.corereaders.NewElfDump) ClosingFileReader(com.ibm.dtfj.corereaders.ClosingFileReader) NewAixDump(com.ibm.dtfj.corereaders.NewAixDump) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) ICoreFileReader(com.ibm.dtfj.corereaders.ICoreFileReader)

Aggregations

ClosingFileReader (com.ibm.dtfj.corereaders.ClosingFileReader)2 ICoreFileReader (com.ibm.dtfj.corereaders.ICoreFileReader)2 NewAixDump (com.ibm.dtfj.corereaders.NewAixDump)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 NewElfDump (com.ibm.dtfj.corereaders.NewElfDump)1