Class IIOServiceProvider
java.lang.Object
javax.imageio.spi.IIOServiceProvider
- All Implemented Interfaces:
RegisterableService
- Direct Known Subclasses:
ImageInputStreamSpi, ImageOutputStreamSpi, ImageReaderWriterSpi, ImageTranscoderSpi
A superinterface for functionality common to all Image I/O service
provider interfaces (SPIs). For more information on service
provider classes, see the class comment for the
IIORegistry
class.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a blankIIOServiceProvider
.IIOServiceProvider
(String vendorName, String version) Constructs anIIOServiceProvider
with a given vendor name and version identifier. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
getDescription
(Locale locale) Returns a brief, human-readable description of this service provider and its associated implementation.Returns the name of the vendor responsible for creating this service provider and its associated implementation.Returns a string describing the version number of this service provider and its associated implementation.void
onDeregistration
(ServiceRegistry registry, Class<?> category) A callback that will be whenever the Spi class has been deregistered from aServiceRegistry
.void
onRegistration
(ServiceRegistry registry, Class<?> category) A callback that will be called exactly once after the Spi class has been instantiated and registered in aServiceRegistry
.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
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 thisObject
.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
Wakes up all threads that are waiting on this object's monitor.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
(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 void
wait
(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.
-
Field Details
-
vendorName
AString
to be returned fromgetVendorName
, initiallynull
. Constructors should set this to a non-null
value. -
version
AString
to be returned fromgetVersion
, initially null. Constructors should set this to a non-null
value.
-
-
Constructor Details
-
IIOServiceProvider
Constructs anIIOServiceProvider
with a given vendor name and version identifier.- Parameters:
vendorName
- the vendor name.version
- a version identifier.- Throws:
IllegalArgumentException
- ifvendorName
isnull
.IllegalArgumentException
- ifversion
isnull
.
-
IIOServiceProvider
public IIOServiceProvider()Constructs a blankIIOServiceProvider
. It is up to the subclass to initialize instance variables and/or override method implementations in order to ensure that thegetVendorName
andgetVersion
methods will return non-null
values.
-
-
Method Details
-
onRegistration
A callback that will be called exactly once after the Spi class has been instantiated and registered in aServiceRegistry
. 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:
onRegistration
in interfaceRegisterableService
- Parameters:
registry
- aServiceRegistry
where this object has been registered.category
- aClass
object indicating the registry category under which this object has been registered.- See Also:
-
onDeregistration
A callback that will be whenever the Spi class has been deregistered from aServiceRegistry
.Only the registry should call this method.
The default implementation does nothing.
- Specified by:
onDeregistration
in interfaceRegisterableService
- Parameters:
registry
- aServiceRegistry
from which this object is being (wholly or partially) deregistered.category
- aClass
object indicating the registry category from which this object is being deregistered.- See Also:
-
getVendorName
Returns the name of the vendor responsible for creating this service provider and its associated implementation. Because the vendor name may be used to select a service provider, it is not localized.The default implementation returns the value of the
vendorName
instance variable.- Returns:
- a non-
null String
containing the name of the vendor.
-
getVersion
Returns a string describing the version number of this service provider and its associated implementation. Because the version may be used by transcoders to identify the service providers they understand, this method is not localized.The default implementation returns the value of the
version
instance variable.- Returns:
- a non-
null String
containing the version of this service provider.
-
getDescription
Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the suppliedLocale
, if possible.- Parameters:
locale
- aLocale
for which the return value should be localized.- Returns:
- a
String
containing a description of this service provider.
-