public interface ImageFactory
This interface is used for classes which can produce instances of Image implementers.
Classes that implement this interface should provide a zero argument, public
constructor so that they can be created using Class.newInstance().
Image image;
try {
Class<?> factoryClass = Class.forName("com.ibm.dtfj.image.j9.ImageFactory");
ImageFactory factory = (ImageFactory) factoryClass.newInstance();
image = factory.getImage(new File(coreFileName), new File(xmlFileName));
} catch (ClassNotFoundException e) {
System.err.println("Could not find DTFJ factory class:");
e.printStackTrace(System.err);
} catch (IllegalAccessException e) {
System.err.println("Could not instantiate DTFJ factory class:");
e.printStackTrace(System.err);
} catch (InstantiationException e) {
System.err.println("Could not instantiate DTFJ factory class:");
e.printStackTrace(System.err);
} catch (IOException e) {
System.err.println("Could not find file required for bootstrapping:");
e.printStackTrace(System.err);
}
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DTFJ_LOGGER_NAME
This is the name of the
java.util.logging.Logger subsystem
to which DTFJ passes verbose messages. |
static int |
DTFJ_MAJOR_VERSION
The major version number of the current API.
|
static int |
DTFJ_MINOR_VERSION
The minor version number of the current API.
|
static java.lang.String |
SYSTEM_PROPERTY_TMPDIR
If the image is to be created from a core file inside an archive, this property
controls where the file will extracted.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDTFJMajorVersion()
Fetch the DTFJ major version number.
|
int |
getDTFJMinorVersion()
Fetch the DTFJ minor version number.
|
int |
getDTFJModificationLevel()
Fetch the DTFJ modification level.
|
Image |
getImage(java.io.File imageFile)
Creates a new
Image object based on the contents of imageFile. |
Image |
getImage(java.io.File imageFile,
java.io.File metadata)
Creates a new
Image object based on the contents of imageFile and metadata. |
Image |
getImage(javax.imageio.stream.ImageInputStream in,
javax.imageio.stream.ImageInputStream metadata,
java.net.URI sourceID)
Creates a new
Image object based on the contents of the given input stream. |
Image |
getImage(javax.imageio.stream.ImageInputStream in,
java.net.URI sourceID)
Creates a new
Image object based on the contents of the given input stream. |
Image[] |
getImagesFromArchive(java.io.File archive,
boolean extract)
Creates an array of
Image objects from an archive such as a zip or jar file. |
static final int DTFJ_MAJOR_VERSION
static final int DTFJ_MINOR_VERSION
static final java.lang.String DTFJ_LOGGER_NAME
java.util.logging.Logger subsystem
to which DTFJ passes verbose messages.static final java.lang.String SYSTEM_PROPERTY_TMPDIR
Image getImage(java.io.File imageFile) throws java.io.IOException
Image object based on the contents of imageFile.imageFile - a file with Image information, typically a core filejava.io.IOException - if there's a problem reading the specified filejava.lang.NullPointerException - if imageFile is nullImage getImage(javax.imageio.stream.ImageInputStream in, java.net.URI sourceID) throws java.io.IOException
Image object based on the contents of the given input stream.in - a stream with image information, typically a core filesourceID - URI identifying the source of the image streamImagejava.io.IOException - if there's a problem reading the given streamjava.lang.UnsupportedOperationException - if the factory does not support this methodjava.lang.NullPointerException - if either of in or sourceID is nullImage getImage(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageInputStream metadata, java.net.URI sourceID) throws java.io.IOException
Image object based on the contents of the given input stream.in - a stream with image information, typically a core filemetadata - a stream with metadata associated with the image streamsourceID - URI identifying the source of the image streamImagejava.io.IOException - if there's a problem reading the given streamsjava.lang.UnsupportedOperationException - if the factory does not support this methodjava.lang.NullPointerException - if any of in, metadata or sourceID is nullImage[] getImagesFromArchive(java.io.File archive, boolean extract) throws java.io.IOException
Image objects from an archive such as a zip or jar file.archive - which typically contains one or more diagnostic artifactsextract - true if the files in the archive should be extracted to a temporary directoryImagesjava.io.IOException - if there's a problem reading the specified archivejava.lang.UnsupportedOperationException - if the factory does not support this methodImage getImage(java.io.File imageFile, java.io.File metadata) throws java.io.IOException
Image object based on the contents of imageFile and metadata.imageFile - a file with image information, typically a core filemetadata - an (implementation-defined) file with additional image information (or null if not required)Imagejava.io.IOException - if there's a problem reading either of the specified filesjava.lang.NullPointerException - if imageFile is nullint getDTFJMajorVersion()
int getDTFJMinorVersion()
int getDTFJModificationLevel()
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2004, 2025 IBM Corp. and others.
DRAFT internal-b00