FileDocCategorySizeDatePackage
ImageIOFactory.javaAPI DocApache Axis 1.42902Sat Apr 22 18:57:28 BST 2006org.apache.axis.components.image

ImageIOFactory

public class ImageIOFactory extends Object
This class implements a factory to instantiate an ImageIO component.
author
Davanum Srinivas
since
2.0

Fields Summary
protected static Log
log
Constructors Summary
Methods Summary
public static ImageIOgetImageIO()
Get the ImageIO implementation. This method follows a precedence: 1. Use the class defined by the System property axis.ImageIO. 2. If that isn't set, try instantiating MerlinIO, the JDK 1.4 ImageIO implementation. 3. If that fails try JimiIO, the JIMI ImageIO implementation. 4. If that fails, instantiate the limited JDK13IO implementation.


     
        AxisProperties.setClassOverrideProperty(ImageIO.class, "axis.ImageIO");

        // If the imageIO is not configured look for the following:
        // 1.  Try the JDK 1.4 classes
        // 2.  Try the JIMI classes
        // 3.  If all else fails, try the JDK 1.3 classes
        AxisProperties.setClassDefaults(ImageIO.class,
                                        new String [] {
                                             "org.apache.axis.components.image.MerlinIO",
                                             "org.apache.axis.components.image.JimiIO",
                                             "org.apache.axis.components.image.JDK13IO",
                                        });
    
        ImageIO imageIO = (ImageIO)AxisProperties.newInstance(ImageIO.class);
        
        /**
         * This shouldn't be needed, but seems to be a common feel-good:
         */
        if (imageIO == null) {
            try {
                Class cls = ClassUtils.forName("org.apache.axis.components.image.JDK13IO");
                imageIO = (ImageIO)cls.newInstance();
            } catch (Exception e) {
                log.debug("ImageIOFactory: No matching ImageIO found",e);
            }
        }

        log.debug("axis.ImageIO: " + imageIO.getClass().getName());
        return imageIO;