Module openj9.dtfj

Interface ImageFactory

All Known Implementing Classes:
DTFJImageFactory, ImageFactory, J9DDRImageFactory, JCImageFactory, PHDImageFactory

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().

e.g.

 Image image;
 try {
   Class<?> factoryClass = Class.forName(&quot;com.ibm.dtfj.image.j9.ImageFactory&quot;);
   ImageFactory factory = (ImageFactory) factoryClass.newInstance();
   image = factory.getImage(new File(coreFileName), new File(xmlFileName));
 } catch (ClassNotFoundException e) {
   System.err.println(&quot;Could not find DTFJ factory class:&quot;);
   e.printStackTrace(System.err);
 } catch (IllegalAccessException e) {
   System.err.println(&quot;Could not instantiate DTFJ factory class:&quot;);
   e.printStackTrace(System.err);
 } catch (InstantiationException e) {
   System.err.println(&quot;Could not instantiate DTFJ factory class:&quot;);
   e.printStackTrace(System.err);
 } catch (IOException e) {
   System.err.println(&quot;Could not find file required for bootstrapping:&quot;);
   e.printStackTrace(System.err);
 }