Class IIOServiceProvider
- All Implemented Interfaces:
RegisterableService
- Direct Known Subclasses:
-
ImageInputStreamSpi,ImageOutputStreamSpi,ImageReaderWriterSpi,ImageTranscoderSpi
public abstract class IIOServiceProvider extends Object implements RegisterableService
IIORegistry class.Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
protected String |
vendorName |
A String to be returned from getVendorName, initially null. |
protected String |
version |
A String to be returned from getVersion, initially null. |
Constructor Summary
| Constructor | Description |
|---|---|
IIOServiceProvider() |
Constructs a blank IIOServiceProvider. |
IIOServiceProvider |
Constructs an IIOServiceProvider with a given vendor name and version identifier. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
abstract String |
getDescription |
Returns a brief, human-readable description of this service provider and its associated implementation. |
String |
getVendorName() |
Returns the name of the vendor responsible for creating this service provider and its associated implementation. |
String |
getVersion() |
Returns a string describing the version number of this service provider and its associated implementation. |
void |
onDeregistration |
A callback that will be whenever the Spi class has been deregistered from a ServiceRegistry. |
void |
onRegistration |
A callback that will be called exactly once after the Spi class has been instantiated and registered in a ServiceRegistry. |
Field Details
vendorName
protected String vendorName
String to be returned from getVendorName, initially null. Constructors should set this to a non-null value.version
protected String version
String to be returned from getVersion, initially null. Constructors should set this to a non-null value.Constructor Details
IIOServiceProvider
public IIOServiceProvider(String vendorName, String version)
IIOServiceProvider with a given vendor name and version identifier.- Parameters:
-
vendorName- the vendor name. -
version- a version identifier. - Throws:
-
IllegalArgumentException- ifvendorNameisnull. -
IllegalArgumentException- ifversionisnull.
IIOServiceProvider
public IIOServiceProvider()
IIOServiceProvider. It is up to the subclass to initialize instance variables and/or override method implementations in order to ensure that the getVendorName and getVersion methods will return non-null values.Method Details
onRegistration
public void onRegistration(ServiceRegistry registry, Class<?> category)
ServiceRegistry. This may be used to verify that the environment is suitable for this service, for example that native libraries can be loaded. If the service cannot function in the environment where it finds itself, it should deregister itself from the registry. Only the registry should call this method.
The default implementation does nothing.
- Specified by:
-
onRegistrationin interfaceRegisterableService - Parameters:
-
registry- aServiceRegistrywhere this object has been registered. -
category- aClassobject indicating the registry category under which this object has been registered. - See Also:
onDeregistration
public void onDeregistration(ServiceRegistry registry, Class<?> category)
ServiceRegistry. Only the registry should call this method.
The default implementation does nothing.
- Specified by:
-
onDeregistrationin interfaceRegisterableService - Parameters:
-
registry- aServiceRegistryfrom which this object is being (wholly or partially) deregistered. -
category- aClassobject indicating the registry category from which this object is being deregistered. - See Also:
getVendorName
public String getVendorName()
The default implementation returns the value of the vendorName instance variable.
- Returns:
- a non-
null Stringcontaining the name of the vendor.
getVersion
public String getVersion()
The default implementation returns the value of the version instance variable.
- Returns:
- a non-
null Stringcontaining the version of this service provider.
getDescription
public abstract String getDescription(Locale locale)
Locale, if possible.- Parameters:
-
locale- aLocalefor which the return value should be localized. - Returns:
- a
Stringcontaining a description of this service provider.
© 1993, 2021, 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.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/imageio/spi/IIOServiceProvider.html