Class IIORegistry
java.lang.Object
javax.imageio.spi.ServiceRegistry
javax.imageio.spi.IIORegistry
A registry for Image I/O service provider instances. Service provider
classes may be discovered at runtime by the mechanisms documented in
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.FilterModifier and TypeClassDescriptionstatic interfaceA simple filter interface used byServiceRegistry.getServiceProvidersto select providers matching an arbitrary criterion. -
Method Summary
Modifier and TypeMethodDescriptionstatic IIORegistryReturns the defaultIIORegistryinstance used by the Image I/O API.voidRegisters all available service providers found on the application class path, using the defaultClassLoader.Methods declared in class ServiceRegistry
contains, deregisterAll, deregisterAll, deregisterServiceProvider, deregisterServiceProvider, getCategories, getServiceProviderByClass, getServiceProviders, getServiceProviders, lookupProviders, lookupProviders, registerServiceProvider, registerServiceProvider, registerServiceProviders, setOrdering, unsetOrderingModifier and TypeMethodDescriptionbooleanReturnstrueifprovideris currently registered.voidDeregisters all currently registered service providers from all categories.voidderegisterAll(Class<?> category) Deregisters all service provider object currently registered under the given category.voidderegisterServiceProvider(Object provider) Removes a service provider object from all categories that contain it.<T> booleanderegisterServiceProvider(T provider, Class<T> category) Removes a service provider object from the given category.Returns anIteratorofClassobjects indicating the current set of categories.<T> TgetServiceProviderByClass(Class<T> providerClass) Returns the currently registered service provider object that is of the given class type.<T> Iterator<T> getServiceProviders(Class<T> category, boolean useOrdering) Returns anIteratorcontaining all registered service providers in the given category.<T> Iterator<T> getServiceProviders(Class<T> category, ServiceRegistry.Filter filter, boolean useOrdering) Returns anIteratorcontaining service provider objects within a given category that satisfy a criterion imposed by the suppliedServiceRegistry.Filterobject'sfiltermethod.static <T> Iterator<T> lookupProviders(Class<T> providerClass) Locates and incrementally instantiates the available providers of a given service using the context class loader.static <T> Iterator<T> lookupProviders(Class<T> providerClass, ClassLoader loader) Searches for implementations of a particular service class using the given class loader.voidregisterServiceProvider(Object provider) Adds a service provider object to the registry.<T> booleanregisterServiceProvider(T provider, Class<T> category) Adds a service provider object to the registry.voidregisterServiceProviders(Iterator<?> providers) Adds a set of service provider objects, taken from anIteratorto the registry.<T> booleansetOrdering(Class<T> category, T firstProvider, T secondProvider) Sets a pairwise ordering between two service provider objects within a given category.<T> booleanunsetOrdering(Class<T> category, T firstProvider, T secondProvider) 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, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
getDefaultInstance
Returns the defaultIIORegistryinstance 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()Registers all available service providers found on the application class path, using the defaultClassLoader. This method is typically invoked by theImageIO.scanForPluginsmethod.- See Also:
-