extending fm1






Java Image I/O API Guide: 4 - Writing Image I/O Plug-ins






Documentation Contents


CONTENTS | PREV
| NEXT








CHAPTER
4




Writing Image I/O Plug-ins


4.1 The Plug-in Concept




The Image I/O API is designed as a pluggable framework into which any developer may add their own "plug-ins." A plug-in is defined as a set of Java language classes which may be loaded into the API at run-time and which add functionality to the AP
I. In the context of the Java Image I/O API, a plug-in may provide the ability to read image data from a new file format, to write image data in a new format, to "transcode" non-image metadata between two formats, or to read or write streaming dat
a from or to a new data source or sink. A plug-in may also provide support for the same format as another plug-in, perhaps providing better performance, more features, or a different view of the data stored by the format.

In order for plug-ins to be added to a running
JavaTM Virtual Machine*, they
must be compiled into Java bytecode files (class files). These class files will contain the code for subclasses of various classes defined by the API. For example, a plug-in that pr
ovides the capability to read images will include a new subclass of the abstract javax.imageio.ImageReader class defined by the API. The usual reversed Internet domain name convention may be used to guarantee uniqueness of class names.

Because loading and instantiating an entire plug-in may be expensive, an additional class is used as a "stand-in" to provide information about the plug-in. This class may be used, for example, to determine what formats are handled by the plug-in p
rior to actually instantiating the plug-in.

The "stand-in" object is lightweight enough that it can be loaded and a single instance instantiated every time the API is used within a given invocation of the Java virtual machine. This pattern, in which a small class is used to provide informat
ion about an available service, is referred to as a "service provider interface."


* As used on this web site, the terms "Java Virtual Machine" or "JVM" mean
a virtual machine for the Java platform.



CONTENTS | PREV
| NEXT






Copyright © 1995-2010 Sun Microsystems, Inc. All Rights Reserved. Please send comments using this Feedback page.

Java Technology








Wyszukiwarka

Podobne podstrony:
option extended valid elements
keyword extends
extend relationship?38D814
EXTENDING
EXTENDING
schw?81101134702 oeb fm1 r1
Q190987 Extended Stored Procedures
using extended help?818AFE
Bear53901087 oeb fm1 r1
extending fm4
$ extend
The Wolverine 2013 EXTENDED 1080p BluRay x264 SPARKS
PSTL Extend siec dystr
Canon Extender Ef 1 4X Repair Manual
quic?81101044452 oeb fm1 r1
HONDA 2006 2007 Ridgeline Bed Extender User s Information

więcej podobnych podstron