public interface ImageFactory
This interface is used for classes which can produce instances of Image implementors.
Classes that implement this interface should provide a zero argument, public constructor so that they can be created using newInstance().
e.g.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
Note that this value will be inlined so users can reference it directly
(ie: factory.getDTFJMinorVersion() >= ImageFactory.DTFJ_MINOR_VERSION)
|
static java.lang.String |
SYSTEM_PROPERTY_TMPDIR
If the image is to be created from a core file inside a compressed file 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 meta,
java.net.URI sourceID)
Creates a new Image object based on the contents of the input stream.
|
Image |
getImage(javax.imageio.stream.ImageInputStream in,
java.net.URI sourceID)
Creates a new Image object based on the contents of the input stream.
|
Image[] |
getImagesFromArchive(java.io.File archive,
boolean extract)
Creates an array of Image objects from a compressed 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
static final java.lang.String SYSTEM_PROPERTY_TMPDIR
Image getImage(java.io.File imageFile) throws java.io.IOException
imageFile
- a file with Image information, typically a core file.java.io.IOException
Image getImage(javax.imageio.stream.ImageInputStream in, java.net.URI sourceID) throws java.io.IOException
in
- a stream with Image information, typically a core file.sourceID
- URI identifying the source of the image streamjava.io.IOException
java.lang.UnsupportedOperationException
- if the factory does not support this methodImage getImage(javax.imageio.stream.ImageInputStream in, javax.imageio.stream.ImageInputStream meta, java.net.URI sourceID) throws java.io.IOException
in
- a stream with Image information, typically a core file.meta
- a stream with meta-data associated with the Image stream.sourceID
- URI identifying the source of the image streamjava.io.IOException
java.lang.UnsupportedOperationException
- if the factory does not support this methodImage[] getImagesFromArchive(java.io.File archive, boolean extract) throws java.io.IOException
archive
- which typically contains one or more diagnostic artifacts.extract
- true if the files in the archive should be extracted to a temporary directoryjava.io.IOException
java.lang.UnsupportedOperationException
- if the factory does not support this methodImage getImage(java.io.File imageFile, java.io.File metadata) throws java.io.IOException
imageFile
- a file with Image information, typically a core file.metadata
- a file with additional Image information. This is an implementation defined file.java.io.IOException
int getDTFJMajorVersion()
int getDTFJMinorVersion()
int getDTFJModificationLevel()
© Copyright 2005, 2012 IBM Corporation. All Rights Reserved.