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()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()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 thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) 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 voidwait(long timeoutMillis, int nanos) 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
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:
-