- java.lang.Object
-
- javax.imageio.spi.ServiceRegistry
-
- javax.imageio.spi.IIORegistry
-
public final class IIORegistry extends 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 ofImageReader
,ImageWriter
,ImageTranscoder
,ImageInputStream
, andImageOutputStream
.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, aservices
subdirectory is placed within theMETA-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 namedcom.mycompany.imageio.MyFormatReaderSpi
which implements theImageReaderSpi
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
ServiceRegistry.Filter
-
-
Method Summary
Methods Modifier and Type Method and Description static IIORegistry
getDefaultInstance()
Returns the defaultIIORegistry
instance used by the Image I/O API.void
registerApplicationClasspathSpis()
Registers all available service providers found on the application class path, using the defaultClassLoader
.-
Methods inherited from class javax.imageio.spi.ServiceRegistry
contains, deregisterAll, deregisterAll, deregisterServiceProvider, deregisterServiceProvider, finalize, getCategories, getServiceProviderByClass, getServiceProviders, getServiceProviders, lookupProviders, lookupProviders, registerServiceProvider, registerServiceProvider, registerServiceProviders, setOrdering, unsetOrdering
-
-
-
-
Method Detail
-
getDefaultInstance
public static IIORegistry getDefaultInstance()
Returns the defaultIIORegistry
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 differentApplet
s in the same browser (for example) to each have their own registry.- Returns:
- the default registry for the current
ThreadGroup
.
-
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.scanForPlugins
method.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 09:03:12 Cette version de la page est en cache (à la date du 22/12/2024 09:03:12) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/imageio/spi/IIORegistry.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.