Search in sources :

Example 1 with ResourceReleaser

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

the class DTFJImageFactory method getImage.

private ReleasingImage getImage(File imageFile, InputStream metadata, IFileLocationResolver resolver) throws IOException {
    ClosingFileReader reader = new ClosingFileReader(imageFile);
    ICoreFileReader core = DumpFactory.createDumpForCore(reader);
    XMLIndexReader indexData = new XMLIndexReader();
    // CMVC 154851 : pass the metadata stream through the new XML cleanup class
    XMLInputStream in = new XMLInputStream(metadata);
    ReleasingImage image = indexData.parseIndexWithDump(in, core, reader, resolver);
    image.addReleasable(in);
    image.addReleasable(reader);
    image.addReleasable(core);
    if (resolver instanceof ResourceReleaser) {
        image.addReleasable((ResourceReleaser) resolver);
    }
    return image;
}
Also used : ResourceReleaser(com.ibm.dtfj.corereaders.ResourceReleaser) XMLInputStream(com.ibm.jvm.j9.dump.indexsupport.XMLInputStream) ClosingFileReader(com.ibm.dtfj.corereaders.ClosingFileReader) ICoreFileReader(com.ibm.dtfj.corereaders.ICoreFileReader) XMLIndexReader(com.ibm.jvm.j9.dump.indexsupport.XMLIndexReader)

Aggregations

ClosingFileReader (com.ibm.dtfj.corereaders.ClosingFileReader)1 ICoreFileReader (com.ibm.dtfj.corereaders.ICoreFileReader)1 ResourceReleaser (com.ibm.dtfj.corereaders.ResourceReleaser)1 XMLIndexReader (com.ibm.jvm.j9.dump.indexsupport.XMLIndexReader)1 XMLInputStream (com.ibm.jvm.j9.dump.indexsupport.XMLInputStream)1