public final class IIORegistry extends ServiceRegistry
Service providers found on the system classpath (e.g.,
jre/lib/ext directory in Sun's implementation of
JDK) are automatically loaded as soon as this class is
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
subdirectory is placed within the
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
ImageReaderSpi interface, the JAR file
would contain a file named:
META-INF/services/javax.imageio.spi.ImageReaderSpicontaining the line:
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
For more details on declaring service providers, and the JAR format in general, see the JAR File Specification.
|Modifier and Type||Method and Description|
Returns the default
Registers all available service providers found on the application class path, using the default
contains, deregisterAll, deregisterAll, deregisterServiceProvider, deregisterServiceProvider, finalize, getCategories, getServiceProviderByClass, getServiceProviders, getServiceProviders, lookupProviders, lookupProviders, registerServiceProvider, registerServiceProvider, registerServiceProviders, setOrdering, unsetOrdering
public static IIORegistry getDefaultInstance()
IIORegistryinstance used by the Image I/O API. This instance should be used for all registry functions.
ThreadGroup will receive its own
instance; this allows different
Applets in the
same browser (for example) to each have their own registry.
public void registerApplicationClasspathSpis()
ClassLoader. This method is typically invoked by the
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.