javax.imageio.spi
Class IIORegistry

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.imageio.spi.ServiceRegistry sample code for javax.imageio.spi.ServiceRegistry definition code for javax.imageio.spi.ServiceRegistry 
      extended by javax.imageio.spi.IIORegistry

public final class IIORegistry
extends ServiceRegistry sample code for javax.imageio.spi.ServiceRegistry definition code for javax.imageio.spi.ServiceRegistry

A registry for service provider instances. Service provider classes may be detected at run time by means of meta-information in the JAR files containing them. The intent is that it be relatively inexpensive to load and inspect all available service provider classes. These classes may them be used to locate and instantiate more heavyweight classes that will perform actual work, in this case instances of ImageReader, ImageWriter, ImageTranscoder, ImageInputStream, and ImageOutputStream.

Service providers found on the system classpath (e.g., the jre/lib/ext directory in Sun's implementation of JDK) are automatically loaded as soon as this class is instantiated.

When the registerApplicationClasspathSpis method is called, service provider instances declared in the meta-information section of JAR files on the application class path are loaded. To declare a service provider, a services subdirectory is placed within the META-INF directory that is present in every JAR file. This directory contains a file for each service provider interface that has one or more implementation classes present in the JAR file. For example, if the JAR file contained a class named com.mycompany.imageio.MyFormatReaderSpi which implements the ImageReaderSpi interface, the JAR file would contain a file named:

 META-INF/services/javax.imageio.spi.ImageReaderSpi
 
containing the line:
 com.mycompany.imageio.MyFormatReaderSpi
 

The service provider classes are intended to be lightweight and quick to load. Implementations of these interfaces should avoid complex dependencies on other classes and on native code.

It is also possible to manually add service providers not found automatically, as well as to remove those that are using the interfaces of the ServiceRegistry class. Thus the application may customize the contents of the registry as it sees fit.

For more details on declaring service providers, and the JAR format in general, see the JAR File Specification.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.imageio.spi.ServiceRegistry sample code for javax.imageio.spi.ServiceRegistry definition code for javax.imageio.spi.ServiceRegistry
ServiceRegistry.Filter sample code for javax.imageio.spi.ServiceRegistry.Filter definition code for javax.imageio.spi.ServiceRegistry.Filter
 
Method Summary
static IIORegistry sample code for javax.imageio.spi.IIORegistry definition code for javax.imageio.spi.IIORegistry getDefaultInstance sample code for javax.imageio.spi.IIORegistry.getDefaultInstance() definition code for javax.imageio.spi.IIORegistry.getDefaultInstance() ()
          Returns the default IIORegistry instance used by the Image I/O API.
 void registerApplicationClasspathSpis sample code for javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis() definition code for javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis() ()
          Registers all available service providers found on the application class path, using the default ClassLoader.
 
Methods inherited from class javax.imageio.spi.ServiceRegistry sample code for javax.imageio.spi.ServiceRegistry definition code for javax.imageio.spi.ServiceRegistry
contains sample code for javax.imageio.spi.ServiceRegistry.contains(java.lang.Object) definition code for javax.imageio.spi.ServiceRegistry.contains(java.lang.Object) , deregisterAll sample code for javax.imageio.spi.ServiceRegistry.deregisterAll() definition code for javax.imageio.spi.ServiceRegistry.deregisterAll() , deregisterAll sample code for javax.imageio.spi.ServiceRegistry.deregisterAll(java.lang.Class) definition code for javax.imageio.spi.ServiceRegistry.deregisterAll(java.lang.Class) , deregisterServiceProvider sample code for javax.imageio.spi.ServiceRegistry.deregisterServiceProvider(java.lang.Object) definition code for javax.imageio.spi.ServiceRegistry.deregisterServiceProvider(java.lang.Object) , deregisterServiceProvider sample code for javax.imageio.spi.ServiceRegistry.deregisterServiceProvider(T, java.lang.Class) definition code for javax.imageio.spi.ServiceRegistry.deregisterServiceProvider(T, java.lang.Class) , finalize sample code for javax.imageio.spi.ServiceRegistry.finalize() definition code for javax.imageio.spi.ServiceRegistry.finalize() , getCategories sample code for javax.imageio.spi.ServiceRegistry.getCategories() definition code for javax.imageio.spi.ServiceRegistry.getCategories() , getServiceProviderByClass sample code for javax.imageio.spi.ServiceRegistry.getServiceProviderByClass(java.lang.Class) definition code for javax.imageio.spi.ServiceRegistry.getServiceProviderByClass(java.lang.Class) , getServiceProviders sample code for javax.imageio.spi.ServiceRegistry.getServiceProviders(java.lang.Class, boolean) definition code for javax.imageio.spi.ServiceRegistry.getServiceProviders(java.lang.Class, boolean) , getServiceProviders sample code for javax.imageio.spi.ServiceRegistry.getServiceProviders(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, boolean) definition code for javax.imageio.spi.ServiceRegistry.getServiceProviders(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, boolean) , lookupProviders sample code for javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class) definition code for javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class) , lookupProviders sample code for javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class, java.lang.ClassLoader) definition code for javax.imageio.spi.ServiceRegistry.lookupProviders(java.lang.Class, java.lang.ClassLoader) , registerServiceProvider sample code for javax.imageio.spi.ServiceRegistry.registerServiceProvider(java.lang.Object) definition code for javax.imageio.spi.ServiceRegistry.registerServiceProvider(java.lang.Object) , registerServiceProvider sample code for javax.imageio.spi.ServiceRegistry.registerServiceProvider(T, java.lang.Class) definition code for javax.imageio.spi.ServiceRegistry.registerServiceProvider(T, java.lang.Class) , registerServiceProviders sample code for javax.imageio.spi.ServiceRegistry.registerServiceProviders(java.util.Iterator) definition code for javax.imageio.spi.ServiceRegistry.registerServiceProviders(java.util.Iterator) , setOrdering sample code for javax.imageio.spi.ServiceRegistry.setOrdering(java.lang.Class, T, T) definition code for javax.imageio.spi.ServiceRegistry.setOrdering(java.lang.Class, T, T) , unsetOrdering sample code for javax.imageio.spi.ServiceRegistry.unsetOrdering(java.lang.Class, T, T) definition code for javax.imageio.spi.ServiceRegistry.unsetOrdering(java.lang.Class, T, T)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Method Detail

getDefaultInstance sample code for javax.imageio.spi.IIORegistry.getDefaultInstance() definition code for javax.imageio.spi.IIORegistry.getDefaultInstance()

public static IIORegistry sample code for javax.imageio.spi.IIORegistry definition code for javax.imageio.spi.IIORegistry  getDefaultInstance()
Returns the default IIORegistry instance used by the Image I/O API. This instance should be used for all registry functions.

Each ThreadGroup will receive its own instance; this allows different Applets in the same browser (for example) to each have their own registry.

Returns:
the default registry for the current ThreadGroup.

registerApplicationClasspathSpis sample code for javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis() definition code for javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis()

public void registerApplicationClasspathSpis()
Registers all available service providers found on the application class path, using the default ClassLoader. This method is typically invoked by the ImageIO.scanForPlugins method.

See Also:
ImageIO.scanForPlugins() sample code for javax.imageio.ImageIO.scanForPlugins() definition code for javax.imageio.ImageIO.scanForPlugins() , ClassLoader.getResources(java.lang.String) sample code for java.lang.ClassLoader.getResources(java.lang.String) definition code for java.lang.ClassLoader.getResources(java.lang.String)