Class IIORegistry
public final class IIORegistry extends ServiceRegistry
ServiceLoader. The intent is that it be relatively inexpensive to load and inspect all available Image I/O service provider classes. These classes may then 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 included in the Java runtime are automatically loaded as soon as this class is instantiated. When the registerApplicationClasspathSpis method is called, additional service provider instances will be discovered using ServiceLoader.
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 information on how to create and deploy service providers, refer to the documentation on ServiceLoader
Nested Class Summary
Nested classes/interfaces declared in class ServiceRegistry
ServiceRegistry.Filter | Modifier and Type | Class | Description |
|---|---|---|
static interface |
ServiceRegistry.Filter |
A simple filter interface used by ServiceRegistry.getServiceProviders to select providers matching an arbitrary criterion. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
static IIORegistry |
getDefaultInstance() |
Returns the default IIORegistry instance used by the Image I/O API. |
void |
registerApplicationClasspathSpis() |
Registers all available service providers found on the application class path, using the default ClassLoader. |
Methods declared in class ServiceRegistry
contains, deregisterAll, deregisterAll, deregisterServiceProvider, deregisterServiceProvider, getCategories, getServiceProviderByClass, getServiceProviders, getServiceProviders, lookupProviders, lookupProviders, registerServiceProvider, registerServiceProvider, registerServiceProviders, setOrdering, unsetOrdering | Modifier and Type | Method | Description |
|---|---|---|
boolean |
contains |
Returns true if provider is currently registered. |
void |
deregisterAll() |
Deregisters all currently registered service providers from all categories. |
void |
deregisterAll |
Deregisters all service provider object currently registered under the given category. |
void |
deregisterServiceProvider |
Removes a service provider object from all categories that contain it. |
<T> boolean |
deregisterServiceProvider |
Removes a service provider object from the given category. |
Iterator |
getCategories() |
Returns an Iterator of Class objects indicating the current set of categories. |
<T> T |
getServiceProviderByClass |
Returns the currently registered service provider object that is of the given class type. |
<T> Iterator |
getServiceProviders |
Returns an Iterator containing all registered service providers in the given category. |
<T> Iterator |
getServiceProviders |
Returns an Iterator containing service provider objects within a given category that satisfy a criterion imposed by the supplied ServiceRegistry.Filter object's filter method. |
static <T> Iterator |
lookupProviders |
Locates and incrementally instantiates the available providers of a given service using the context class loader. |
static <T> Iterator |
lookupProviders |
Searches for implementations of a particular service class using the given class loader. |
void |
registerServiceProvider |
Adds a service provider object to the registry. |
<T> boolean |
registerServiceProvider |
Adds a service provider object to the registry. |
void |
registerServiceProviders |
Adds a set of service provider objects, taken from an Iterator to the registry. |
<T> boolean |
setOrdering |
Sets a pairwise ordering between two service provider objects within a given category. |
<T> boolean |
unsetOrdering |
Sets a pairwise ordering between two service provider objects within a given category. |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
String |
toString() |
Returns a string representation of the object. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Method Details
getDefaultInstance
public static IIORegistry getDefaultInstance()
IIORegistry instance used by the Image I/O API. This instance should be used for all registry functions.- Returns:
- the default registry for the Image I/O API
registerApplicationClasspathSpis
public void registerApplicationClasspathSpis()
ClassLoader. This method is typically invoked by the ImageIO.scanForPlugins method.- See Also:
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.